Previous Next

KeAcquireInterruptSpinLock

The KeAcquireInterruptSpinLock routine acquires the spin lock associated with an interrupt object.

NTKERNELAPI
KIRQL
  KeAcquireInterruptSpinLock (
    IN PKINTERRUPT  Interrupt
    );

Parameters

Interrupt
Specifies a pointer to an interrupt object. This value must be supplied by IoConnectInterrupt.

Return Value

KeAcquireInterruptSpinLock returns the current IRQL at the time the routine is called. This value is passed to KeReleaseInterruptSpinLock when the spin lock is released.

Headers

Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.

Comments

Drivers use the interrupt spin lock to synchronize access to memory shared with the interrupt's ISR. The driver can release the spin lock by calling KeReleaseInterruptSpinLock.

Any code that executes while the interrupt spin lock is held does so at IRQL = DIRQL for the specified Interrupt, so it must execute very quickly. For more information, see Using Critical Sections.

It is generally faster to use KeSynchronizeExecution to synchronize access than to use KeAcquireInterruptSpinLock and KeReleaseInterruptSpinLock.

Callers must be running at IRQL <= DIRQL for Interrupt. (This is the value the driver passed as the SynchronizeIrql parameter of IoConnectInterrupt when Interrupt is created.)

See Also

IoConnectInterrupt, KeReleaseInterruptSpinLock, KeSynchronizeExecution