gather kernel tunables into config.zig
max_cpus, max_tasks, kernel/IST stack sizes, and timer_hz move from scattered constants into one config module. root.zig goes back to being just the boot contract. Values unchanged; any can become a -D build option later.
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
//! shared queues.
|
||||
|
||||
const std = @import("std");
|
||||
const danos = @import("danos");
|
||||
const config = @import("config");
|
||||
const arch = @import("arch");
|
||||
const heap = @import("heap.zig");
|
||||
const sync = @import("sync.zig");
|
||||
@@ -27,8 +27,8 @@ const sync = @import("sync.zig");
|
||||
pub const Priority = u3;
|
||||
const num_priorities = 8;
|
||||
|
||||
const stack_size = 16 * 1024; // each task's kernel stack is 16 KiB
|
||||
const max_tasks = 16; // the maximum number of tasks alive at once is 16 in a static sized pool
|
||||
const stack_size = config.kernel_stack_size; // each task's kernel stack
|
||||
const max_tasks = config.max_tasks; // maximum tasks alive at once (static pool)
|
||||
|
||||
const State = enum { free, ready, running, blocked };
|
||||
|
||||
@@ -69,7 +69,7 @@ pub const PerCpu = struct {
|
||||
pinned_bitmap: u8 = 0,
|
||||
};
|
||||
|
||||
const max_cpus = danos.max_cpus;
|
||||
const max_cpus = config.max_cpus;
|
||||
var cpus = [_]PerCpu{.{}} ** max_cpus;
|
||||
|
||||
/// This core's per-CPU state, via the arch layer's GS-base pointer. Valid only once
|
||||
|
||||
Reference in New Issue
Block a user