refactor(amd64): use CPU helpers

This commit is contained in:
Loïc Grégoire
2026-03-29 21:25:47 -04:00
parent 6efee3aec3
commit 84500e2ff3
3 changed files with 21 additions and 9 deletions
+8
View File
@@ -127,6 +127,14 @@ pub inline fn hlt() void {
asm volatile ("hlt");
}
pub inline fn rflags() u64 {
var flags: u64 = undefined;
asm volatile ("pushfq; pop %[flags]"
: [flags] "=r" (flags),
);
return flags;
}
pub inline fn rdtsc() u64 {
var low: u32 = undefined;
var high: u32 = undefined;