1 /* $Id: spinlock.c,v 1.3 2002/09/08 10:22:24 chorns 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 ***************************************************************/
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 (
56 * FUNCTION: Releases a spinlock
58 * SpinLock = Spinlock to release
59 * NewIrql = Irql level before acquiring the spinlock
62 KeReleaseSpinLockFromDpcLevel(SpinLock
);
73 KeRaiseIrql(DISPATCH_LEVEL
, &OldIrql
);
74 KeAcquireSpinLockAtDpcLevel(SpinLock
);
85 * FUNCTION: Releases a spinlock
87 * SpinLock = Spinlock to release
88 * NewIrql = Irql level before acquiring the spinlock
91 KeReleaseSpinLockFromDpcLevel(SpinLock
);