From ab95de393ba01eea0d868fd314d81d979dcddaab Mon Sep 17 00:00:00 2001 From: Berkus Decker Date: Sun, 8 May 2022 10:48:43 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Map=20VC=20memory=20to=20?= =?UTF-8?q?make=20`disp`=20command=20work?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- machine/src/platform/rpi3/memory/mmu.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/machine/src/platform/rpi3/memory/mmu.rs b/machine/src/platform/rpi3/memory/mmu.rs index a93fc73..5755196 100644 --- a/machine/src/platform/rpi3/memory/mmu.rs +++ b/machine/src/platform/rpi3/memory/mmu.rs @@ -7,7 +7,7 @@ use {super::map as memory_map, crate::memory::mmu::*, core::ops::RangeInclusive} /// The kernel's address space defined by this BSP. pub type KernelAddrSpace = AddressSpace<{ memory_map::END_INCLUSIVE + 1 }>; -const NUM_MEM_RANGES: usize = 5; +const NUM_MEM_RANGES: usize = 6; /// The virtual memory layout that is agnostic of the paging granularity that the /// hardware MMU will use. @@ -69,6 +69,21 @@ pub static LAYOUT: KernelVirtualLayout = KernelVirtualLayout::ne execute_never: true, }, }, + TranslationDescriptor { + name: "Framebuffer area (static for now)", + virtual_range: || { + RangeInclusive::new( + memory_map::phys::VIDEOMEM_BASE, + memory_map::phys::MMIO_BASE - 1, + ) + }, + physical_range_translation: Translation::Identity, + attribute_fields: AttributeFields { + mem_attributes: MemAttributes::Device, + acc_perms: AccessPermissions::ReadWrite, + execute_never: true, + }, + }, ], );