ReactOS  0.4.15-dev-3165-gdf6fff7
spinlock.c File Reference
#include <hal.h>
#include <debug.h>
#include <internal/spinlock.h>
Include dependency graph for spinlock.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

VOID NTAPI HalpAcquireCmosSpinLock (VOID)
 
VOID NTAPI HalpReleaseCmosSpinLock (VOID)
 

Variables

ULONG_PTR HalpSystemHardwareFlags
 
KSPIN_LOCK HalpSystemHardwareLock
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 14 of file spinlock.c.

Function Documentation

◆ HalpAcquireCmosSpinLock()

VOID NTAPI HalpAcquireCmosSpinLock ( VOID  )

Definition at line 212 of file spinlock.c.

213 {
215 
216  /* Get flags and disable interrupts */
217  Flags = __readeflags();
218  _disable();
219 
220  /* Acquire the lock */
221  KxAcquireSpinLock(&HalpSystemHardwareLock);
222 
223  /* We have the lock, save the flags now */
225 }
uint32_t ULONG_PTR
Definition: typedefs.h:65
__INTRIN_INLINE uintptr_t __readeflags(void)
Definition: intrin_x86.h:1675
ULONG_PTR HalpSystemHardwareFlags
Definition: spinlock.c:24
KSPIN_LOCK HalpSystemHardwareLock
Definition: spinlock.c:25
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
void __cdecl _disable(void)
Definition: intrin_arm.h:365

Referenced by HalGetEnvironmentVariable(), HalMakeBeep(), HalpGetCmosData(), HalpInitializeClock(), HalpReboot(), HalpSetCmosData(), HalQueryRealTimeClock(), HalSetEnvironmentVariable(), HalSetRealTimeClock(), HalStartProfileInterrupt(), HalStopProfileInterrupt(), and RtcSetClockRate().

◆ HalpReleaseCmosSpinLock()

VOID NTAPI HalpReleaseCmosSpinLock ( VOID  )

Definition at line 229 of file spinlock.c.

230 {
232 
233  /* Get the flags */
235 
236  /* Release the lock */
237  KxReleaseSpinLock(&HalpSystemHardwareLock);
238 
239  /* Restore the flags */
241 }
uint32_t ULONG_PTR
Definition: typedefs.h:65
ULONG_PTR HalpSystemHardwareFlags
Definition: spinlock.c:24
KSPIN_LOCK HalpSystemHardwareLock
Definition: spinlock.c:25
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
__INTRIN_INLINE void __writeeflags(uintptr_t Value)
Definition: intrin_x86.h:1670

Referenced by HalGetEnvironmentVariable(), HalMakeBeep(), HalpGetCmosData(), HalpInitializeClock(), HalpSetCmosData(), HalQueryRealTimeClock(), HalSetEnvironmentVariable(), HalSetRealTimeClock(), HalStartProfileInterrupt(), HalStopProfileInterrupt(), and RtcSetClockRate().

Variable Documentation

◆ HalpSystemHardwareFlags

ULONG_PTR HalpSystemHardwareFlags

Definition at line 24 of file spinlock.c.

Referenced by HalpAcquireCmosSpinLock(), and HalpReleaseCmosSpinLock().

◆ HalpSystemHardwareLock

KSPIN_LOCK HalpSystemHardwareLock

Definition at line 25 of file spinlock.c.

Referenced by HalInitSystem(), HalpAcquireCmosSpinLock(), and HalpReleaseCmosSpinLock().