mirror of
https://github.com/rdmsr/zag.git
synced 2026-10-31 15:28:21 +00:00
feat(pc): add AP startup
This commit is contained in:
@@ -5,6 +5,7 @@ const arch = @import("arch");
|
||||
const std = @import("std");
|
||||
const timer = @import("timer.zig");
|
||||
const hpet = @import("hpet.zig");
|
||||
pub const madt = @import("madt.zig");
|
||||
|
||||
const log = std.log.scoped(.acpi);
|
||||
|
||||
@@ -67,11 +68,25 @@ pub const Xsdt = extern struct {
|
||||
entries: [0]u64,
|
||||
};
|
||||
|
||||
pub const MadtEntryHeader = extern struct {
|
||||
const Type = enum(u8) {
|
||||
LocalApic = 0,
|
||||
IoApic = 1,
|
||||
Iso = 2,
|
||||
NmiSource = 3,
|
||||
LocalApicNmi = 4,
|
||||
X2LocalApic = 9,
|
||||
X2LocalApicNmi = 10,
|
||||
};
|
||||
type: Type align(1),
|
||||
length: u8 align(1),
|
||||
};
|
||||
|
||||
pub const Madt = extern struct {
|
||||
header: SdtHeader,
|
||||
lapic_address: u32 align(1),
|
||||
flags: u32 align(1),
|
||||
entries: [0]u8 align(1),
|
||||
entries: [0]MadtEntryHeader align(1),
|
||||
};
|
||||
|
||||
/// Generic address structure.
|
||||
@@ -334,4 +349,10 @@ pub fn init(boot_info: *pl.BootInfo) linksection(b.init) void {
|
||||
const hpet_struct: *HpetTable = @ptrCast(h);
|
||||
hpet.init(hpet_struct);
|
||||
}
|
||||
|
||||
const madt_t = find_table(madt_signature);
|
||||
|
||||
if (madt_t) |m| {
|
||||
madt.madt_ptr = @ptrCast(m);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user