Skip to content
Snippets Groups Projects
Commit 08a4c33b authored by Robert Węcławski's avatar Robert Węcławski
Browse files

New entries are set to zero

parent 2d041bbb
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,11 @@ pub const ADDRESS_MASK: usize = 0x000f_ffff_ffff_f000; ...@@ -27,6 +27,11 @@ pub const ADDRESS_MASK: usize = 0x000f_ffff_ffff_f000;
pub const COUNTER_MASK: u64 = 0x3ff00000_00000000; pub const COUNTER_MASK: u64 = 0x3ff00000_00000000;
impl Entry { impl Entry {
/// Zero entry
pub fn set_zero(&mut self) {
self.0 = 0;
}
/// Is the entry unused? /// Is the entry unused?
pub fn is_unused(&self) -> bool { pub fn is_unused(&self) -> bool {
self.0 == (self.0 & COUNTER_MASK) self.0 == (self.0 & COUNTER_MASK)
......
...@@ -55,7 +55,7 @@ impl<L> Table<L> where L: TableLevel { ...@@ -55,7 +55,7 @@ impl<L> Table<L> where L: TableLevel {
pub fn zero(&mut self) { pub fn zero(&mut self) {
for entry in self.entries.iter_mut() { for entry in self.entries.iter_mut() {
entry.set_unused(); entry.set_zero();
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment