共用方式為


MiniportSynchronizeISR (Compact 2013)

3/26/2014

This function is required for network adapter driver functions that run at less than DIRQL and share resources with that driver's MiniportISR or MiniportDisableInterrupt function.

Syntax

BOOLEAN MiniportSynchronizeISR(
  PVOID SynchronizeContext 
);

Parameters

  • SynchronizeContext
    [in] Points to a context area supplied when the network adapter driver's MiniportXxx or internal function called NdisMSynchronizeWithInterrupt. Usually, this input parameter is a pointer to a set of shared resources at an offset within the network adapter-specific MiniportAdapterContext area passed to other MiniportXxx functions.

Return Value

MiniportSynchronizeISR returns a Boolean with a driver-determined meaning that is propagated to the caller of NdisMSynchronizeWithInterrupt.

Remarks

If any network adapter driver function shares resources, such as device registers, with the driver's MiniportISR or MiniportDisableInterrupt function, the driver function that runs, by default, at less than DIRQL cannot access those resources directly. If it attempted to access such shared resources directly, the lower priority function might be pre-empted by execution of MiniportISR or MiniportDisableInterrupt. This could change state out from under the lower priority driver function.

To synchronize access to such shared resources with MiniportISR or MiniportDisableInterrupt, lower priority driver functions must call NdisMSynchronizeWithInterrupt to have the driver's MiniportSynchronizeISR function access those shared resources at DIRQL. Calling NdisMSynchronizeWithInterrupt prevents race conditions and deadlocks in such a network adapter driver, especially in SMP machines.

Any lower priority driver functions that share resources among themselves (but not with any function that runs at DIRQL) should use a spin lock to protect those shared resources.

MiniportSynchronizeISR runs at the DIRQL assigned when the driver's MiniportInitialize function called NdisMRegisterInterrupt. Like any driver function that runs at DIRQL, MiniportSynchronizeISR should return control as quickly as possible, and it can call only those NdisXXX functions that are safe to call at any IRQL.

Requirements

Header

externs.h

See Also

Reference

NDIS 5.x Legacy Functions
MiniportDisableInterrupt
MiniportInitialize
MiniportISR
NdisAllocateSpinLock
NdisMRegisterInterrupt
NdisMSynchronizeWithInterrupt
NDIS 5.x Legacy Reference