mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Rename and use is_unused()
This commit is contained in:
@@ -32,7 +32,7 @@ use memory::Frame; // needed later
|
||||
pub struct Entry(u64);
|
||||
|
||||
impl Entry {
|
||||
pub fn unused(&self) -> bool {
|
||||
pub fn is_unused(&self) -> bool {
|
||||
self.0 == 0
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ use memory::paging::PhysicalAddress;
|
||||
pub struct Entry(u64);
|
||||
|
||||
impl Entry {
|
||||
pub fn unused(&self) -> bool {
|
||||
pub fn is_unused(&self) -> bool {
|
||||
self.0 == 0
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,6 @@ pub fn map_to<A>(page: &Page, frame: Frame, flags: EntryFlags, allocator: &mut A
|
||||
let mut p2 = p3.next_table_create(page.p3_index(), allocator);
|
||||
let mut p1 = p2.next_table_create(page.p2_index(), allocator);
|
||||
|
||||
assert!(!p1[page.p1_index()].flags().contains(PRESENT));
|
||||
assert!(p1[page.p1_index()].is_unused());
|
||||
p1[page.p1_index()].set(frame, flags | PRESENT);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user