osiris/
idle.rs

1use crate::sched;
2
3extern "C" fn entry() {
4    loop {
5        hal::asm::nop!();
6    }
7}
8
9pub fn init() {
10    let attrs = sched::thread::Attributes {
11        entry,
12        fin: None,
13        attrs: None,
14    };
15    sched::with(|sched| {
16        if let Err(e) = sched.create_thread(Some(sched::task::KERNEL_TASK), &attrs) {
17            panic!("failed to create idle thread. Error: {}", e);
18        }
19    });
20}