Rearrange mods and imports [wip]

This commit is contained in:
Berkus Decker 2018-02-23 16:47:57 +02:00 committed by Berkus Decker
parent 2abf70fe90
commit 6018ac2b3d
6 changed files with 20 additions and 11 deletions

View File

@ -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 {

View File

@ -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 {

View File

@ -1,4 +1,4 @@
use memory::Frame; use super::super::Frame;
pub struct Entry(u64); pub struct Entry(u64);

View File

@ -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,

View File

@ -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 _;

View File

@ -1,3 +1,5 @@
// mod arch
#[cfg(target_arch = "aarch64")] #[cfg(target_arch = "aarch64")]
#[macro_use] #[macro_use]
pub mod aarch64; pub mod aarch64;