userspace/
lib.rs

1#![doc = include_str!("../README.md")]
2#![no_std]
3
4/// Common between the Kernel and Userspace
5pub use common;
6
7/// The user must provide a `no_mangle` entrypoint.
8extern "Rust" {
9    fn entry() -> !;
10}
11
12#[link_section = ".anachro_table.entry_point"]
13#[no_mangle]
14#[used]
15#[doc(hidden)]
16pub static __ENTRY_POINT: unsafe fn() -> ! = entry;
17
18use core::panic::PanicInfo;
19use core::sync::atomic::{self, Ordering};
20
21// Provide a basic panic handler. In the future, this will probably
22// change to one or both of:
23//
24// * Being behind a feature, so you can provide your own panic handler
25// * Attempt to print the panic to the stdout (e.g. serial port 0),
26//     then triggering a "halt" or "reboot" system call.
27#[panic_handler]
28fn panic(_info: &PanicInfo) -> ! {
29    loop {
30        atomic::compiler_fence(Ordering::SeqCst);
31    }
32}