Implement many process syscalls.

This commit is contained in:
Yifan Wu 2020-12-10 11:57:26 +08:00
parent 81bef97f09
commit 3642f9c56d
20 changed files with 383 additions and 88 deletions

View file

@ -110,6 +110,13 @@ impl VirtPageNum {
}
}
impl PhysAddr {
pub fn get_mut<T>(&self) -> &'static mut T {
unsafe {
(self.0 as *mut T).as_mut().unwrap()
}
}
}
impl PhysPageNum {
pub fn get_pte_array(&self) -> &'static mut [PageTableEntry] {
let pa: PhysAddr = self.clone().into();
@ -125,9 +132,7 @@ impl PhysPageNum {
}
pub fn get_mut<T>(&self) -> &'static mut T {
let pa: PhysAddr = self.clone().into();
unsafe {
(pa.0 as *mut T).as_mut().unwrap()
}
pa.get_mut()
}
}