Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/hal/hal.c | 81 ++++++++++++++++++----------------------------- dlls/hal/hal.spec | 30 +++++++++--------- 2 files changed, 45 insertions(+), 66 deletions(-)
diff --git a/dlls/hal/hal.c b/dlls/hal/hal.c index 51bf55d58a..5560d9b742 100644 --- a/dlls/hal/hal.c +++ b/dlls/hal/hal.c @@ -47,53 +47,42 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntoskrnl); "pushl %ecx\n\t" \ "pushl %eax\n\t" \ "jmp " __ASM_NAME("__regs_") #name __ASM_STDCALL(8)) -#endif -
-#ifdef DEFINE_FASTCALL1_ENTRYPOINT DEFINE_FASTCALL1_ENTRYPOINT( ExAcquireFastMutex ) VOID WINAPI DECLSPEC_HIDDEN __regs_ExAcquireFastMutex(PFAST_MUTEX FastMutex) -#else -VOID WINAPI ExAcquireFastMutex(PFAST_MUTEX FastMutex) -#endif { FIXME("%p: stub\n", FastMutex); }
-#ifdef DEFINE_FASTCALL1_ENTRYPOINT DEFINE_FASTCALL1_ENTRYPOINT( ExReleaseFastMutex ) VOID WINAPI DECLSPEC_HIDDEN __regs_ExReleaseFastMutex(PFAST_MUTEX FastMutex) -#else -VOID WINAPI ExReleaseFastMutex(PFAST_MUTEX FastMutex) -#endif { FIXME("%p: stub\n", FastMutex); }
-#ifdef DEFINE_FASTCALL1_ENTRYPOINT DEFINE_FASTCALL1_ENTRYPOINT( ExTryToAcquireFastMutex ) BOOLEAN WINAPI DECLSPEC_HIDDEN __regs_ExTryToAcquireFastMutex(PFAST_MUTEX FastMutex) -#else -BOOLEAN WINAPI ExTryToAcquireFastMutex(PFAST_MUTEX FastMutex) -#endif { FIXME("(%p) stub\n", FastMutex); return TRUE; }
-#ifdef DEFINE_FASTCALL1_ENTRYPOINT DEFINE_FASTCALL1_ENTRYPOINT( KfAcquireSpinLock ) KIRQL WINAPI DECLSPEC_HIDDEN __regs_KfAcquireSpinLock(PKSPIN_LOCK SpinLock) -#else -KIRQL WINAPI KfAcquireSpinLock(PKSPIN_LOCK SpinLock) -#endif { FIXME( "(%p) stub!\n", SpinLock );
return 0; }
+DEFINE_FASTCALL2_ENTRYPOINT( KfReleaseSpinLock ) +VOID WINAPI DECLSPEC_HIDDEN __regs_KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql) +{ + FIXME( "(%p %u) stub!\n", SpinLock, NewIrql ); +} +#endif /* __i386__ */
+#if defined(__i386__) || defined(__arm__) || defined(__aarch64__) #ifdef DEFINE_FASTCALL1_ENTRYPOINT DEFINE_FASTCALL1_ENTRYPOINT( KfLowerIrql ) VOID WINAPI DECLSPEC_HIDDEN __regs_KfLowerIrql(KIRQL NewIrql) @@ -117,39 +106,6 @@ KIRQL WINAPI KfRaiseIrql(KIRQL NewIrql) return 0; }
- -#ifdef DEFINE_FASTCALL2_ENTRYPOINT -DEFINE_FASTCALL2_ENTRYPOINT( KfReleaseSpinLock ) -VOID WINAPI DECLSPEC_HIDDEN __regs_KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql) -#else -VOID WINAPI KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql) -#endif -{ - FIXME( "(%p %u) stub!\n", SpinLock, NewIrql ); -} - -ULONG WINAPI HalGetBusData(BUS_DATA_TYPE BusDataType, ULONG BusNumber, ULONG SlotNumber, PVOID Buffer, ULONG Length) -{ - FIXME("(%u %u %u %p %u) stub!\n", BusDataType, BusNumber, SlotNumber, Buffer, Length); - /* Claim that there is no such bus */ - return 0; -} - -ULONG WINAPI HalGetBusDataByOffset(BUS_DATA_TYPE BusDataType, ULONG BusNumber, ULONG SlotNumber, PVOID Buffer, ULONG Offset, ULONG Length) -{ - FIXME("(%u %u %u %p %u %u) stub!\n", BusDataType, BusNumber, SlotNumber, Buffer, Offset, Length); - /* Claim that there is no such bus */ - return 0; -} - -BOOLEAN WINAPI HalTranslateBusAddress(INTERFACE_TYPE InterfaceType, ULONG BusNumber, PHYSICAL_ADDRESS BusAddress, - PULONG AddressSpace, PPHYSICAL_ADDRESS TranslatedAddress) -{ - FIXME("(%d %d %s %p %p) stub!\n", InterfaceType, BusNumber, - wine_dbgstr_longlong(BusAddress.QuadPart), AddressSpace, TranslatedAddress); - return FALSE; -} - KIRQL WINAPI KeGetCurrentIrql(VOID) { FIXME( " stub!\n"); @@ -177,6 +133,29 @@ void WINAPI WRITE_PORT_ULONG(ULONG *port, ULONG value) { FIXME("(%p %d) stub!\n", port, value); } +#endif /* __i386__ || __arm__ || __arm64__ */ + +ULONG WINAPI HalGetBusData(BUS_DATA_TYPE BusDataType, ULONG BusNumber, ULONG SlotNumber, PVOID Buffer, ULONG Length) +{ + FIXME("(%u %u %u %p %u) stub!\n", BusDataType, BusNumber, SlotNumber, Buffer, Length); + /* Claim that there is no such bus */ + return 0; +} + +ULONG WINAPI HalGetBusDataByOffset(BUS_DATA_TYPE BusDataType, ULONG BusNumber, ULONG SlotNumber, PVOID Buffer, ULONG Offset, ULONG Length) +{ + FIXME("(%u %u %u %p %u %u) stub!\n", BusDataType, BusNumber, SlotNumber, Buffer, Offset, Length); + /* Claim that there is no such bus */ + return 0; +} + +BOOLEAN WINAPI HalTranslateBusAddress(INTERFACE_TYPE InterfaceType, ULONG BusNumber, PHYSICAL_ADDRESS BusAddress, + PULONG AddressSpace, PPHYSICAL_ADDRESS TranslatedAddress) +{ + FIXME("(%d %d %s %p %p) stub!\n", InterfaceType, BusNumber, + wine_dbgstr_longlong(BusAddress.QuadPart), AddressSpace, TranslatedAddress); + return FALSE; +}
ULONGLONG WINAPI KeQueryPerformanceCounter(LARGE_INTEGER *frequency) { diff --git a/dlls/hal/hal.spec b/dlls/hal/hal.spec index 5dc3fa8f8f..171d9defee 100644 --- a/dlls/hal/hal.spec +++ b/dlls/hal/hal.spec @@ -1,22 +1,22 @@ -@ stdcall -norelay ExAcquireFastMutex(ptr) -@ stdcall -norelay ExReleaseFastMutex(ptr) -@ stdcall -norelay ExTryToAcquireFastMutex(ptr) +@ stdcall -arch=i386 -norelay ExAcquireFastMutex(ptr) +@ stdcall -arch=i386 -norelay ExReleaseFastMutex(ptr) +@ stdcall -arch=i386 -norelay ExTryToAcquireFastMutex(ptr) @ stub HalClearSoftwareInterrupt @ stub HalRequestSoftwareInterrupt @ stub HalSystemVectorDispatchEntry -@ stdcall -norelay KeAcquireInStackQueuedSpinLock(ptr ptr) ntoskrnl.exe.KeAcquireInStackQueuedSpinLock +@ stdcall -arch=i386 -norelay KeAcquireInStackQueuedSpinLock(ptr ptr) ntoskrnl.exe.KeAcquireInStackQueuedSpinLock @ stub KeAcquireInStackQueuedSpinLockRaiseToSynch @ stub KeAcquireQueuedSpinLock @ stub KeAcquireQueuedSpinLockRaiseToSynch @ stub KeAcquireSpinLockRaiseToSynch -@ stdcall -norelay KeReleaseInStackQueuedSpinLock(ptr) ntoskrnl.exe.KeReleaseInStackQueuedSpinLock +@ stdcall -arch=i386 -norelay KeReleaseInStackQueuedSpinLock(ptr) ntoskrnl.exe.KeReleaseInStackQueuedSpinLock @ stub KeReleaseQueuedSpinLock @ stub KeTryToAcquireQueuedSpinLock @ stub KeTryToAcquireQueuedSpinLockRaiseToSynch -@ stdcall -norelay KfAcquireSpinLock(ptr) -@ stdcall -norelay KfLowerIrql(long) -@ stdcall -norelay KfRaiseIrql(long) -@ stdcall -norelay KfReleaseSpinLock(ptr long) +@ stdcall -arch=i386 -norelay KfAcquireSpinLock(ptr) +@ stdcall -arch=arm,arm64,i386 -norelay KfLowerIrql(long) +@ stdcall -arch=arm,arm64,i386 -norelay KfRaiseIrql(long) +@ stdcall -arch=i386 -norelay KfReleaseSpinLock(ptr long) @ stub HalAcquireDisplayOwnership @ stub HalAdjustResourceList @ stub HalAllProcessorsStarted @@ -70,23 +70,23 @@ @ stub KdComPortInUse @ stub KeAcquireSpinLock @ stub KeFlushWriteBuffer -@ stdcall KeGetCurrentIrql() +@ stdcall -arch=arm,arm64,i386 KeGetCurrentIrql() @ stub KeLowerIrql @ stdcall -ret64 KeQueryPerformanceCounter(ptr) @ stub KeRaiseIrql @ stub KeRaiseIrqlToDpcLevel @ stub KeRaiseIrqlToSynchLevel -@ stdcall KeReleaseSpinLock(ptr long) ntoskrnl.exe.KeReleaseSpinLock +@ stdcall -arch=i386 KeReleaseSpinLock(ptr long) ntoskrnl.exe.KeReleaseSpinLock @ stub KeStallExecutionProcessor @ stub READ_PORT_BUFFER_UCHAR @ stub READ_PORT_BUFFER_ULONG @ stub READ_PORT_BUFFER_USHORT -@ stdcall READ_PORT_UCHAR(ptr) -@ stdcall READ_PORT_ULONG(ptr) +@ stdcall -arch=arm,arm64,i386 READ_PORT_UCHAR(ptr) +@ stdcall -arch=arm,arm64,i386 READ_PORT_ULONG(ptr) @ stub READ_PORT_USHORT @ stub WRITE_PORT_BUFFER_UCHAR @ stub WRITE_PORT_BUFFER_ULONG @ stub WRITE_PORT_BUFFER_USHORT -@ stdcall WRITE_PORT_UCHAR(ptr long) -@ stdcall WRITE_PORT_ULONG(ptr long) +@ stdcall -arch=arm,arm64,i386 WRITE_PORT_UCHAR(ptr long) +@ stdcall -arch=arm,arm64,i386 WRITE_PORT_ULONG(ptr long) @ stub WRITE_PORT_USHORT
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntoskrnl.exe/ntoskrnl.c | 8 -------- dlls/ntoskrnl.exe/sync.c | 9 +++++++++ include/ddk/wdm.h | 1 + 3 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 869935ec26..a76d0413f8 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -2280,14 +2280,6 @@ PRKTHREAD WINAPI KeGetCurrentThread(void) return NULL; }
-/*********************************************************************** - * KeInitializeSpinLock (NTOSKRNL.EXE.@) - */ -void WINAPI KeInitializeSpinLock( PKSPIN_LOCK SpinLock ) -{ - FIXME( "stub: %p\n", SpinLock ); -} - /*********************************************************************** * KeInsertQueue (NTOSKRNL.EXE.@) */ diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c index da51ca0237..bd58f33258 100644 --- a/dlls/ntoskrnl.exe/sync.c +++ b/dlls/ntoskrnl.exe/sync.c @@ -373,3 +373,12 @@ NTSTATUS WINAPI KeDelayExecutionThread( KPROCESSOR_MODE mode, BOOLEAN alertable, TRACE("mode %d, alertable %u, timeout %p.\n", mode, alertable, timeout); return NtDelayExecution( alertable, timeout ); } + +/*********************************************************************** + * KeInitializeSpinLock (NTOSKRNL.EXE.@) + */ +void WINAPI KeInitializeSpinLock( KSPIN_LOCK *lock ) +{ + TRACE("lock %p.\n", lock); + *lock = 0; +} diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index 80eeee3c49..04dbf6d359 100644 --- a/include/ddk/wdm.h +++ b/include/ddk/wdm.h @@ -1453,6 +1453,7 @@ PKTHREAD WINAPI KeGetCurrentThread(void); void WINAPI KeInitializeEvent(PRKEVENT,EVENT_TYPE,BOOLEAN); void WINAPI KeInitializeMutex(PRKMUTEX,ULONG); void WINAPI KeInitializeSemaphore(PRKSEMAPHORE,LONG,LONG); +void WINAPI KeInitializeSpinLock(KSPIN_LOCK*); void WINAPI KeInitializeTimerEx(PKTIMER,TIMER_TYPE); void WINAPI KeInitializeTimer(KTIMER*); void WINAPI KeQuerySystemTime(LARGE_INTEGER*);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/hal/hal.c | 11 +++++++++-- dlls/hal/hal.spec | 2 +- include/ddk/wdm.h | 1 + 3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/dlls/hal/hal.c b/dlls/hal/hal.c index 5560d9b742..924fd9e6d9 100644 --- a/dlls/hal/hal.c +++ b/dlls/hal/hal.c @@ -26,6 +26,7 @@ #include "ntstatus.h" #define WIN32_NO_STATUS #include "windef.h" +#include "winbase.h" #include "winternl.h" #include "excpt.h" #include "ddk/ntddk.h" @@ -76,9 +77,15 @@ KIRQL WINAPI DECLSPEC_HIDDEN __regs_KfAcquireSpinLock(PKSPIN_LOCK SpinLock) }
DEFINE_FASTCALL2_ENTRYPOINT( KfReleaseSpinLock ) -VOID WINAPI DECLSPEC_HIDDEN __regs_KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL NewIrql) +void WINAPI DECLSPEC_HIDDEN __regs_KfReleaseSpinLock( KSPIN_LOCK *lock, KIRQL irql ) { - FIXME( "(%p %u) stub!\n", SpinLock, NewIrql ); + KeReleaseSpinLock( lock, irql ); +} + +void WINAPI KeReleaseSpinLock( KSPIN_LOCK *lock, KIRQL irql ) +{ + TRACE("lock %p, irql %u.\n", lock, irql); + InterlockedExchangePointer( (void **)lock, 0 ); } #endif /* __i386__ */
diff --git a/dlls/hal/hal.spec b/dlls/hal/hal.spec index 171d9defee..9b74701401 100644 --- a/dlls/hal/hal.spec +++ b/dlls/hal/hal.spec @@ -76,7 +76,7 @@ @ stub KeRaiseIrql @ stub KeRaiseIrqlToDpcLevel @ stub KeRaiseIrqlToSynchLevel -@ stdcall -arch=i386 KeReleaseSpinLock(ptr long) ntoskrnl.exe.KeReleaseSpinLock +@ stdcall -arch=i386 KeReleaseSpinLock(ptr long) @ stub KeStallExecutionProcessor @ stub READ_PORT_BUFFER_UCHAR @ stub READ_PORT_BUFFER_ULONG diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index 04dbf6d359..6193c023ea 100644 --- a/include/ddk/wdm.h +++ b/include/ddk/wdm.h @@ -1462,6 +1462,7 @@ ULONG WINAPI KeQueryTimeIncrement(void); BOOLEAN WINAPI KeRegisterBugCheckReasonCallback(KBUGCHECK_REASON_CALLBACK_RECORD*,KBUGCHECK_REASON_CALLBACK_ROUTINE*,KBUGCHECK_CALLBACK_REASON,UCHAR*); LONG WINAPI KeReleaseMutex(PRKMUTEX,BOOLEAN); LONG WINAPI KeReleaseSemaphore(PRKSEMAPHORE,KPRIORITY,LONG,BOOLEAN); +void WINAPI KeReleaseSpinLock(KSPIN_LOCK*,KIRQL); LONG WINAPI KeResetEvent(PRKEVENT); LONG WINAPI KeSetEvent(PRKEVENT,KPRIORITY,BOOLEAN); KPRIORITY WINAPI KeSetPriorityThread(PKTHREAD,KPRIORITY);
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=46546
Your paranoid android.
=== debian9 (build log) ===
error: patch failed: include/ddk/wdm.h:1462 Task: Patch failed to apply
=== debian9 (build log) ===
error: patch failed: include/ddk/wdm.h:1462 Task: Patch failed to apply
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntoskrnl.exe/ntoskrnl.c | 8 -------- dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- dlls/ntoskrnl.exe/sync.c | 11 +++++++++++ 3 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index a76d0413f8..26668408a6 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -3868,14 +3868,6 @@ KIRQL WINAPI KeAcquireSpinLockRaiseToDpc(KSPIN_LOCK *spinlock) return 0; }
-/*********************************************************************** - * KeReleaseSpinLock (NTOSKRNL.EXE.@) - */ -void WINAPI KeReleaseSpinLock( KSPIN_LOCK *spinlock, KIRQL irql ) -{ - FIXME( "stub: %p %u\n", spinlock, irql ); -} - /*********************************************************************** * IoCreateNotificationEvent (NTOSKRNL.EXE.@) */ diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index 992679c70d..c4a4213287 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -593,7 +593,7 @@ @ stub KeReleaseMutant @ stdcall KeReleaseMutex(ptr long) @ stdcall KeReleaseSemaphore(ptr long long long) -@ stdcall KeReleaseSpinLock(ptr long) +@ stdcall -arch=arm,arm64,x86_64 KeReleaseSpinLock(ptr long) @ stub KeReleaseSpinLockFromDpcLevel @ stub KeRemoveByKeyDeviceQueue @ stub KeRemoveByKeyDeviceQueueIfBusy diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c index bd58f33258..832b0480b9 100644 --- a/dlls/ntoskrnl.exe/sync.c +++ b/dlls/ntoskrnl.exe/sync.c @@ -382,3 +382,14 @@ void WINAPI KeInitializeSpinLock( KSPIN_LOCK *lock ) TRACE("lock %p.\n", lock); *lock = 0; } + +#ifndef __i386__ +/*********************************************************************** + * KeReleaseSpinLock (NTOSKRNL.EXE.@) + */ +void WINAPI KeReleaseSpinLock( KSPIN_LOCK *lock, KIRQL irql ) +{ + TRACE("lock %p, irql %u.\n", lock, irql); + InterlockedExchangePointer( (void **)lock, 0 ); +} +#endif
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=46547
Your paranoid android.
=== debian9 (build log) ===
error: patch failed: include/ddk/wdm.h:1462 Task: Patch failed to apply
=== debian9 (build log) ===
error: patch failed: include/ddk/wdm.h:1462 Task: Patch failed to apply
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/hal/hal.c | 19 ++++++++++++++++--- dlls/hal/hal.spec | 2 +- include/ddk/wdm.h | 3 +++ 3 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/dlls/hal/hal.c b/dlls/hal/hal.c index 924fd9e6d9..fca4f23403 100644 --- a/dlls/hal/hal.c +++ b/dlls/hal/hal.c @@ -69,11 +69,24 @@ BOOLEAN WINAPI DECLSPEC_HIDDEN __regs_ExTryToAcquireFastMutex(PFAST_MUTEX FastMu }
DEFINE_FASTCALL1_ENTRYPOINT( KfAcquireSpinLock ) -KIRQL WINAPI DECLSPEC_HIDDEN __regs_KfAcquireSpinLock(PKSPIN_LOCK SpinLock) +KIRQL WINAPI DECLSPEC_HIDDEN __regs_KfAcquireSpinLock( KSPIN_LOCK *lock ) { - FIXME( "(%p) stub!\n", SpinLock ); + KIRQL irql; + KeAcquireSpinLock( lock, &irql ); + return irql; +}
- return 0; +static inline void small_pause(void) +{ + __asm__ __volatile__( "rep;nop" : : : "memory" ); +} + +void WINAPI KeAcquireSpinLock( KSPIN_LOCK *lock, KIRQL *irql ) +{ + TRACE("lock %p, irql %p.\n", lock, irql); + while (!InterlockedCompareExchangePointer( (void **)lock, (void *)1, (void *)0 )) + small_pause(); + *irql = 0; }
DEFINE_FASTCALL2_ENTRYPOINT( KfReleaseSpinLock ) diff --git a/dlls/hal/hal.spec b/dlls/hal/hal.spec index 9b74701401..521697b79b 100644 --- a/dlls/hal/hal.spec +++ b/dlls/hal/hal.spec @@ -68,7 +68,7 @@ @ stub IoSetPartitionInformation @ stub IoWritePartitionTable @ stub KdComPortInUse -@ stub KeAcquireSpinLock +@ stdcall -arch=i386 KeAcquireSpinLock(ptr ptr) @ stub KeFlushWriteBuffer @ stdcall -arch=arm,arm64,i386 KeGetCurrentIrql() @ stub KeLowerIrql diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index 6193c023ea..6b62811a67 100644 --- a/include/ddk/wdm.h +++ b/include/ddk/wdm.h @@ -1446,6 +1446,9 @@ void WINAPI IoReleaseCancelSpinLock(KIRQL); NTSTATUS WINAPI IoSetDeviceInterfaceState(UNICODE_STRING*,BOOLEAN); NTSTATUS WINAPI IoWMIRegistrationControl(PDEVICE_OBJECT,ULONG);
+#ifdef __i386__ +void WINAPI KeAcquireSpinLock(KSPIN_LOCK*,KIRQL*); +#endif BOOLEAN WINAPI KeCancelTimer(KTIMER*); void WINAPI KeClearEvent(PRKEVENT); NTSTATUS WINAPI KeDelayExecutionThread(KPROCESSOR_MODE,BOOLEAN,LARGE_INTEGER*);
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=46548
Your paranoid android.
=== debian9 (build log) ===
error: patch failed: include/ddk/wdm.h:1462 Task: Patch failed to apply
=== debian9 (build log) ===
error: patch failed: include/ddk/wdm.h:1462 Task: Patch failed to apply
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntoskrnl.exe/ntoskrnl.c | 9 --------- dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- dlls/ntoskrnl.exe/sync.c | 20 ++++++++++++++++++++ include/ddk/wdm.h | 3 +++ 4 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 26668408a6..e6bb5930bd 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -3859,15 +3859,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.@) */ diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index c4a4213287..3de7c1cac7 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -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 diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c index 832b0480b9..74e84a6505 100644 --- a/dlls/ntoskrnl.exe/sync.c +++ b/dlls/ntoskrnl.exe/sync.c @@ -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 diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index 6b62811a67..258fdb3893 100644 --- a/include/ddk/wdm.h +++ b/include/ddk/wdm.h @@ -1448,6 +1448,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);
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=46549
Your paranoid android.
=== debian9 (build log) ===
error: patch failed: include/ddk/wdm.h:1462 Task: Patch failed to apply
=== debian9 (build log) ===
error: patch failed: include/ddk/wdm.h:1462 Task: Patch failed to apply