diff --git a/Cargo.lock b/Cargo.lock index 837b0a9bd..82dd27107 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -646,6 +646,7 @@ dependencies = [ name = "hyperion-kernel" version = "0.1.0" dependencies = [ + "arcstr", "crossbeam", "futures-util", "hyperion-arch", diff --git a/crates/kernel/Cargo.toml b/crates/kernel/Cargo.toml index e41a58009..e33ebe44d 100644 --- a/crates/kernel/Cargo.toml +++ b/crates/kernel/Cargo.toml @@ -14,6 +14,7 @@ multiboot2 = [] # Pick limine OR bootboot OR multiboot1 OR multiboot2, they conflict with eachother [dependencies] +arcstr.workspace = true spin.workspace = true x86_64.workspace = true time.workspace = true diff --git a/crates/kernel/src/testfw.rs b/crates/kernel/src/testfw.rs index f1a5b4408..df9ebb36f 100644 --- a/crates/kernel/src/testfw.rs +++ b/crates/kernel/src/testfw.rs @@ -2,9 +2,10 @@ // extern crate test; -use alloc::{borrow::Cow, format, string::String}; +use alloc::{format, string::String}; use core::{any::type_name, panic::PanicInfo}; +use arcstr::ArcStr; use crossbeam::queue::SegQueue; use hyperion_log::{print, println, LogLevel}; use hyperion_scheduler::yield_now; @@ -62,7 +63,7 @@ pub fn test_runner(tests: &'static [&'static dyn TestCase]) { hyperion_scheduler::spawn(move || { let name = test.name(); // println!("running {name}"); - hyperion_scheduler::rename(name.into()); + hyperion_scheduler::rename(name); test.run(); @@ -79,7 +80,7 @@ pub fn test_runner(tests: &'static [&'static dyn TestCase]) { } hyperion_scheduler::spawn(move || { - hyperion_scheduler::rename("testfw waiter".into()); + hyperion_scheduler::rename("testfw waiter"); let mut completed = 0; @@ -126,7 +127,7 @@ pub fn test_panic_handler(info: &PanicInfo) -> ! { // -static RESULTS: SegQueue<(Cow<'static, str>, Option)> = SegQueue::new(); +static RESULTS: SegQueue<(ArcStr, Option)> = SegQueue::new(); // diff --git a/crates/scheduler/src/lib.rs b/crates/scheduler/src/lib.rs index ed2c40ee9..168da4032 100644 --- a/crates/scheduler/src/lib.rs +++ b/crates/scheduler/src/lib.rs @@ -258,7 +258,7 @@ fn cpu_time_elapsed() -> u64 { let now = HPET.nanos() as u64; let last = last_time().swap(now, Ordering::SeqCst); - now - last + now.saturating_sub(last) } fn reset_cpu_timer() {