rt/rust/src/lib.rs

40 lines
653 B
Rust

#![cfg_attr(not(test), no_std)]
pub mod cycle;
pub mod sync;
pub mod task;
pub mod tick;
mod bindings;
mod list;
use bindings::rt_trap;
pub fn trap() -> ! {
unsafe { rt_trap() }
}
/*
* These items must be re-exported so rt's macros can use them. The task macro
* uses rt_syscall_record to make a task ready.
*/
#[doc(hidden)]
pub use bindings::rt_syscall_record;
#[doc(hidden)]
pub use paste;
#[cfg(test)]
use crate::bindings::rt_start_context;
#[cfg(test)]
use std::sync::Once;
#[cfg(test)]
static TEST_INIT: Once = Once::new();
#[cfg(test)]
fn test_init() {
TEST_INIT.call_once(|| {
unsafe { rt_start_context() };
});
}