ReactOS  r73890
spinlock.c File Reference
#include <hal.h>
#include <debug.h>
Include dependency graph for spinlock.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

VOID NTAPI KeRaiseIrql (KIRQL NewIrql, PKIRQL OldIrql)
 
VOID NTAPI KeLowerIrql (KIRQL NewIrql)
 
VOID NTAPI KeAcquireSpinLock (PKSPIN_LOCK SpinLock, PKIRQL OldIrql)
 
KIRQL FASTCALL KeAcquireSpinLockRaiseToSynch (PKSPIN_LOCK SpinLock)
 
VOID NTAPI KeReleaseSpinLock (PKSPIN_LOCK SpinLock, KIRQL NewIrql)
 
KIRQL FASTCALL KfAcquireSpinLock (PKSPIN_LOCK SpinLock)
 
VOID FASTCALL KfReleaseSpinLock (PKSPIN_LOCK SpinLock, KIRQL OldIrql)
 
KIRQL FASTCALL KeAcquireQueuedSpinLock (IN KSPIN_LOCK_QUEUE_NUMBER LockNumber)
 
KIRQL FASTCALL KeAcquireQueuedSpinLockRaiseToSynch (IN KSPIN_LOCK_QUEUE_NUMBER LockNumber)
 
VOID FASTCALL KeAcquireInStackQueuedSpinLock (IN PKSPIN_LOCK SpinLock, IN PKLOCK_QUEUE_HANDLE LockHandle)
 
VOID FASTCALL KeAcquireInStackQueuedSpinLockRaiseToSynch (IN PKSPIN_LOCK SpinLock, IN PKLOCK_QUEUE_HANDLE LockHandle)
 
VOID FASTCALL KeReleaseQueuedSpinLock (IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, IN KIRQL OldIrql)
 
VOID FASTCALL KeReleaseInStackQueuedSpinLock (IN PKLOCK_QUEUE_HANDLE LockHandle)
 
BOOLEAN FASTCALL KeTryToAcquireQueuedSpinLockRaiseToSynch (IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, IN PKIRQL OldIrql)
 
LOGICAL FASTCALL KeTryToAcquireQueuedSpinLock (IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, OUT PKIRQL OldIrql)
 

Macro Definition Documentation

#define NDEBUG

Definition at line 12 of file spinlock.c.

Function Documentation

VOID FASTCALL KeAcquireInStackQueuedSpinLock ( IN PKSPIN_LOCK  SpinLock,
IN PKLOCK_QUEUE_HANDLE  LockHandle 
)

Definition at line 130 of file spinlock.c.

Referenced by ExDeleteResourceLite(), ExInitializeResourceLite(), KiAcquireApcLockAtApcLevel(), and KiAcquireDeviceQueueLock().

132 {
133  /* Simply raise to dispatch */
135 }
KIRQL FASTCALL KfRaiseIrql(KIRQL NewIrql)
Definition: irql.c:243
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
*LockHandle LockHandle _Out_ PKLOCK_QUEUE_HANDLE LockHandle
Definition: kefuncs.h:742
VOID FASTCALL KeAcquireInStackQueuedSpinLockRaiseToSynch ( IN PKSPIN_LOCK  SpinLock,
IN PKLOCK_QUEUE_HANDLE  LockHandle 
)

Definition at line 142 of file spinlock.c.

Referenced by KiAcquireApcLock(), and KiAcquireProcessLock().

144 {
145  /* Simply raise to dispatch */
147 }
KIRQL FASTCALL KfRaiseIrql(KIRQL NewIrql)
Definition: irql.c:243
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
*LockHandle LockHandle _Out_ PKLOCK_QUEUE_HANDLE LockHandle
Definition: kefuncs.h:742
KIRQL FASTCALL KeAcquireQueuedSpinLock ( IN KSPIN_LOCK_QUEUE_NUMBER  LockNumber)

Definition at line 108 of file spinlock.c.

Referenced by _MiFlushMappedSection(), ExLockPool(), IoAcquireCancelSpinLock(), IoAcquireVpbSpinLock(), IoEnumerateDeviceObjectList(), IopDecrementDeviceObjectRef(), IopDisassociateThreadIrp(), IopEditDeviceList(), IopGetDevicePDO(), IopInterlockedDecrementUlong(), IopInterlockedIncrementUlong(), MiAllocatePagesForMdl(), MiAllocatePoolPages(), MiBalancerThread(), MiBuildPagedPool(), MiBuildPfnDatabaseFromLoaderBlock(), MiCheckPurgeAndUpMapCount(), MiDeleteARM3Section(), MiDeleteSystemPageableVm(), MiDeleteVirtualAddresses(), MiDereferenceControlArea(), MiDispatchFault(), MiFillSystemPageDirectory(), MiFindContiguousPages(), MiFlushTbAndCapture(), MiFreeContiguousMemory(), MiFreePoolPages(), MiGetPageProtection(), MiGetPteForProcess(), MiInitializeAndChargePfn(), MiInitializePoolEvents(), MiInitMachineDependent(), MiLoadImageSection(), MiMakeSystemAddressValidPfn(), MiProcessValidPteList(), MiProtectVirtualMemory(), MiReleaseProcessReferenceToSessionDataPage(), MiReleaseSystemPtes(), MiRemoveMappedPtes(), MiRemoveMappedView(), MiReserveAlignedSystemPtes(), MiResolveDemandZeroFault(), MiResolvePageFileFault(), MiResolveProtoPteFault(), MiSegmentDelete(), MiSessionCommitPageTables(), MiSessionCreateInternal(), MiSessionInitializeWorkingSetList(), MiSetControlAreaSymbolsLoaded(), MmAllocateSpecialPool(), MmAllocPage(), MmArmAccessFault(), MmCreateArm3Section(), MmCreateKernelStack(), MmCreateProcessAddressSpace(), MmDeleteKernelStack(), MmDeleteProcessAddressSpace(), MmDeleteProcessAddressSpace2(), MmDereferencePage(), MmFreeLoaderBlock(), MmFreeMemoryArea(), MmFreePagesFromMdl(), MmFreeSpecialPool(), MmGetLRUFirstUserPage(), MmGetLRUNextUserPage(), MmGetPhysicalMemoryRanges(), MmGetReferenceCountPage(), MmGetRmapListHeadPage(), MmGetSavedSwapEntryPage(), MmGrowKernelStackEx(), MmInitializeProcessAddressSpace(), MmInsertLRULastUserPage(), MmNotPresentFaultCachePage(), MmPageOutSectionView(), MmProbeAndLockPages(), MmRemoveLRUUserPage(), MmSetRmapListHeadPage(), MmSetSavedSwapEntryPage(), MmUnlockPages(), and MmZeroPageThread().

109 {
110  /* Simply raise to dispatch */
111  return KfRaiseIrql(DISPATCH_LEVEL);
112 }
KIRQL FASTCALL KfRaiseIrql(KIRQL NewIrql)
Definition: irql.c:243
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
KIRQL FASTCALL KeAcquireQueuedSpinLockRaiseToSynch ( IN KSPIN_LOCK_QUEUE_NUMBER  LockNumber)

Definition at line 119 of file spinlock.c.

120 {
121  /* Simply raise to dispatch */
122  return KfRaiseIrql(DISPATCH_LEVEL);
123 }
KIRQL FASTCALL KfRaiseIrql(KIRQL NewIrql)
Definition: irql.c:243
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
VOID NTAPI KeAcquireSpinLock ( PKSPIN_LOCK  SpinLock,
PKIRQL  OldIrql 
)

Definition at line 50 of file spinlock.c.

Referenced by VideoPortAcquireSpinLock().

52 {
53  /* Call the fastcall function */
55 }
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK SpinLock
Definition: iofuncs.h:798
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
KIRQL FASTCALL KfAcquireSpinLock(PKSPIN_LOCK SpinLock)
Definition: spinlock.c:85
KIRQL FASTCALL KeAcquireSpinLockRaiseToSynch ( PKSPIN_LOCK  SpinLock)

Definition at line 62 of file spinlock.c.

Referenced by MiProcessLoaderEntry().

63 {
64  /* Simply raise to dispatch */
66 }
KIRQL FASTCALL KfRaiseIrql(KIRQL NewIrql)
Definition: irql.c:243
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
VOID NTAPI KeLowerIrql ( KIRQL  NewIrql)

Definition at line 39 of file spinlock.c.

Referenced by KeReleaseInStackQueuedSpinLock(), KeReleaseInterruptSpinLock(), KeReleaseQueuedSpinLock(), KeReleaseSpinLock(), and KfReleaseSpinLock().

40 {
41  /* Call the fastcall function */
43 }
VOID FASTCALL KfLowerIrql(KIRQL NewIrql)
Definition: irql.c:210
_Requires_lock_held_ SpinLock _Releases_lock_ SpinLock _In_ _IRQL_restores_ KIRQL NewIrql
Definition: ke.h:114
VOID NTAPI KeRaiseIrql ( KIRQL  NewIrql,
PKIRQL  OldIrql 
)

Definition at line 27 of file spinlock.c.

Referenced by KeAcquireInStackQueuedSpinLock(), KeAcquireInStackQueuedSpinLockRaiseToSynch(), KeAcquireInterruptSpinLock(), KeAcquireQueuedSpinLock(), KeAcquireQueuedSpinLockRaiseToSynch(), KeAcquireSpinLockRaiseToDpc(), KeAcquireSpinLockRaiseToSynch(), KeTryToAcquireQueuedSpinLock(), and KeTryToAcquireQueuedSpinLockRaiseToSynch().

29 {
30  /* Call the fastcall function */
32 }
KIRQL FASTCALL KfRaiseIrql(KIRQL NewIrql)
Definition: irql.c:243
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
_Requires_lock_held_ SpinLock _Releases_lock_ SpinLock _In_ _IRQL_restores_ KIRQL NewIrql
Definition: ke.h:114
VOID FASTCALL KeReleaseInStackQueuedSpinLock ( IN PKLOCK_QUEUE_HANDLE  LockHandle)

Definition at line 166 of file spinlock.c.

Referenced by ExDeleteResourceLite(), ExInitializeResourceLite(), KiReleaseApcLock(), KiReleaseDeviceQueueLock(), and KiReleaseProcessLock().

167 {
168  /* Simply lower IRQL back */
170 }
VOID FASTCALL KfLowerIrql(KIRQL NewIrql)
Definition: irql.c:210
*LockHandle LockHandle _Out_ PKLOCK_QUEUE_HANDLE LockHandle
Definition: kefuncs.h:742
VOID FASTCALL KeReleaseQueuedSpinLock ( IN KSPIN_LOCK_QUEUE_NUMBER  LockNumber,
IN KIRQL  OldIrql 
)

Definition at line 154 of file spinlock.c.

Referenced by _MiFlushMappedSection(), ExUnlockPool(), IoEnumerateDeviceObjectList(), IopDecrementDeviceObjectRef(), IopDisassociateThreadIrp(), IopEditDeviceList(), IopGetDevicePDO(), IopInterlockedDecrementUlong(), IopInterlockedIncrementUlong(), IoReleaseCancelSpinLock(), IoReleaseVpbSpinLock(), MiAllocatePagesForMdl(), MiAllocatePoolPages(), MiBalancerThread(), MiBuildPagedPool(), MiBuildPfnDatabaseFromLoaderBlock(), MiCheckControlArea(), MiCheckPurgeAndUpMapCount(), MiCompleteProtoPteFault(), MiDeleteSystemPageableVm(), MiDeleteVirtualAddresses(), MiDispatchFault(), MiFillSystemPageDirectory(), MiFindContiguousPages(), MiFlushTbAndCapture(), MiFreeContiguousMemory(), MiFreePoolPages(), MiGetPageProtection(), MiGetPteForProcess(), MiInitializeAndChargePfn(), MiInitializePoolEvents(), MiInitMachineDependent(), MiLoadImageSection(), MiMakeSystemAddressValidPfn(), MiProcessValidPteList(), MiProtectVirtualMemory(), MiReleaseProcessReferenceToSessionDataPage(), MiReleaseSystemPtes(), MiRemoveMappedPtes(), MiReserveAlignedSystemPtes(), MiResolveDemandZeroFault(), MiResolvePageFileFault(), MiResolveProtoPteFault(), MiSegmentDelete(), MiSessionCommitPageTables(), MiSessionCreateInternal(), MiSessionInitializeWorkingSetList(), MiSetControlAreaSymbolsLoaded(), MmAllocateSpecialPool(), MmAllocPage(), MmArmAccessFault(), MmCreateArm3Section(), MmCreateKernelStack(), MmCreateProcessAddressSpace(), MmDeleteKernelStack(), MmDeleteProcessAddressSpace(), MmDeleteProcessAddressSpace2(), MmDereferencePage(), MmFreeLoaderBlock(), MmFreeMemoryArea(), MmFreePagesFromMdl(), MmFreeSpecialPool(), MmGetLRUFirstUserPage(), MmGetLRUNextUserPage(), MmGetPhysicalMemoryRanges(), MmGetReferenceCountPage(), MmGetRmapListHeadPage(), MmGetSavedSwapEntryPage(), MmGrowKernelStackEx(), MmInitializeProcessAddressSpace(), MmInsertLRULastUserPage(), MmNotPresentFaultCachePage(), MmPageOutSectionView(), MmProbeAndLockPages(), MmRemoveLRUUserPage(), MmSetRmapListHeadPage(), MmSetSavedSwapEntryPage(), MmUnlockPages(), and MmZeroPageThread().

156 {
157  /* Simply lower IRQL back */
159 }
VOID FASTCALL KfLowerIrql(KIRQL NewIrql)
Definition: irql.c:210
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
VOID NTAPI KeReleaseSpinLock ( PKSPIN_LOCK  SpinLock,
KIRQL  NewIrql 
)

Definition at line 73 of file spinlock.c.

Referenced by VideoPortReleaseSpinLock().

75 {
76  /* Call the fastcall function */
78 }
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK SpinLock
Definition: iofuncs.h:798
VOID FASTCALL KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL OldIrql)
Definition: spinlock.c:96
_Requires_lock_held_ SpinLock _Releases_lock_ SpinLock _In_ _IRQL_restores_ KIRQL NewIrql
Definition: ke.h:114
LOGICAL FASTCALL KeTryToAcquireQueuedSpinLock ( IN KSPIN_LOCK_QUEUE_NUMBER  LockNumber,
OUT PKIRQL  OldIrql 
)

Definition at line 192 of file spinlock.c.

Referenced by DEFINE_ACQUIRE().

194 {
195  /* Simply raise to dispatch */
197 
198  /* Always return true on UP Machines */
199  return TRUE;
200 }
#define TRUE
Definition: numbers.c:17
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
VOID NTAPI KeRaiseIrql(KIRQL NewIrql, PKIRQL OldIrql)
Definition: spinlock.c:27
BOOLEAN FASTCALL KeTryToAcquireQueuedSpinLockRaiseToSynch ( IN KSPIN_LOCK_QUEUE_NUMBER  LockNumber,
IN PKIRQL  OldIrql 
)

Definition at line 177 of file spinlock.c.

Referenced by TryQueuedSynch().

179 {
180  /* Simply raise to synch */
182 
183  /* Always return true on UP Machines */
184  return TRUE;
185 }
#define TRUE
Definition: numbers.c:17
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
#define SYNCH_LEVEL
Definition: env_spec_w32.h:704
VOID NTAPI KeRaiseIrql(KIRQL NewIrql, PKIRQL OldIrql)
Definition: spinlock.c:27
KIRQL FASTCALL KfAcquireSpinLock ( PKSPIN_LOCK  SpinLock)

Definition at line 85 of file spinlock.c.

Referenced by HalAllocateAdapterChannel(), HalpGrowMapBuffers(), IoFreeAdapterChannel(), IoFreeMapRegisters(), IoMapTransfer(), and KeAcquireSpinLock().

86 {
87  /* Simply raise to dispatch */
89 }
KIRQL FASTCALL KfRaiseIrql(KIRQL NewIrql)
Definition: irql.c:243
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
VOID FASTCALL KfReleaseSpinLock ( PKSPIN_LOCK  SpinLock,
KIRQL  OldIrql 
)

Definition at line 96 of file spinlock.c.

Referenced by HalAllocateAdapterChannel(), HalpGrowMapBuffers(), IoFreeAdapterChannel(), IoFreeMapRegisters(), IoMapTransfer(), and KeReleaseSpinLock().

98 {
99  /* Simply lower IRQL back */
101 }
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
VOID NTAPI KeLowerIrql(KIRQL NewIrql)
Definition: spinlock.c:39