Implement new scheduling API in OSTD

This commit is contained in:
jellllly420
2024-07-27 18:38:14 +08:00
committed by Tate, Hongliang Tian
parent 4844e7ca7c
commit f5464e82c0
14 changed files with 727 additions and 329 deletions

View File

@ -129,7 +129,7 @@ pub fn call_ostd_main() -> ! {
unsafe {
use alloc::boxed::Box;
use crate::task::{set_scheduler, FifoScheduler, Scheduler, TaskOptions};
use crate::task::TaskOptions;
crate::init();
// The whitelists that will be generated by OSDK runner as static consts.
@ -137,10 +137,6 @@ pub fn call_ostd_main() -> ! {
static KTEST_TEST_WHITELIST: Option<&'static [&'static str]>;
static KTEST_CRATE_WHITELIST: Option<&'static [&'static str]>;
}
// Set the global scheduler a FIFO scheduler.
let simple_scheduler = Box::new(FifoScheduler::new());
let static_scheduler: &'static dyn Scheduler = Box::leak(simple_scheduler);
set_scheduler(static_scheduler);
let test_task = move || {
run_ktests(KTEST_TEST_WHITELIST, KTEST_CRATE_WHITELIST);