Shared Interrupt – Setting the Interrupt Handler

Example for setting an interrupt handler for shared interrupts of PCI devices. See previous slide 11: “PCI Interrupts” for details on how to use the PCI library.
 
For PCI and MSI interrupts, use SetRtInterruptHandlerEx to set the interrupt handler. The first three parameters are identical to the function SetRtInterruptHandler, see previous slide 6: “Interrupt Thread”.
For shared PCI interrupts, the parameter wLevel is generated by respective calls to the PCI library (see slide 11, “PCI Interrupts”) and or’ed with SHARED_LEVEL.
byMaxInt specifies if there is only an interrupt handler (set to 0) or if the interrupt gets serviced by an interrupt thread (set <0). If by thread, byMaxInt is the number of outstanding SignalRtInterruptThread requests that the handler can make before the associated interrupt level is disabled. This number generally corresponds to the number of buffers used by the handler and interrupt thread.
For IOAPIC and MSI interrupts, byMaxInt should normally be set to 255.
 
There is one additional parameter that varies for shared vs. MSI interrupts. For shared interrupts, lpParamBlock is a pointer to a user-defined parameter block for this handler.
 
SetRtInterruptHandlerEx returns a 16-bit reference identifying this handler. The reference is a modified interrupt level that identifies the specific handler to INtime.