MSI – Setting the Interrupt Handler
Setting up an interrupt handler for an MSI capable device requires initialization of the PCIDEV structures (see slide 11: “PCI Interrupts”) plus MSI specific settings shown in the example above. The handler has the same API as for shared interrupts.
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 message signaled interrupts, set the 1st parameter to MSI_LEVEL. In this case, a wLevel is calculated and returned by SetRtInterruptHandlerEx.
There is one additional parameter that varies for shared vs. MSI interrupts. For MSI interrupts, the 4th parameter must point to an initialized MSI_PARAM or MSI_PARAM_EX structure. This structure then has a pointer to a parameter block that is passed into the interrupt handler with every call.
SetRtInterruptHandlerEx returns a 16-bit reference identifying this handler. The reference is a modified interrupt level that identifies the specific handler to INtime.