From 1e2e154747efdbef68dc343ba02623ba2d78a3a9 Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Sun, 30 Apr 2023 15:05:23 -0600 Subject: [PATCH] [libcpu] Fix CPUID register overwriting bug Well god damnit, when i converted the `cpu::cpu_id::regs` struct to a union, i was super sloppy and forgot to wrap the existing fields in their own anonymous struct. I have been wrong about CPUID vales for ages. --- src/libraries/cpu/cpu/cpu_id.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libraries/cpu/cpu/cpu_id.h b/src/libraries/cpu/cpu/cpu_id.h index 00deeeb..5cfd71c 100644 --- a/src/libraries/cpu/cpu/cpu_id.h +++ b/src/libraries/cpu/cpu/cpu_id.h @@ -27,7 +27,9 @@ public: struct regs { union { uint32_t reg[4]; - uint32_t eax, ebx, ecx, edx; + struct { + uint32_t eax, ebx, ecx, edx; + }; }; /// Return true if bit |bit| of EAX is set