Rearrange mods and imports [wip]
This commit is contained in:
parent
2abf70fe90
commit
6018ac2b3d
|
@ -1,4 +1,4 @@
|
||||||
use memory::{Frame, FrameAllocator};
|
use super::{Frame, FrameAllocator};
|
||||||
use multiboot2::{MemoryArea, MemoryAreaIter}; // replace with DTB?
|
use multiboot2::{MemoryArea, MemoryAreaIter}; // replace with DTB?
|
||||||
|
|
||||||
pub struct AreaFrameAllocator {
|
pub struct AreaFrameAllocator {
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
pub use self::area_frame_allocator::AreaFrameAllocator;
|
// mod arch::aarch64::memory
|
||||||
use self::paging::PhysicalAddress;
|
|
||||||
|
|
||||||
mod area_frame_allocator;
|
mod area_frame_allocator;
|
||||||
mod paging;
|
mod paging;
|
||||||
|
|
||||||
pub const PAGE_SIZE: usize = 4096;
|
pub use self::area_frame_allocator::AreaFrameAllocator;
|
||||||
|
|
||||||
|
pub type PhysicalAddress = usize;
|
||||||
|
pub type VirtualAddress = usize;
|
||||||
|
|
||||||
|
use self::paging::PAGE_SIZE;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord)]
|
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
pub struct Frame {
|
pub struct Frame {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use memory::Frame;
|
use super::super::Frame;
|
||||||
|
|
||||||
pub struct Entry(u64);
|
pub struct Entry(u64);
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// mod arch::aarch64::memory::paging
|
||||||
|
|
||||||
//! Some code was borrowed from [Phil Opp's Blog](https://os.phil-opp.com/page-tables/)
|
//! Some code was borrowed from [Phil Opp's Blog](https://os.phil-opp.com/page-tables/)
|
||||||
//! Paging is mostly based on https://os.phil-opp.com/page-tables/ and ARM ARM
|
//! Paging is mostly based on https://os.phil-opp.com/page-tables/ and ARM ARM
|
||||||
|
|
||||||
|
@ -28,16 +30,15 @@
|
||||||
|
|
||||||
pub use self::entry::*;
|
pub use self::entry::*;
|
||||||
use core::ptr::Unique;
|
use core::ptr::Unique;
|
||||||
use memory::{Frame, PAGE_SIZE};
|
|
||||||
use self::table::{Level0, Table};
|
use self::table::{Level0, Table};
|
||||||
|
use super::{Frame, FrameAllocator, PhysicalAddress, VirtualAddress};
|
||||||
|
|
||||||
mod entry;
|
mod entry;
|
||||||
mod table;
|
mod table;
|
||||||
|
|
||||||
const ENTRY_COUNT: usize = 512;
|
pub const PAGE_SIZE: usize = 4096;
|
||||||
|
|
||||||
pub type PhysicalAddress = usize;
|
pub const ENTRY_COUNT: usize = 512;
|
||||||
pub type VirtualAddress = usize;
|
|
||||||
|
|
||||||
pub struct Page {
|
pub struct Page {
|
||||||
number: usize,
|
number: usize,
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
use core::marker::PhantomData;
|
use core::marker::PhantomData;
|
||||||
use memory::paging::entry::*;
|
use core::ops::{Index, IndexMut};
|
||||||
use memory::paging::ENTRY_COUNT;
|
use super::super::FrameAllocator;
|
||||||
|
use super::ENTRY_COUNT;
|
||||||
|
use arch::aarch64::memory::paging::entry::*;
|
||||||
|
|
||||||
pub const L0: *mut Table<Level0> = 0xffff_ffff_ffff_f000 as *mut _;
|
pub const L0: *mut Table<Level0> = 0xffff_ffff_ffff_f000 as *mut _;
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// mod arch
|
||||||
|
|
||||||
#[cfg(target_arch = "aarch64")]
|
#[cfg(target_arch = "aarch64")]
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
pub mod aarch64;
|
pub mod aarch64;
|
||||||
|
|
Loading…
Reference in New Issue