https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c026b5950e9091da13a0143b32b5625dcaca69fd

commit c026b5950e9091da13a0143b32b5625dcaca69fd
Author:     Hermès Bélusca-Maïto <[email protected]>
AuthorDate: Tue Mar 8 04:44:46 2022 +0100
Commit:     Hermès Bélusca-Maïto <[email protected]>
CommitDate: Sun May 8 17:21:43 2022 +0200

    [FREELDR][MINIHAL] Move KefAcquireSpinLockAtDpcLevel stub back to HAL, 
#ifdef'ed in _MINIHAL_ where it's only needed.
---
 boot/freeldr/freeldr/arch/i386/ntoskrnl.c | 15 ---------------
 hal/halx86/generic/spinlock.c             | 14 ++++++++++++++
 2 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/boot/freeldr/freeldr/arch/i386/ntoskrnl.c 
b/boot/freeldr/freeldr/arch/i386/ntoskrnl.c
index 40a3d16466e..d14d822c8e3 100644
--- a/boot/freeldr/freeldr/arch/i386/ntoskrnl.c
+++ b/boot/freeldr/freeldr/arch/i386/ntoskrnl.c
@@ -23,21 +23,6 @@ KeInitializeEvent(
     RtlZeroMemory(Event, sizeof(*Event));
 }
 
-VOID
-FASTCALL
-KefAcquireSpinLockAtDpcLevel(
-    IN PKSPIN_LOCK SpinLock)
-{
-#if DBG
-    /* To be on par with HAL/NTOSKRNL */
-#ifdef _M_AMD64
-    *SpinLock = (KSPIN_LOCK)KeGetCurrentThread() | 1;
-#else
-    *SpinLock = (KSPIN_LOCK)(((PKIPCR)KeGetPcr())->PrcbData.CurrentThread) | 1;
-#endif
-#endif
-}
-
 VOID
 NTAPI
 KeSetTimeIncrement(
diff --git a/hal/halx86/generic/spinlock.c b/hal/halx86/generic/spinlock.c
index 4ffce2e665e..32b8c36e56f 100644
--- a/hal/halx86/generic/spinlock.c
+++ b/hal/halx86/generic/spinlock.c
@@ -28,6 +28,19 @@ KSPIN_LOCK HalpSystemHardwareLock;
 
 #ifdef _M_IX86
 
+#ifdef _MINIHAL_
+VOID
+FASTCALL
+KefAcquireSpinLockAtDpcLevel(
+    IN PKSPIN_LOCK SpinLock)
+{
+#if DBG
+    /* To be on par with HAL/NTOSKRNL */
+    *SpinLock = (KSPIN_LOCK)KeGetCurrentThread() | 1;
+#endif
+}
+#endif /* defined(_MINIHAL_) */
+
 /*
  * @implemented
  */
@@ -205,6 +218,7 @@ KeTryToAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER 
LockNumber,
     return KeTryToAcquireSpinLockAtDpcLevel(Lock);
 }
 #endif /* !defined(_MINIHAL_) */
+
 #endif /* defined(_M_IX86) */
 
 VOID

Reply via email to