danos/library/kernel/runtime.zig

52 lines
2.2 KiB
Zig
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//! runtime.zig — a **compatibility shim** for the runtime split (reorg C1C5).
//!
//! `library/runtime` became `library/kernel`, and the one giant `runtime` module is being
//! split into directly-importable concern modules (`ipc`, `memory`, `process`, `time`,
//! `logging`, `file-system`, `service`, `thread`, `start`, plus the device/service clients).
//! This file re-exports those modules under the old `runtime.*` names so the ~38 consumers
//! keep compiling until each is migrated to direct imports. Deleted in step C5.
pub const system = @import("system"); // the system.zig compatibility shim
pub const ipc = @import("ipc");
pub const memory = @import("memory");
pub const allocator = memory.allocator;
pub const process = @import("process");
pub const service = @import("service");
pub const Thread = @import("thread").Thread;
pub const time = @import("time");
pub const log = @import("logging");
pub const logging = @import("logging");
pub const fs = @import("file-system");
pub const start = @import("start");
pub const panic = start.panic;
// Device / service clients (now in library/device/driver, library/device/block, library/client).
pub const device = @import("driver");
pub const device_manager = @import("driver"); // hello() folded into driver
pub const input = @import("input");
pub const block = @import("block");
pub const display = @import("display");
/// The heap as a namespace (`runtime.heap.allocator()`), plus `runtime.allocator`.
pub const heap = struct {
pub const allocator = memory.allocator;
};
/// `runtime.dma.*` mapped onto the flat `memory` API (memory groups heap+dma+shared-memory).
pub const dma = struct {
pub const Region = memory.DmaRegion;
pub const coherent = memory.dma_coherent;
pub const write_combining = memory.dma_write_combining;
pub const below_4g = memory.dma_below_4g;
pub const alloc = memory.dmaAlloc;
pub const free = memory.dmaFree;
};
/// `runtime.shared_memory.*` mapped onto the flat `memory` API.
pub const shared_memory = struct {
pub const Region = memory.SharedRegion;
pub const create = memory.sharedCreate;
pub const map = memory.sharedMap;
pub const physical = memory.sharedPhysical;
};