1#![cfg_attr(any(not(test), target_os = "none"), no_std)]
29#![cfg_attr(all(test, target_os = "none"), no_main)]
30#![cfg_attr(all(test, target_os = "none"), feature(custom_test_frameworks))]
31#![cfg_attr(doc, feature(doc_cfg))]
32#![cfg_attr(
33 all(test, target_os = "none"),
34 test_runner(crate::bare_metal_test_runner)
35)]
36
37#[cfg(all(test, not(target_os = "none"), feature = "multitask"))]
38mod tests;
39
40#[cfg(all(test, target_os = "none"))]
41fn bare_metal_test_runner(_tests: &[&dyn Fn()]) {}
42
43#[cfg(all(test, target_os = "none"))]
44#[unsafe(no_mangle)]
45extern "C" fn _start() -> ! {
46 loop {
47 core::hint::spin_loop();
48 }
49}
50
51#[cfg(all(test, target_os = "none"))]
52#[panic_handler]
53fn panic(_info: &core::panic::PanicInfo<'_>) -> ! {
54 loop {
55 core::hint::spin_loop();
56 }
57}
58
59#[cfg(feature = "multitask")]
60mod build_info {
61 include!(concat!(env!("OUT_DIR"), "/build_info.rs"));
62}
63
64cfg_if::cfg_if! {
65 if #[cfg(feature = "multitask")] {
66 #[macro_use]
67 extern crate log;
68 extern crate alloc;
69
70 #[macro_use]
71 mod run_queue;
72 mod interrupt;
73 mod task;
74 mod api;
75 #[cfg(feature = "lockdep")]
76 mod lockdep;
77 #[cfg(feature = "tracepoint-hooks")]
78 mod sched_tracepoint;
79 #[cfg(feature = "irq")]
80 mod irq_notify;
81 mod wait_queue;
82
83 #[cfg(feature = "irq")]
84 mod timers;
85
86 #[cfg(feature = "multitask")]
87 pub mod future;
88
89 #[cfg_attr(doc, doc(cfg(feature = "multitask")))]
90 pub use self::api::*;
91 #[cfg(feature = "irq")]
92 pub use self::irq_notify::IrqNotify;
93 pub use self::api::{sleep, sleep_until, yield_now};
94 #[cfg(feature = "tracepoint-hooks")]
95 pub use self::sched_tracepoint::SchedTracepoint;
96 #[cfg(all(feature = "smp", feature = "ipi"))]
97 pub use self::run_queue::handle_ipi_reschedule;
98 } else {
99 mod api_s;
100 pub use self::api_s::{sleep, sleep_until, yield_now};
101 }
102}
103
104#[cfg(axtest)]
105pub mod axtest;