chore: format

This commit is contained in:
Paul Pan 2024-06-09 00:18:24 +08:00
parent a007e299d2
commit 9c1b39b6d7
7 changed files with 14 additions and 8 deletions

View File

@ -1,5 +1,5 @@
use crate::entry::HART_ID;
use crate::objects::tcb::TcbObject;
use crate::objects::*;
use crate::plat::console::CONSOLE;
use crate::plat::timer::{Timer, TimerOps};
use crate::plat::trap::{Trap, TrapContextOps, TrapOps};

View File

@ -90,7 +90,7 @@ fn page_table_mode() -> riscv::register::satp::Mode {
}
pub unsafe fn install_pagetable(pt: &Table<Level0>) {
let root_pt = PhysAddr::from(pt.entries as *const _ as *const usize);
let root_pt = PhysAddr::from(pt.entries.as_ptr());
riscv::register::satp::set(page_table_mode(), 0, root_pt.extract_ppn());
riscv::asm::sfence_vma_all();

View File

@ -1,4 +1,4 @@
use crate::objects::null::NullCap;
use crate::objects::*;
use core::cell::Cell;
use uapi::cap::ObjectType;
use utils::addr::PhysAddr;

View File

@ -138,8 +138,7 @@ impl<'a> CNodeCap<'a> {
mod tests {
use super::*;
use crate::arch::vspace::RAM_ALLOCATOR;
use crate::objects::cap::CapEntry;
use crate::objects::null::NullCap;
use crate::objects::*;
use core::alloc::Layout;
use log::info;

View File

@ -14,7 +14,6 @@
*/
use cap::CapEntry;
use core::{marker::PhantomData, ptr::NonNull};
use uapi::{
cap::ObjectType,
@ -29,6 +28,13 @@ pub mod table;
pub mod tcb;
pub mod untyped;
pub use cap::{CapEntry, RawCap};
pub use cnode::{CNodeCap, CNodeObject};
pub use frame::{FrameCap, FrameObject};
pub use null::{NullCap, NullObject};
pub use tcb::{TcbCap, TcbObject};
pub use untyped::{UntypedCap, UntypedObject};
/// Cap is the high-level wrapper of RawCap, it's a typed reference to RawCap (which is untyped in Rust)
/// For the typed objects, we should bound it with an empty traits `KernelObject`
/// And for those objects, at least implement `mint` method and `decodeInvocation` (not enforcing in `KernelObject` for complexity)

View File

@ -1,4 +1,4 @@
use crate::objects::tcb::TcbObject;
use crate::objects::*;
pub struct Trap;

View File

@ -1,4 +1,4 @@
use crate::objects::tcb::TcbObject;
use crate::objects::*;
use core::ptr::NonNull;
use log::error;
use spin::lazy::Lazy;
@ -50,6 +50,7 @@ impl Scheduler {
}
// put to the end of the queue
// todo: only move blocked and time expired threads to the end
next.link.detach();
self.head.prepend(next);
}