From c026b5950e9091da13a0143b32b5625dcaca69fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Tue, 8 Mar 2022 04:44:46 +0100 Subject: [PATCH] [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