A.2.3.11 Spin Lock Functions

NDIS interface library spin lock functions are described in Table A.2.A.2. These functions deal with initialization, acquisition, release, and freeing of spin locks. In a multiprocessor environment, they address both interprocessor and intraprocessor synchronization at the same time. For a uniprocessor environment, the functions are optimized to ignore interprocessor synchronization. Spin lock functions use executive spin locks; therefore the NIC driver cannot call them if it is running above the IRQL DISPATCH_LEVEL within MacInterruptServiceRoutine or NdisSynchronizeWithInterrupt.

Table A.2.14 Spin Lock Functions

Function

Definition

NdisAcquireSpinLock

Acquires an NDIS interface library spin lock to give the driver exclusive use of resources that the spin lock protects.

NdisAllocateSpinLock 

Initializes an NDIS interface library spin lock, setting it to the released state.

NdisDprAcquireSpinLock

Called by MacDeferredProcessingRoutine to acquire a spin lock.

NdisDprReleaseSpinLock

Releases a spin lock the DPR has acquired by calling NdisDprAcquireSpinLock.

NdisFreeSpinLock

Frees a structure that NdisAllocateSpinLock has allocated as an NDIS interface library spin lock.

NdisReleaseSpinLock

Releases an acquired spin lock so that other executing threads can use resources that it protects.