3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/hal/x86/spinlock.c
6 * PURPOSE: Implements spinlocks
7 * PROGRAMMER: David Welch (welch@cwcom.net)
8 * Eric Kohl (ekohl@rz-online.de)
14 * NOTE: On a uniprocessor machine spinlocks are implemented by raising
18 /* INCLUDES ****************************************************************/
20 #include <ddk/ntddk.h>
22 #include <internal/debug.h>
24 /* FUNCTIONS ***************************************************************/
32 * FUNCTION: Acquires a spinlock
34 * SpinLock = Spinlock to acquire
35 * OldIrql (OUT) = Caller supplied storage for the previous irql
38 KeRaiseIrql(DISPATCH_LEVEL,OldIrql);
39 KeAcquireSpinLockAtDpcLevel(SpinLock);
43 KeAcquireSpinLockRaiseToSynch (
47 ASSERT_IRQL(SYNCH_LEVEL);
48 KeAcquireSpinLockAtDpcLevel(SpinLock);
57 * FUNCTION: Releases a spinlock
59 * SpinLock = Spinlock to release
60 * NewIrql = Irql level before acquiring the spinlock
63 KeReleaseSpinLockFromDpcLevel(SpinLock);
74 KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);
75 KeAcquireSpinLockAtDpcLevel(SpinLock);
86 * FUNCTION: Releases a spinlock
88 * SpinLock = Spinlock to release
89 * NewIrql = Irql level before acquiring the spinlock
92 KeReleaseSpinLockFromDpcLevel(SpinLock);