mirror of
https://github.com/panpaul/tiny_os
synced 2024-09-20 09:45:19 +08:00
chore: format
This commit is contained in:
parent
a007e299d2
commit
9c1b39b6d7
@ -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};
|
||||
|
@ -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();
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::objects::null::NullCap;
|
||||
use crate::objects::*;
|
||||
use core::cell::Cell;
|
||||
use uapi::cap::ObjectType;
|
||||
use utils::addr::PhysAddr;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::objects::tcb::TcbObject;
|
||||
use crate::objects::*;
|
||||
|
||||
pub struct Trap;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user