ntoskrnl.exe: Implement KeAcquireSpinLockRaiseToDpc().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-01-23 23:50:37 -06:00 committed by Alexandre Julliard
parent 389b8fc393
commit fee112f90a
4 changed files with 24 additions and 10 deletions

View File

@ -3854,15 +3854,6 @@ void WINAPI KeReleaseInStackQueuedSpinLock( KLOCK_QUEUE_HANDLE *handle )
FIXME( "stub: %p\n", handle );
}
/***********************************************************************
* KeAcquireSpinLockRaiseToDpc (NTOSKRNL.EXE.@)
*/
KIRQL WINAPI KeAcquireSpinLockRaiseToDpc(KSPIN_LOCK *spinlock)
{
FIXME( "stub: %p\n", spinlock );
return 0;
}
/***********************************************************************
* IoCreateNotificationEvent (NTOSKRNL.EXE.@)
*/

View File

@ -511,7 +511,7 @@
@ stdcall Ke386SetIoAccessMap(long ptr)
@ stub KeAcquireInterruptSpinLock
@ stub KeAcquireSpinLockAtDpcLevel
@ stdcall -arch=x86_64 KeAcquireSpinLockRaiseToDpc(ptr)
@ stdcall -arch=arm,arm64,x86_64 KeAcquireSpinLockRaiseToDpc(ptr)
@ stub KeAddSystemServiceTable
@ stub KeAreApcsDisabled
@ stub KeAttachProcess

View File

@ -384,6 +384,15 @@ void WINAPI KeInitializeSpinLock( KSPIN_LOCK *lock )
}
#ifndef __i386__
static inline void small_pause(void)
{
#ifdef __x86_64__
__asm__ __volatile__( "rep;nop" : : : "memory" );
#else
__asm__ __volatile__( "" : : : "memory" );
#endif
}
/***********************************************************************
* KeReleaseSpinLock (NTOSKRNL.EXE.@)
*/
@ -392,4 +401,15 @@ void WINAPI KeReleaseSpinLock( KSPIN_LOCK *lock, KIRQL irql )
TRACE("lock %p, irql %u.\n", lock, irql);
InterlockedExchangePointer( (void **)lock, 0 );
}
/***********************************************************************
* KeAcquireSpinLockRaiseToDpc (NTOSKRNL.EXE.@)
*/
KIRQL WINAPI KeAcquireSpinLockRaiseToDpc( KSPIN_LOCK *lock )
{
TRACE("lock %p.\n", lock);
while (!InterlockedCompareExchangePointer( (void **)lock, (void *)1, (void *)0 ))
small_pause();
return 0;
}
#endif

View File

@ -1421,6 +1421,9 @@ NTSTATUS WINAPI IoWMIRegistrationControl(PDEVICE_OBJECT,ULONG);
#ifdef __i386__
void WINAPI KeAcquireSpinLock(KSPIN_LOCK*,KIRQL*);
#else
#define KeAcquireSpinLock( lock, irql ) *(irql) = KeAcquireSpinLockRaiseToDpc( lock )
KIRQL WINAPI KeAcquireSpinLockRaiseToDpc(KSPIN_LOCK*);
#endif
BOOLEAN WINAPI KeCancelTimer(KTIMER*);
void WINAPI KeClearEvent(PRKEVENT);