mirror of
https://github.com/panpaul/tiny_os
synced 2024-09-20 09:45:19 +08:00
feat: vspace: entry: add clear api
This commit is contained in:
parent
8fe47c5728
commit
03aa0edcc8
@ -117,6 +117,10 @@ impl EntryOps for Entry {
|
||||
self.0 = (self.0 & !PTEFlags::all().bits()) | flags.bits();
|
||||
}
|
||||
|
||||
fn clear(&mut self) {
|
||||
self.0 = 0;
|
||||
}
|
||||
|
||||
fn is_valid(&self) -> bool {
|
||||
self.0 & PTEFlags::VALID.bits() != 0
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ pub trait EntryOps: Clone + Copy + Debug {
|
||||
|
||||
fn set_paddr(&mut self, addr: PhysAddr);
|
||||
fn set_attr(&mut self, attr: MapAttr);
|
||||
fn clear(&mut self);
|
||||
|
||||
fn is_valid(&self) -> bool;
|
||||
fn is_leaf(&self) -> bool;
|
||||
|
Loading…
Reference in New Issue
Block a user