[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.
This commit is contained in:
Justin C. Miller
2023-04-30 15:05:23 -06:00
parent 2d8d4fd200
commit 1e2e154747

View File

@@ -27,8 +27,10 @@ public:
struct regs {
union {
uint32_t reg[4];
struct {
uint32_t eax, ebx, ecx, edx;
};
};
/// Return true if bit |bit| of EAX is set
bool eax_bit(unsigned bit) { return (eax >> bit) & 0x1; }