Taken and slightly adapted from https://github.com/apple-oss-distributions/xnu/blob/8d741a5de7ff4191bf97d57b... .
The arm and arm64 implementations are not stable across kernel releases (yet). This works as expected under Rosetta 2 as well.
-- v2: ntdll: Implement NtGetCurrentProcessorNumber for macOS on x86_64.
From: Marc-Aurel Zent mzent@codeweavers.com
See _os_cpu_number at xnu/libsyscall/os/tsd.h. The arm and arm64 implementations are not stable across kernel releases (yet). --- dlls/ntdll/unix/thread.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index a7114825118..d0fdc37171a 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -2563,6 +2563,13 @@ ULONG WINAPI NtGetCurrentProcessorNumber(void) #if defined(__linux__) && defined(__NR_getcpu) int res = syscall(__NR_getcpu, &processor, NULL, NULL); if (res != -1) return processor; +#elif defined(__APPLE__) && (defined(__x86_64__) || defined(__i386__)) + struct { + unsigned long p1, p2; + } p; + __asm__ __volatile__("sidt %[p]" : [p] "=&m"(p)); + processor = (ULONG)(p.p1 & 0xfff); + return processor; #endif
if (peb->NumberOfProcessors > 1)
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=150086
Your paranoid android.
=== debian11b (64 bit WoW report) ===
user32: input.c:4305: Test succeeded inside todo block: button_down_hwnd_todo 1: got MSG_TEST_WIN hwnd 00000000009D00DE, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032
This merge request was approved by Brendan Shanks.