fix(acpi): ensure proper GAS for timer

This commit is contained in:
Loïc Grégoire
2026-04-15 20:40:57 -04:00
parent d600b89024
commit 8ea47b72f8
2 changed files with 12 additions and 8 deletions
+8 -8
View File
@@ -337,21 +337,21 @@ pub fn init(boot_info: *pl.BootInfo) linksection(b.init) void {
enumerate_tables();
const fadt = find_table(fadt_signature);
if (fadt) |f| {
const fadt_struct: *Fadt = @ptrCast(f);
timer.init(fadt_struct);
}
// Try getting the HPET first so we don't initialize
// the legacy timer if we have a better option.
const hpet_t = find_table(hpet_signature);
if (hpet_t) |h| {
const hpet_struct: *HpetTable = @ptrCast(h);
hpet.init(hpet_struct);
}
const madt_t = find_table(madt_signature);
const fadt = find_table(fadt_signature);
if (fadt) |f| {
const fadt_struct: *Fadt = @ptrCast(f);
timer.init(fadt_struct);
}
const madt_t = find_table(madt_signature);
if (madt_t) |m| {
madt.madt_ptr = @ptrCast(m);
}
+4
View File
@@ -37,6 +37,10 @@ pub fn init(fadt: *acpi.Fadt) linksection(b.init) void {
timer_gas = fadt.x_pm_tmr_blk;
}
if (timer_gas.access_size == 0) {
timer_gas.access_size = 3;
}
// Indicates whether the timer is 32-bit
if (fadt.flags & (1 << 8) != 0) {
pm_timer.mask = std.math.maxInt(u32);