From a88bc73e4c658c2a0208337f3bfecb5b2897bc8b Mon Sep 17 00:00:00 2001 From: Kees Jongenburger Date: Wed, 25 Sep 2013 10:36:07 +0200 Subject: [PATCH] arm:allow to lookup physical addresses of sections. Change-Id: If4716b81cceee5d8b30d5f103b772b0ac99fc807 --- kernel/arch/earm/memory.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/arch/earm/memory.c b/kernel/arch/earm/memory.c index 6a9334d5c..f1afdcab0 100644 --- a/kernel/arch/earm/memory.c +++ b/kernel/arch/earm/memory.c @@ -309,17 +309,17 @@ int vm_lookup(const struct proc *proc, const vir_bytes virtual, assert(pde >= 0 && pde < ARM_VM_DIR_ENTRIES); pde_v = phys_get32((u32_t) (root + pde)); - if(!(pde_v & ARM_VM_PDE_PRESENT)) { + if(! ((pde_v & ARM_VM_PDE_PRESENT) + || (pde_v & ARM_VM_SECTION_PRESENT) + )) { return EFAULT; } - /* We don't expect to ever see this. - * LSC Impossible with the previous test. if(pde_v & ARM_VM_SECTION) { *physical = pde_v & ARM_VM_SECTION_MASK; if(ptent) *ptent = pde_v; *physical += virtual & ARM_VM_OFFSET_MASK_1MB; - } else */ { + } else { /* Retrieve page table entry. */ pt = (u32_t *) (pde_v & ARM_VM_PDE_MASK); assert(!((u32_t) pt % ARM_PAGETABLE_SIZE));