Skip to content

Commit e6e255f

Browse files
authored
Rename scheduler_priority to scheduler_epoch, plus cleanup (theseus-os#980)
Preface to a future PR that renames `scheduler_realtime` to `scheduler_priority`, and to a series of PRs that revamp schedulers. Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
1 parent 5b24574 commit e6e255f

File tree

13 files changed

+211
-232
lines changed

13 files changed

+211
-232
lines changed

Cargo.lock

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

applications/ps/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ pub fn main(args: Vec<String>) -> isize {
3333
println!("{0:<5} {1}", "ID", "NAME");
3434
}
3535
else {
36-
#[cfg(priority_scheduler)] {
36+
#[cfg(epoch_scheduler)] {
3737
println!("{0:<5} {1:<10} {2:<4} {3:<4} {4:<5} {5:<10} {6}", "ID", "RUNSTATE", "CPU", "PIN", "TYPE", "PRIORITY", "NAME");
3838
}
39-
#[cfg(not(priority_scheduler))] {
39+
#[cfg(not(epoch_scheduler))] {
4040
println!("{0:<5} {1:<10} {2:<4} {3:<4} {4:<5} {5}", "ID", "RUNSTATE", "CPU", "PIN", "TYPE", "NAME");
4141
}
4242
}
@@ -59,14 +59,14 @@ pub fn main(args: Vec<String>) -> isize {
5959
else if task.is_application() {"A"}
6060
else {" "} ;
6161

62-
#[cfg(priority_scheduler)] {
62+
#[cfg(epoch_scheduler)] {
6363
let priority = scheduler::get_priority(&task).map(|priority| format!("{}", priority)).unwrap_or_else(|| String::from("-"));
6464
task_string.push_str(
6565
&format!("{0:<5} {1:<10} {2:<4} {3:<4} {4:<5} {5:<10} {6}\n",
6666
id, runstate, cpu, pinned, task_type, priority, task.name)
6767
);
6868
}
69-
#[cfg(not(priority_scheduler))] {
69+
#[cfg(not(epoch_scheduler))] {
7070
writeln!(task_string, "{0:<5} {1:<10} {2:<4} {3:<4} {4:<5} {5}",
7171
id, runstate, cpu, pinned, task_type, task.name).expect("Failed to write to task_string.");
7272
}

applications/test_scheduler/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub fn main(_args: Vec<String>) -> isize {
5656
let _priority2 = scheduler::get_priority(&taskref2);
5757
let _priority3 = scheduler::get_priority(&taskref3);
5858

59-
#[cfg(priority_scheduler)]
59+
#[cfg(epoch_scheduler)]
6060
{
6161
assert_eq!(_priority1,Some(30));
6262
assert_eq!(_priority2,Some(20));

kernel/runqueue/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ path = "../task"
2828
[dependencies.runqueue_round_robin]
2929
path = "../runqueue_round_robin"
3030

31-
[dependencies.runqueue_priority]
32-
path = "../runqueue_priority"
31+
[dependencies.runqueue_epoch]
32+
path = "../runqueue_epoch"
3333

3434
[dependencies.runqueue_realtime]
3535
path = "../runqueue_realtime"

kernel/runqueue/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ extern crate atomic_linked_list;
1111
extern crate task;
1212
#[macro_use] extern crate cfg_if;
1313
cfg_if! {
14-
if #[cfg(priority_scheduler)] {
15-
extern crate runqueue_priority as runqueue;
14+
if #[cfg(epoch_scheduler)] {
15+
extern crate runqueue_epoch as runqueue;
1616
} else if #[cfg(realtime_scheduler)] {
1717
extern crate runqueue_realtime as runqueue;
1818
} else {

kernel/runqueue_priority/Cargo.toml renamed to kernel/runqueue_epoch/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[package]
22
authors = ["Namitha Liyanage <Namithaliyanage@gmail.com>"]
3-
name = "runqueue_priority"
4-
description = "Functions and types for handling runqueues when priority scheduler is in use, i.e., lists of tasks for scheduling purposes"
3+
name = "runqueue_epoch"
4+
description = "Run queue for the epoch scheduler"
55
version = "0.1.0"
6+
edition = "2021"
67

78
[dependencies]
89
log = "0.4.8"

0 commit comments

Comments
 (0)