rt/
lib.rs

1#![cfg_attr(target_os = "none", no_std)]
2
3pub mod cycle;
4pub mod stack;
5pub mod sync;
6pub mod task;
7pub mod tick;
8pub mod timer;
9
10#[doc(hidden)]
11pub mod cell;
12
13#[doc(hidden)]
14pub mod ctor;
15
16#[cfg(mpu)]
17pub mod mpu;
18
19#[cfg(any(mpu_armv6m, mpu_armv7m, mpu_armv7r, mpu_riscv))]
20mod align;
21
22mod bindings;
23mod list;
24
25#[inline]
26pub fn trap() -> ! {
27    unsafe { bindings::rt_trap() }
28}
29
30#[inline]
31pub fn exit() -> ! {
32    unsafe { bindings::rt_exit() }
33}
34
35/* The paste macro must be re-exported so rt's macros can use it without
36 * other crates directly using paste. */
37#[doc(hidden)]
38pub use paste;
39
40#[cfg(test)]
41fn test_init() {
42    use std::sync::Once;
43
44    static TEST_INIT: Once = Once::new();
45    TEST_INIT.call_once(|| unsafe {
46        bindings::rt_start_sched();
47    });
48}
49
50#[cfg(target_os = "none")]
51mod panic;