// `export var` / `extern var`: the cross-object symbol pattern — one module // owns the storage (`export var` defines the symbol), every other object // consumes it as a bodyless, valueless `extern var` with an explicit type. // Linker-script symbols arrive the same way (`extern var _sym u8`) — the // address is the value. The definition side here mirrors a scheduler's task // table; the extern side is the linker-symbol idiom. // // Lives in examples/register/ (post-v0.5 grammar — the frozen stage0 // bootstrap compiler cannot parse it; gated by `zig build fixpoint`). pub const TaskStruct = struct { pid i32 = 0, } pub const NR_TASKS usize = 64 // Definition side (one module owns the storage): export var current ?*mut TaskStruct = null export var task [NR_TASKS]?*mut TaskStruct = [_]?*mut TaskStruct{null} ** NR_TASKS export var nr_tasks i32 = 0 export var next_pid i32 = 1 // Consumer side, linker-symbol idiom (typed, no initializer — the address // is the value): extern var _kernel_pa_end u8 extern var __initramfs_start u8