Interrupts and Exceptions

Windows CE separates interrupt processing into two parts: an interrupt service routine (ISR) and an interrupt service thread (IST). ISRs are implemented in the OEM Adaptation Layer (OAL) and their primary function is to identify the source of the interrupt and pass that information along to the kernel. The kernel uses a predefined set of interrupt identifiers to locate the target device that is requesting interrupt processing. You can create additional identifiers as needed. The kernel's exception handler schedules the IST, which is responsible for actually servicing the device interrupt.

ISR calls can be nested so that higher priority interrupt requests are not delayed. The depth to which ISRs can be nested is determined by the hardware. For more information, see Nested Interrupts.

Windows CE also supports installable ISRs, which allow you to service requests from new devices that are added after the original platform is built. For more information, see Installable ISRs.

The Windows CE kernel provides the following functions for enabling and disabling interrupts so that OAL routines can perform critical operations without interruption:

  • INTERRUPTS_ON enables all interrupts.
  • INTERRUPTS_OFF disables all interrupts.
  • INTERRUPTS_ENABLE enables and disables all interrupts based on the argument passed to the function and returns the current state (TRUE if enabled, FALSE if disabled).

The InterruptDisable function disables hardware interrupts. The InterruptDone function signals to the kernel that the device driver or OAL has completed its interrupt processing.

Exceptions

The following functions give applications access to the kernel's exception handler:

  • AbnormalTermination indicates whether the try block of a try-finally statement terminated as expected.
  • GetExceptionCode retrieves a code that identifies the type of exception that occurred.
  • GetExceptionInformation retrieves a machine-independent description of an exception, and information about the machine state that existed for the thread when the exception occurred.
  • RaiseException raises an exception in the calling thread.

See Also

Migrating from an Open Source Platform to Windows CE

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.