about summary refs log tree commit diff stats
path: root/src/tools
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-10-11 16:04:33 +0200
committerptitSeb <sebastien.chev@gmail.com>2023-10-11 16:04:33 +0200
commit2a3923a173b54ca5aac3002230930863e6ccdbe0 (patch)
tree4f97b5eeb1cfa79c4a12988dbf67b2d94d16d128 /src/tools
parent3e882f3fd9c58a4a864b5a42b38db9288347e231 (diff)
downloadbox64-2a3923a173b54ca5aac3002230930863e6ccdbe0.tar.gz
box64-2a3923a173b54ca5aac3002230930863e6ccdbe0.zip
A bit more changes to cpuid bits and cpu identifications
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/my_cpuid.c12
1 files changed, 6 insertions, 6 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