]> Zhao Yanbai Git Server - minix.git/commitdiff
arm:allow to lookup physical addresses of sections. 43/843/2
authorKees Jongenburger <kees.jongenburger@gmail.com>
Wed, 25 Sep 2013 08:36:07 +0000 (10:36 +0200)
committerGerrit Code Review <gerrit@gerrit>
Thu, 26 Sep 2013 07:07:36 +0000 (09:07 +0200)
Change-Id: If4716b81cceee5d8b30d5f103b772b0ac99fc807

kernel/arch/earm/memory.c

index 6a9334d5c672c14d3da247ae5c094cb04ef79626..f1afdcab066173893dc07accc1c247a7ef219dd6 100644 (file)
@@ -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));