Commit fee112f9 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

ntoskrnl.exe: Implement KeAcquireSpinLockRaiseToDpc().

parent 389b8fc3
......@@ -3855,15 +3855,6 @@ void WINAPI KeReleaseInStackQueuedSpinLock( KLOCK_QUEUE_HANDLE *handle )
}
/***********************************************************************
* KeAcquireSpinLockRaiseToDpc (NTOSKRNL.EXE.@)
*/
KIRQL WINAPI KeAcquireSpinLockRaiseToDpc(KSPIN_LOCK *spinlock)
{
FIXME( "stub: %p\n", spinlock );
return 0;
}
/***********************************************************************
* IoCreateNotificationEvent (NTOSKRNL.EXE.@)
*/
PKEVENT WINAPI IoCreateNotificationEvent(UNICODE_STRING *name, HANDLE *handle)
......
......@@ -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
......
......@@ -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
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment