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 task;
73 mod api;
74 #[cfg(feature = "lockdep")]
75 mod lockdep;
76 #[cfg(feature = "tracepoint-hooks")]
77 mod sched_tracepoint;
78 #[cfg(feature = "irq")]
79 mod irq_notify;
80 mod wait_queue;
81
82 #[cfg(feature = "irq")]
83 mod timers;
84
85 #[cfg(feature = "multitask")]
86 pub mod future;
87
88 #[cfg_attr(doc, doc(cfg(feature = "multitask")))]
89 pub use self::api::*;
90 #[cfg(feature = "irq")]
91 pub use self::irq_notify::IrqNotify;
92 pub use self::api::{sleep, sleep_until, yield_now};
93 #[cfg(feature = "tracepoint-hooks")]
94 pub use self::sched_tracepoint::SchedTracepoint;
95 } else {
96 mod api_s;
97 pub use self::api_s::{sleep, sleep_until, yield_now};
98 }
99}
100
101#[cfg(axtest)]
102pub mod axtest;