Rustfmt [paging]
This commit is contained in:
parent
a2ea1f59a6
commit
befa1c5db8
|
@ -84,7 +84,8 @@ impl AreaFrameAllocator {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn choose_next_area(&mut self) {
|
fn choose_next_area(&mut self) {
|
||||||
self.current_area = self.areas
|
self.current_area = self
|
||||||
|
.areas
|
||||||
.clone()
|
.clone()
|
||||||
.filter(|area| {
|
.filter(|area| {
|
||||||
let address = area.base_addr + area.length - 1;
|
let address = area.base_addr + area.length - 1;
|
||||||
|
|
|
@ -29,9 +29,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
pub use self::entry::*;
|
pub use self::entry::*;
|
||||||
use core::ptr::Unique;
|
|
||||||
use self::table::{Level0, Table};
|
use self::table::{Level0, Table};
|
||||||
use super::{Frame, FrameAllocator, PhysicalAddress, VirtualAddress};
|
use super::{Frame, FrameAllocator, PhysicalAddress, VirtualAddress};
|
||||||
|
use core::ptr::Unique;
|
||||||
|
|
||||||
mod entry;
|
mod entry;
|
||||||
mod table;
|
mod table;
|
||||||
|
@ -116,7 +116,8 @@ impl ActivePageTable {
|
||||||
// address must be 1GiB aligned
|
// address must be 1GiB aligned
|
||||||
assert!(start_frame.number % (ENTRY_COUNT * ENTRY_COUNT) == 0);
|
assert!(start_frame.number % (ENTRY_COUNT * ENTRY_COUNT) == 0);
|
||||||
return Some(Frame {
|
return Some(Frame {
|
||||||
number: start_frame.number + page.l2_index() * ENTRY_COUNT
|
number: start_frame.number
|
||||||
|
+ page.l2_index() * ENTRY_COUNT
|
||||||
+ page.l3_index(),
|
+ page.l3_index(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -182,7 +183,8 @@ impl ActivePageTable {
|
||||||
|
|
||||||
assert!(self.translate(page.start_address()).is_some());
|
assert!(self.translate(page.start_address()).is_some());
|
||||||
|
|
||||||
let l3 = self.l0_mut()
|
let l3 = self
|
||||||
|
.l0_mut()
|
||||||
.next_table_mut(page.l0_index())
|
.next_table_mut(page.l0_index())
|
||||||
.and_then(|l1| l1.next_table_mut(page.l1_index()))
|
.and_then(|l1| l1.next_table_mut(page.l1_index()))
|
||||||
.and_then(|l2| l2.next_table_mut(page.l2_index()))
|
.and_then(|l2| l2.next_table_mut(page.l2_index()))
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use core::marker::PhantomData;
|
|
||||||
use core::ops::{Index, IndexMut};
|
|
||||||
use super::super::FrameAllocator;
|
use super::super::FrameAllocator;
|
||||||
use super::ENTRY_COUNT;
|
use super::ENTRY_COUNT;
|
||||||
use arch::aarch64::memory::paging::entry::*;
|
use arch::aarch64::memory::paging::entry::*;
|
||||||
|
use core::marker::PhantomData;
|
||||||
|
use core::ops::{Index, IndexMut};
|
||||||
|
|
||||||
pub const L0: *mut Table<Level0> = 0xffff_ffff_ffff_f000 as *mut _; // L0 0o177777_777_777_777_777_0000
|
pub const L0: *mut Table<Level0> = 0xffff_ffff_ffff_f000 as *mut _; // L0 0o177777_777_777_777_777_0000
|
||||||
// L1 0o177777_777_777_777_XXX_0000, XXX is the L0 index
|
// L1 0o177777_777_777_777_XXX_0000, XXX is the L0 index
|
||||||
|
|
Loading…
Reference in New Issue