A.4.1.5  Interrupt Handling

A driver that can run on an SMP machine must be designed such that shared resources are protected when concurrently executing threads may access the same resources simultaneously.

If two driver functions (or the same function executing on two CPUs) execute at the same IRQL and they share data, that data may be protected with a spin lock. The spin lock is acquired by calling NdisAcquireSpinLock and released by calling NdisReleaseSpinLock.

If a driver manages a NIC that interrupts, and any nonISR function of that driver shares data with the ISR of that driver, access to the shared data must be synchronized. Before a nonISR function accesses the shared data, it must call NdisSynchronizeWithInterrupt which synchronizes execution of a caller-supplied routine with execution of the ISR. NdisSynchronizeWithInterrupt temporarily raises the IRQL of the nonISR function supplied routine to that of the ISR so that the access to the shared resources can be serialized. The driver must be designed so that the synchronization routine executes as quickly as possible.