Skip to main content

starry_kernel/
lib.rs

1//! The core functionality of a monolithic kernel, including loading user
2//! programs and managing processes.
3
4#![no_std]
5#![feature(likely_unlikely)]
6#![feature(c_variadic)]
7#![allow(missing_docs)]
8#![allow(clippy::not_unsafe_ptr_arg_deref)]
9
10extern crate alloc;
11extern crate ax_runtime;
12
13#[macro_use]
14extern crate ax_log;
15
16#[macro_use]
17pub mod dyn_debug; // Re-export debug macros for use in other modules. It will override the `debug` macro from `log` crate when `dynamic_debug` feature is enabled.
18
19pub mod entry;
20
21#[cfg(axtest)]
22#[doc(hidden)]
23pub mod axtest_exports;
24#[cfg(all(test, not(axtest)))]
25mod axtest_exports;
26
27#[cfg(test)]
28mod host_link_symbols {
29    // Host unit tests do not execute the bare-metal boot path, but someboot's
30    // linked API refers to linker-script symbols even when those functions are
31    // dead code. Provide inert symbols so the standard test harness can link;
32    // runtime semantics remain covered only by the target axtest binary.
33    #[unsafe(no_mangle)]
34    static STACK_SIZE: usize = 0;
35    #[unsafe(no_mangle)]
36    static PAGE_SIZE: usize = 0;
37    #[unsafe(no_mangle)]
38    static __PERCPU_TEMPLATE_ALIGN_START: usize = 0;
39    #[unsafe(no_mangle)]
40    static __PERCPU_TEMPLATE_ALIGN_END: usize = 0;
41}
42
43mod cgroup;
44mod config;
45mod ebpf;
46mod error;
47mod file;
48mod ipc;
49mod kmod;
50pub mod kprobe;
51mod mm;
52mod namespace;
53mod perf;
54mod pseudofs;
55mod stop_machine;
56mod sync;
57mod syscall;
58mod task;
59mod time;
60mod tracepoint;
61mod trap;
62mod uprobe;
63
64pub use error::{DmaOperation, StarryError, StarryResult};
65pub use syscalls::Errno;