test: fix tests

This commit is contained in:
Mark Poliakov 2024-07-29 15:55:00 +03:00
parent 404ea5a75e
commit f9b2c64edb
5 changed files with 12 additions and 11 deletions

View File

@ -9,7 +9,7 @@ use kernel_arch_interface::{
mem::{
DeviceMemoryAttributes, KernelTableManager, PhysicalMemoryAllocator, RawDeviceMemoryMapping,
},
task::{Scheduler, TaskContext},
task::{Scheduler, TaskContext, UserContextInfo},
Architecture,
};
use libk_mm_interface::{
@ -154,13 +154,7 @@ impl<K: KernelTableManager, PA: PhysicalMemoryAllocator> TaskContext<K, PA>
unimplemented!()
}
fn user(
_entry: usize,
_arg: usize,
_cr3: u64,
_user_stack_sp: usize,
_tls_address: usize,
) -> Result<Self, Error> {
fn user(_info: UserContextInfo) -> Result<Self, Error> {
unimplemented!()
}

View File

@ -15,3 +15,6 @@ vmalloc = { path = "../../lib/vmalloc" }
libyalloc = { path = "../../../lib/libyalloc", default-features = false, features = ["dep-of-kernel"] }
log = "0.4.22"
[lints.rust]
unexpected_cfgs = { level = "allow", check-cfg = ['cfg(rust_analyzer)'] }

View File

@ -26,11 +26,13 @@ use yggdrasil_abi::error::Error;
pub mod address;
pub mod device;
pub mod heap;
pub mod phys;
pub mod pointer;
pub mod process;
#[cfg(any(target_os = "none", rust_analyzer))]
pub mod heap;
pub use libk_mm_interface::table;
pub struct TableAllocatorImpl;

View File

@ -33,10 +33,12 @@ pub mod task;
pub mod arch;
pub mod module;
pub mod panic;
pub mod random;
pub mod vfs;
#[cfg(any(target_os = "none", rust_analyzer))]
pub mod panic;
pub mod device {
pub use libk_device::*;
}

View File

@ -792,7 +792,7 @@ mod tests {
.unwrap();
let mut buf = [0; 512];
assert_eq!(&*data.lock().unwrap(), &[]);
assert_eq!(&*data.lock().unwrap(), b"");
assert_eq!(file.tell().unwrap(), 0);
assert_eq!(file.write(b"Hello").unwrap(), 5);