From 3644bcc18f0ce06ec8e6d737a3a859c9ba38d393 Mon Sep 17 00:00:00 2001 From: Berkus Decker Date: Sun, 10 Mar 2019 15:57:22 +0200 Subject: [PATCH] Make memory map accessible to MMU setup code --- src/arch/aarch64/memory/mod.rs | 6 ++++-- src/arch/aarch64/mmu.rs | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/arch/aarch64/memory/mod.rs b/src/arch/aarch64/memory/mod.rs index 43dd7e6..a4a4096 100644 --- a/src/arch/aarch64/memory/mod.rs +++ b/src/arch/aarch64/memory/mod.rs @@ -144,7 +144,7 @@ pub mod kernel_mem_range { } } -use kernel_mem_range::*; +pub use kernel_mem_range::*; /// A virtual memory layout that is agnostic of the paging granularity that the /// hardware MMU will use. @@ -246,7 +246,9 @@ static KERNEL_VIRTUAL_LAYOUT: [Descriptor; 5] = [ /// /// If the address is not covered in VIRTUAL_LAYOUT, return a default for normal /// cacheable DRAM. -fn get_virt_addr_properties(virt_addr: usize) -> Result<(usize, AttributeFields), &'static str> { +pub fn get_virt_addr_properties( + virt_addr: usize, +) -> Result<(usize, AttributeFields), &'static str> { if virt_addr > map::END { return Err("Address out of range."); } diff --git a/src/arch/aarch64/mmu.rs b/src/arch/aarch64/mmu.rs index 4e6a1b9..0c75643 100644 --- a/src/arch/aarch64/mmu.rs +++ b/src/arch/aarch64/mmu.rs @@ -26,6 +26,7 @@ //! MMU initialisation. //! [ARMv8 memory addressing](https://static.docs.arm.com/100940/0100/armv8_a_address%20translation_100940_0100_en.pdf) +use crate::arch::aarch64::memory::{get_virt_addr_properties, AttributeFields}; use crate::println; use cortex_a::{barrier, regs::*}; use register::register_bitfields;