about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2022-02-20 23:31:46 +0100
committerptitSeb <sebastien.chev@gmail.com>2022-02-20 23:31:46 +0100
commitfc3b931911e792271b4b5ed4f7cbc5a89d16a038 (patch)
treea6a7077334dbd457a2be61b7d00c1dc864ef60d1 /src
parenta67606db8f4669e91e147a4e6bcd597d28a36afa (diff)
downloadbox64-fc3b931911e792271b4b5ed4f7cbc5a89d16a038.tar.gz
box64-fc3b931911e792271b4b5ed4f7cbc5a89d16a038.zip
Use sched_getcpu instead of deprecated getcpu (for #239)
Diffstat (limited to 'src')
-rw-r--r--src/tools/my_cpuid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/my_cpuid.c b/src/tools/my_cpuid.c
index dc19dd5c..b7163861 100644
--- a/src/tools/my_cpuid.c
+++ b/src/tools/my_cpuid.c
@@ -45,8 +45,8 @@ void my_cpuid(x64emu_t* emu, uint32_t tmp32u)
             R_EAX = 0x00000601; // family and all
             R_EBX = 0 | (8<<0x8) | (ncpu<<16);          // Brand index, CLFlush (8), Max APIC ID (16-23), Local APIC ID (24-31)
             {
-                unsigned int cpu =0, node=0;
-                getcpu(&cpu, &node);
+                int cpu = sched_getcpu();
+                if(cpu<0) cpu=0;
                 R_EAX |= cpu<<24;
             }
             R_EDX =   1         // fpu