EvtInterruptIsr

A driver's EvtInterruptIsr event callback function services a hardware interrupt.

構文

EVT_WDF_INTERRUPT_ISR EvtInterruptIsr;

BOOLEAN EvtInterruptIsr(
  __in  WDFINTERRUPT Interrupt,
  __in  ULONG MessageID
)
{ ... }

パラメーター

Interrupt [in]

A handle to a framework interrupt object.

MessageID [in]

If the device is using message-signaled interrupts (MSIs), this parameter is the message number that identifies the device's hardware interrupt message. Otherwise, this value is 0.

戻り値

The EvtInterruptIsr callback function must return TRUE if the function services the hardware interrupt. Otherwise, this function must return FALSE.

解説

To register an EvtInterruptIsr callback function, your driver must place the callback function's address in a WDF_INTERRUPT_CONFIG structure before calling WdfInterruptCreate.

The EvtInterruptIsr callback function is a framework-based driver's interrupt service routine (ISR), which is called when a hardware interrupt occurs.

If the interrupt is not from the hardware that this EvtInterruptIsr callback function services, the driver must return FALSE. If the interrupt vector is being shared, the system calls another interrupt service routine.

Before calling the EvtInterruptIsr callback function, the framework raises the processor's IRQL to the device's DIRQL and acquires the spin lock that the driver specified in the interrupt object's WDF_INTERRUPT_CONFIG structure.

Because the EvtInterruptIsr callback function executes at a relatively high IRQL, it can call very few framework object methods or system routines. Additionally, this callback function cannot access pageable code.

Typically, the EvtInterruptIsr callback function clears the hardware interrupt and saves any information that might be lost after the callback function returns and the system lowers the IRQL (because lowering the IRQL allows additional interrupts to occur). Framework-based drivers should save information about the interrupt in the interrupt object's context space.

Drivers typically provide an EvtInterruptDpc callback function to process the saved information at a lower IRQL. (A few drivers provide one or more EvtDpcFunc callback functions instead of an EvtInterruptDpc callback function.) For information about scheduling an EvtInterruptDpc callback function for execution, see Servicing an Interrupt.

The EvtInterruptIsr callback function must be able to service several interrupts before the EvtInterruptDpc callback function executes. Therefore, the driver might have to store interrupt data from several interrupts, and the EvtInterruptIsr andEvtInterruptDpc callback functions might have to determine which interrupt data has been completely processed by the driver and which has not.

For more information about handling interrupts in framework-based drivers, see Handling Hardware Interrupts.

The function type is declared in Wdfinterrupt.h, as follows.

typedef BOOLEAN
  (EVT_WDF_INTERRUPT_ISR) (
    IN WDFINTERRUPT  Interrupt,
    IN ULONG  MessageID
    );

To define an EvtInterruptIsr callback function that is named MyInterruptIsr, you must first provide a function declaration that SDV and other verification tools require, as follows:

EVT_WDF_INTERRUPT_ISR  MyInterruptIsr;

Then, implement your callback function as follows:

BOOLEAN
 MyInterruptIsr (
    IN WDFINTERRUPT  Interrupt,
    IN ULONG  MessageID
    )
  {...}

要件

バージョン

Supported by version 1.0 and later versions of KMDF.

ヘッダー

Wdfinterrupt.h (includeWdf.h)

参照

WdfInterruptCreate
WdfInterruptGetDevice
WdfInterruptGetInfo
WdfInterruptWdmGetInterrupt
WDF_INTERRUPT_CONFIG
EvtDpcFunc
EvtInterruptDpc

 

 

コミュニティの追加

追加
表示:
© 2015 Microsoft