1 /* $Id: spinlock.c,v 1.11 2000/06/09 22:22:32 ea Exp $
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 ***************************************************************/
33 * FUNCTION: Acquires a spinlock
35 * SpinLock = Spinlock to acquire
36 * OldIrql (OUT) = Caller supplied storage for the previous irql
39 KeRaiseIrql(DISPATCH_LEVEL
,OldIrql
);
40 KeAcquireSpinLockAtDpcLevel(SpinLock
);
45 KeAcquireSpinLockRaiseToSynch (
59 * FUNCTION: Releases a spinlock
61 * SpinLock = Spinlock to release
62 * NewIrql = Irql level before acquiring the spinlock
65 KeReleaseSpinLockFromDpcLevel(SpinLock
);
77 KeRaiseIrql(DISPATCH_LEVEL
, &OldIrql
);
78 KeAcquireSpinLockAtDpcLevel(SpinLock
);
90 * FUNCTION: Releases a spinlock
92 * SpinLock = Spinlock to release
93 * NewIrql = Irql level before acquiring the spinlock
96 KeReleaseSpinLockFromDpcLevel(SpinLock
);