Interrupt Service Routines (Windows CE 5.0)
An interrupt service routine (ISR) is a software routine that hardware invokes in response to an interrupt. ISRs examine an interrupt and determine how to handle it. ISRs handle the interrupt, and then return a logical interrupt value. If no further handling is required because the device is disabled or data is buffered, the ISR notifies the kernel with a SYSINTR_NOP return value. An ISR must perform very fast to avoid slowing down the operation of the device and the operation of all lower priority ISRs.
Although an ISR might move data from a CPU register or a hardware port into a memory buffer, in general it relies on a dedicated interrupt thread, called the interrupt service thread (IST), to do most of the required processing. If additional processing is required, the ISR returns a logical interrupt value, other than SYSINTR_NOP, to the kernel. It then maps a physical interrupt number to a logical interrupt value. For example, the keyboard might be associated with hardware interrupt 4 on one device and hardware interrupt 15 on another device. The ISR, which is in the OAL, translates the hardware-specific value to the Windows CE standard value of SYSINTR_KEYBOARD. In this example, SYSINTR_KEYBOARD is the return value from the ISR.
When an ISR notifies the kernel of a specific logical interrupt value, the kernel examines an internal table to map the logical interrupt value to an event handle. The kernel wakes the IST by signaling the event. An event is a standard Microsoft® Win32® synchronization object that serves as an alarm clock to wake up a thread when something interesting happens.
The following table compares hardware platforms that support a single ISR with hardware platforms that support multiple ISRs.
|Single ISR hardware platform||The name of the ISR is OEMInterruptHandler.|
|Multiple ISR hardware platform||The OAL does not provide an OEMInterruptHandler function. Instead, you must register ISRs for each interrupt by calling HookInterrupt function in the OAL.|
Note Other than having to map from an IRQ to an interrupt service routine, handling interrupts with multiple ISRs is identical to handling interrupts when a single ISR is present. One reason not to process data in the ISR is that there is no way to access the user buffer. The user mode IST routine can access this buffer.
In This Section
- Installable ISRs and Device Drivers
- Describes how installable ISRs interact with device drivers.
- Installable ISRs and the Kernel
- Describes how installable ISRs interact with the kernel.
- Installing an ISR and Waiting for Interrupt Events
- Describes how to install an ISR and then wait for interrupt events.
- Troubleshooting: Building an ISR
- Describes how to resolve ISR build errors.
- Defining an Interrupt Identifier
- Describes how to define an interrupt identifier.
Send Feedback on this topic to the authors