diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2023-10-11 16:04:33 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2023-10-11 16:04:33 +0200 |
| commit | 2a3923a173b54ca5aac3002230930863e6ccdbe0 (patch) | |
| tree | 4f97b5eeb1cfa79c4a12988dbf67b2d94d16d128 /src | |
| parent | 3e882f3fd9c58a4a864b5a42b38db9288347e231 (diff) | |
| download | box64-2a3923a173b54ca5aac3002230930863e6ccdbe0.tar.gz box64-2a3923a173b54ca5aac3002230930863e6ccdbe0.zip | |
A bit more changes to cpuid bits and cpu identifications
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/my_cpuid.c | 12 | ||||
| -rw-r--r-- | src/wrapped/wrappedlibc.c | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/tools/my_cpuid.c b/src/tools/my_cpuid.c index 5106a543..9bf8cd82 100644 --- a/src/tools/my_cpuid.c +++ b/src/tools/my_cpuid.c @@ -150,13 +150,13 @@ const char* getBoxCpuName() const char* name = getCpuName(); if(strstr(name, "MHz") || strstr(name, "GHz")) { // name already have the speed in it - snprintf(branding, 3*4*4, "Box64 on %s", name); + snprintf(branding, sizeof(branding), "Box64 on %.*s", 39, name); } else { - int MHz = get_cpuMhz(); - if(MHz>15000) { // swiches to GHz display... - snprintf(branding, 3*4*4, "Box64 on %s @%1.2f GHz", name, MHz/1000.); + unsigned int MHz = get_cpuMhz(); + if(MHz>1500) { // swiches to GHz display... + snprintf(branding, sizeof(branding), "Box64 on %.*s @%1.2f GHz", 28, name, MHz/1000.); } else { - snprintf(branding, 3*4*4, "Box64 on %s @%04d MHz", name, MHz); + snprintf(branding, sizeof(branding), "Box64 on %.*s @%04d MHz", 28, name, MHz); } } while(strlen(branding)<3*4*4) { @@ -298,7 +298,7 @@ void my_cpuid(x64emu_t* emu, uint32_t tmp32u) case 0x80000001: //Extended Processor Signature and Feature Bits R_EAX = 0; // reserved R_EBX = 0; // reserved - R_ECX = (1<<5) | (1<<8); // LZCNT | PREFETCHW + R_ECX = (1<<0) | (1<<5) | (1<<8); // LAHF_LM | LZCNT | PREFETCHW R_EDX = 1 // x87 FPU | (1<<8) // cx8: cmpxchg8b opcode | (1<<11) // syscall diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index cda4e97f..625ec087 100644 --- a/src/wrapped/wrappedlibc.c +++ b/src/wrapped/wrappedlibc.c @@ -1561,9 +1561,9 @@ void CreateCPUInfoFile(int fd) P; sprintf(buff, "bogomips\t: %g\n", getBogoMips()); P; - sprintf(buff, "flags\t\t: fpu cx8 sep cmov clflush mmx sse sse2 syscall tsc lahf_lm ssse3 ht tm lm fma fxsr cpuid pclmulqdq cx16 aes movbe pni sse4_1 popcnt\n"); + sprintf(buff, "flags\t\t: fpu cx8 sep cmov clflush mmx sse sse2 syscall tsc lahf_lm ssse3 ht tm lm fma fxsr cpuid pclmulqdq cx16 aes movbe pni sse4_1 lzcnt popcnt\n"); P; - sprintf(buff, "address sizes\t: 46 bits physical, 48 bits virtual\n"); + sprintf(buff, "address sizes\t: 48 bits physical, 48 bits virtual\n"); P; sprintf(buff, "\n"); P; |