ReactOS  0.4.15-dev-5462-g4d0d22a
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 226 of file spinlock.c.

227 {
229 
230  /* Get flags and disable interrupts */
231  Flags = __readeflags();
232  _disable();
233 
234  /* Acquire the lock */
235  KxAcquireSpinLock(&HalpSystemHardwareLock);
236 
237  /* We have the lock, save the flags now */
239 }
uint32_t ULONG_PTR
Definition: typedefs.h:65
__INTRIN_INLINE uintptr_t __readeflags(void)
Definition: intrin_x86.h:1674
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 243 of file spinlock.c.

244 {
246 
247  /* Get the flags */
249 
250  /* Release the lock */
251  KxReleaseSpinLock(&HalpSystemHardwareLock);
252 
253  /* Restore the flags */
255 }
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:1669

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().