mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
[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:
@@ -27,8 +27,10 @@ public:
|
|||||||
struct regs {
|
struct regs {
|
||||||
union {
|
union {
|
||||||
uint32_t reg[4];
|
uint32_t reg[4];
|
||||||
|
struct {
|
||||||
uint32_t eax, ebx, ecx, edx;
|
uint32_t eax, ebx, ecx, edx;
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
/// Return true if bit |bit| of EAX is set
|
/// Return true if bit |bit| of EAX is set
|
||||||
bool eax_bit(unsigned bit) { return (eax >> bit) & 0x1; }
|
bool eax_bit(unsigned bit) { return (eax >> bit) & 0x1; }
|
||||||
|
|||||||
Reference in New Issue
Block a user