diff --git a/Cargo.lock b/Cargo.lock index 2d8455475b..182e3e0153 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3872,18 +3872,6 @@ dependencies = [ "preemption", ] -[[package]] -name = "test_priority_scheduler" -version = "0.1.0" -dependencies = [ - "app_io", - "log", - "scheduler", - "sleep", - "spawn", - "time", -] - [[package]] name = "test_restartable" version = "0.1.0" @@ -4060,7 +4048,6 @@ dependencies = [ "test_mlx5", "test_panic", "test_preemption_counter", - "test_priority_scheduler", "test_restartable", "test_scheduler", "test_serial_echo", diff --git a/Cargo.toml b/Cargo.toml index 56bdae404f..250e103cc9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -89,7 +89,6 @@ exclude = [ "applications/test_libc", "applications/test_mlx5", "applications/test_panic", - "applications/test_priority_scheduler", "applications/test_restartable", "applications/test_serial_echo", "applications/test_std_fs", diff --git a/applications/test_priority_scheduler/Cargo.toml b/applications/test_priority_scheduler/Cargo.toml deleted file mode 100644 index 22ba0026cf..0000000000 --- a/applications/test_priority_scheduler/Cargo.toml +++ /dev/null @@ -1,23 +0,0 @@ -[package] -name = "test_priority_scheduler" -version = "0.1.0" -description = "Application to test the priority scheduler" -authors = ["Jacob Earle "] - -[dependencies] -log = "0.4.8" - -[dependencies.sleep] -path = "../../kernel/sleep" - -[dependencies.spawn] -path = "../../kernel/spawn" - -[dependencies.scheduler] -path = "../../kernel/scheduler" - -[dependencies.app_io] -path = "../../kernel/app_io" - -[dependencies.time] -path = "../../kernel/time" diff --git a/applications/test_priority_scheduler/src/lib.rs b/applications/test_priority_scheduler/src/lib.rs deleted file mode 100644 index 3ed645b11e..0000000000 --- a/applications/test_priority_scheduler/src/lib.rs +++ /dev/null @@ -1,61 +0,0 @@ -//! Demo of scheduling a periodic task using the priority scheduler. -//! -//! One potential direction for future testing could be the following: -//! Let the program take in arguments `n` and `p1` ... `pm`. -//! For each `p_i`, we: -//! 1. spawn a task with period `pi` -//! 2. Let each spawned task run for `n` complete periods. -//! 3. Use`hpet()` to measure the time elapsed between successive executions of each task. -//! 4. Calculate statistics on how much the time between successive calls -//! to the timing statement deviates from the expected time, i.e. the period `pi`. -//! * This is one way to assess the accuracy of the `sleep` function. -//! - -#![no_std] - -#[macro_use] extern crate log; -extern crate alloc; -extern crate spawn; -extern crate sleep; -extern crate scheduler; -#[macro_use] extern crate app_io; -extern crate time; - -use alloc::{ - vec::Vec, - string::String -}; - -pub fn main(_args: Vec) -> isize { - #[cfg(not(priority_scheduler))] { - println!("Error: `priority_scheduler` cfg was not enabled!"); - -1 - } - #[cfg(priority_scheduler)] { - println!("Testing periodic task(s) with the priority scheduler!"); - // Build and spawn two real time periodic task(s). - // Start them as blocked in order to set the periods before they run - let periodic_tb1 = spawn::new_task_builder(_task_delay_tester, 1).block(); - let periodic_task_1 = periodic_tb1.spawn().unwrap(); - - // Set the periods of the task - scheduler::set_priority(&periodic_task_1, 200).unwrap(); - - // start the tasks - periodic_task_1.unblock().unwrap(); - - 0 - } -} - -/// A simple task that periodically sleeps and prints a log statement at regular intervals. -fn _task_delay_tester(_arg: usize) { - let mut end_time = time::now::(); - let mut iter = 0; - loop { - end_time += time::Duration::from_secs(1); - info!("I run periodically (iter {}).", iter); - iter += 1; - sleep::sleep_until(end_time).unwrap(); - } -} diff --git a/theseus_features/Cargo.toml b/theseus_features/Cargo.toml index b4f504aea4..b223c9fea8 100644 --- a/theseus_features/Cargo.toml +++ b/theseus_features/Cargo.toml @@ -59,7 +59,6 @@ test_libc = { path = "../applications/test_libc", optional = true } test_mlx5 = { path = "../applications/test_mlx5", optional = true } test_panic = { path = "../applications/test_panic", optional = true } test_preemption_counter = { path = "../applications/test_preemption_counter", optional = true } -test_priority_scheduler = { path = "../applications/test_priority_scheduler", optional = true } test_restartable = { path = "../applications/test_restartable", optional = true } test_scheduler = { path = "../applications/test_scheduler", optional = true } test_serial_echo = { path = "../applications/test_serial_echo", optional = true } @@ -159,7 +158,6 @@ theseus_tests = [ "test_mlx5", "test_panic", "test_preemption_counter", - "test_priority_scheduler", "test_restartable", "test_scheduler", "test_serial_echo",