mirror of
https://github.com/rdmsr/zag.git
synced 2026-10-27 13:58:20 +00:00
fix(acpi): ensure proper GAS for timer
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user