enumerate usable CPU cores from the MADT

Keep each Local APIC's id and expose platform.cpus().
This commit is contained in:
Daniel Samson
2026-07-08 12:35:30 +01:00
parent 26d2f5259c
commit cf7c6df41c
4 changed files with 66 additions and 1 deletions
+4
View File
@@ -200,6 +200,10 @@ fn kmain(boot_info: *const BootInfo) noreturn {
log.write(" console UART: none in SPCR -> legacy COM1\n");
}
log.print(" ioapic : base 0x{x}, {d} inputs (masked); entry0 low 0x{x}\n", .{ ioapic_base, arch.ioapicEntryCount(), arch.ioapicEntryLow(0) });
const cores = platform.cpus();
log.print(" cpus : {d} usable core(s); 1 running (BSP), {d} AP(s) parked (SMP bring-up pending)\n", .{ cores.len, if (cores.len > 0) cores.len - 1 else 0 });
if (platform.cpusDropped() > 0)
log.print(" cpus : WARNING {d} core(s) beyond pool cap dropped\n", .{platform.cpusDropped()});
} else |err| {
log.print("\ndanos: device discovery failed: {s}\n", .{@errorName(err)});
}