allocate AP kernel/IST stacks at bring-up, not statically

Hoist max_cpus into danos (root.zig), raise it to 128, and stop reserving a static [max_cpus][16 KiB] IST array. Only the BSP's IST stack is static (needed before the allocator); each AP's is heap-allocated when it comes online. Shrinks the kernel from ~1.1 MB to ~139 KiB in ReleaseSmall.
This commit is contained in:
Daniel Samson
2026-07-08 16:04:18 +01:00
parent 26ac97df31
commit 1b47de5058
8 changed files with 56 additions and 10 deletions
+2 -1
View File
@@ -18,6 +18,7 @@
//! shared queues.
const std = @import("std");
const danos = @import("danos");
const arch = @import("arch");
const heap = @import("heap.zig");
const sync = @import("sync.zig");
@@ -68,7 +69,7 @@ pub const PerCpu = struct {
pinned_bitmap: u8 = 0,
};
const max_cpus = 64; // matches the discovery pool (src/device/acpi.zig)
const max_cpus = danos.max_cpus;
var cpus = [_]PerCpu{.{}} ** max_cpus;
/// This core's per-CPU state, via the arch layer's GS-base pointer. Valid only once