|
|
|
@ -10,11 +10,18 @@ type Processor = Processor_<Context, StrideScheduler>;
|
|
|
|
|
|
|
|
|
|
pub fn init() {
|
|
|
|
|
PROCESSOR.call_once(||
|
|
|
|
|
SpinNoIrqLock::new(Processor::new(
|
|
|
|
|
unsafe { Context::new_init() },
|
|
|
|
|
// NOTE: max_time_slice <= 5 to ensure 'priority' test pass
|
|
|
|
|
StrideScheduler::new(5),
|
|
|
|
|
))
|
|
|
|
|
SpinNoIrqLock::new({
|
|
|
|
|
let mut processor = Processor::new(
|
|
|
|
|
unsafe { Context::new_init() },
|
|
|
|
|
// NOTE: max_time_slice <= 5 to ensure 'priority' test pass
|
|
|
|
|
StrideScheduler::new(5),
|
|
|
|
|
);
|
|
|
|
|
extern fn idle(arg: usize) -> ! {
|
|
|
|
|
loop {}
|
|
|
|
|
}
|
|
|
|
|
processor.add(Context::new_kernel(idle, 0));
|
|
|
|
|
processor
|
|
|
|
|
})
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|