From eec73aabb7f0eaebab5d2cf6b9c67dba2dcd4c32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sun, 3 Aug 2008 19:53:09 +0000 Subject: [PATCH] - fix page dir index - fix comment - mode debug output - don't lookup unmapped pages in early_query git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26770 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../arch/m68k/arch_vm_translation_map_impl.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/system/kernel/arch/m68k/arch_vm_translation_map_impl.cpp b/src/system/kernel/arch/m68k/arch_vm_translation_map_impl.cpp index a3c230d7ad..057dc9a39e 100644 --- a/src/system/kernel/arch/m68k/arch_vm_translation_map_impl.cpp +++ b/src/system/kernel/arch/m68k/arch_vm_translation_map_impl.cpp @@ -214,9 +214,8 @@ _update_all_pgdirs(int index, page_root_entry e) // this is used before the vm is fully up, it uses the -// transparent translation of the first 32MB +// transparent translation of the first 256MB // a set up by the bootloader. -// (XXX: why just 32MB ? TT0 should just map 2G) static status_t early_query(addr_t va, addr_t *_physicalAddress) { @@ -254,7 +253,7 @@ early_query(addr_t va, addr_t *_physicalAddress) index = 0; // single descriptor } - if (pt /*&& pt[index].type == DT_PAGE*/) { + if (pt && pt[index].type == DT_PAGE) { *_physicalAddress = PTE_TO_PA(pt[index]); // we should only be passed page va, but just in case. *_physicalAddress += va % B_PAGE_SIZE; @@ -1273,7 +1272,7 @@ m68k_vm_translation_map_init(kernel_args *args) early_query(virt_pgtable, &phys_pgtable); index = VADDR_TO_PRENT(sIOSpaceBase) + i / NUM_DIRENT_PER_TBL; pd = (page_directory_entry *)PRE_TO_TA(pr[index]); - e = &pd[VADDR_TO_PRENT(sIOSpaceBase) + i % NUM_DIRENT_PER_TBL]; + e = &pd[(VADDR_TO_PDENT(sIOSpaceBase) + i) % NUM_DIRENT_PER_TBL]; put_pgtable_in_pgdir(e, phys_pgtable, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA); } @@ -1432,11 +1431,11 @@ m68k_vm_translation_map_early_map(kernel_args *args, addr_t va, addr_t pa, index = VADDR_TO_PRENT(va); if (pr[index].type != DT_ROOT) { unsigned aindex = index & ~(NUM_DIRTBL_PER_PAGE-1); /* aligned */ - //TRACE(("missing page root entry %d ai %d\n", index, aindex)); + TRACE(("missing page root entry %d ai %d\n", index, aindex)); tbl = get_free_page(args) * B_PAGE_SIZE; if (!tbl) return ENOMEM; - TRACE(("early_map: asked for free page for pgtable. 0x%lx\n", tbl)); + TRACE(("early_map: asked for free page for pgdir. 0x%lx\n", tbl)); // zero-out memset((void *)tbl, 0, B_PAGE_SIZE); // for each pgdir on the allocated page: @@ -1456,7 +1455,7 @@ m68k_vm_translation_map_early_map(kernel_args *args, addr_t va, addr_t pa, index = VADDR_TO_PDENT(va); if (pd[index].type != DT_DIR) { unsigned aindex = index & ~(NUM_PAGETBL_PER_PAGE-1); /* aligned */ - //TRACE(("missing page dir entry %d ai %d\n", index, aindex)); + TRACE(("missing page dir entry %d ai %d\n", index, aindex)); tbl = get_free_page(args) * B_PAGE_SIZE; if (!tbl) return ENOMEM;