[haiku-commits] r42458 - haiku/trunk/src/system/boot/platform/openfirmware/arch/ppc

  • From: kallisti5@xxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 20 Jul 2011 19:06:13 +0200 (CEST)

Author: kallisti5
Date: 2011-07-20 19:06:13 +0200 (Wed, 20 Jul 2011)
New Revision: 42458
Changeset: https://dev.haiku-os.org/changeset/42458

Modified:
   haiku/trunk/src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp
Log:
* Clean up translation debug output
* Few small style cleanups
* No functional change


Modified: haiku/trunk/src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp
===================================================================
--- haiku/trunk/src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp  
2011-07-19 22:39:05 UTC (rev 42457)
+++ haiku/trunk/src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp  
2011-07-20 17:06:13 UTC (rev 42458)
@@ -114,9 +114,8 @@
 {
        addr_t foundBase;
        return !get_free_address_range(gKernelArgs.virtual_allocated_range,
-                       gKernelArgs.num_virtual_allocated_ranges, 
(addr_t)address, size,
-                       &foundBase)
-               || foundBase != (addr_t)address;
+               gKernelArgs.num_virtual_allocated_ranges, (addr_t)address, size,
+               &foundBase) || foundBase != (addr_t)address;
 }
 
 
@@ -125,10 +124,9 @@
 {
        phys_addr_t foundBase;
        return !get_free_physical_address_range(
-                       gKernelArgs.physical_allocated_range,
-                       gKernelArgs.num_physical_allocated_ranges, 
(addr_t)address, size,
-                       &foundBase)
-               || foundBase != (addr_t)address;
+               gKernelArgs.physical_allocated_range,
+               gKernelArgs.num_physical_allocated_ranges, (addr_t)address, 
size,
+               &foundBase) || foundBase != (addr_t)address;
 }
 
 
@@ -269,7 +267,7 @@
 
                if (is_physical_memory(map->physical_address)
                        && 
insert_physical_allocated_range((addr_t)map->physical_address,
-                                       map->length) != B_OK) {
+                               map->length) != B_OK) {
                        dprintf("cannot map physical allocated range "
                                "(num ranges = %" B_PRIu32 ")!\n",
                                gKernelArgs.num_physical_allocated_ranges);
@@ -277,7 +275,8 @@
                }
 
                if (map->virtual_address == pageTable) {
-                       dprintf("found page table\n");
+                       dprintf("%i: found page table at va %p\n", i,
+                               map->virtual_address);
                        *_physicalPageTable
                                = (page_table_entry_group 
*)map->physical_address;
                        keepRange = false;
@@ -285,7 +284,8 @@
                }
                if ((addr_t)map->physical_address <= 0x100
                        && (addr_t)map->physical_address + map->length >= 
0x1000) {
-                       dprintf("found exception handlers\n");
+                       dprintf("%i: found exception handlers at va %p\n", i,
+                               map->virtual_address);
                        *_exceptionHandlers = map->virtual_address;
                        keepRange = false;
                                // we keep it explicitely anyway
@@ -310,6 +310,9 @@
                // insert range in virtual ranges to keep
 
                if (keepRange) {
+                       TRACE("%i: keeping free range starting at va %p\n", i,
+                               map->virtual_address);
+
                        if (insert_virtual_range_to_keep(map->virtual_address,
                                        map->length) != B_OK) {
                                dprintf("cannot map virtual range to keep "
@@ -320,14 +323,14 @@
 
                total += map->length;
        }
-       dprintf("total mapped: %" B_PRIu32 "\n", total);
+       dprintf("total size kept: %" B_PRIu32 "\n", total);
 
        // remove the boot loader code from the virtual ranges to keep in the
        // kernel
        if (remove_virtual_range_to_keep(&__text_begin, &_end - &__text_begin)
                        != B_OK) {
-               dprintf("find_allocated_ranges(): Failed to remove boot loader 
range "
-                       "from virtual ranges to keep.\n");
+               dprintf("%s: Failed to remove boot loader range "
+                       "from virtual ranges to keep.\n", __func__);
        }
 
        return B_OK;
@@ -688,7 +691,10 @@
        oldTable = table;
 
        bool realMode = false;
+
        // TODO: read these values out of the OF settings
+       // NOTE: I've only ever seen -1 (0xffffffff) for these values in
+       //       OpenFirmware.. even after loading the bootloader -- Alex
        addr_t realBase = 0;
        addr_t realSize = 0x400000;
 


Other related posts:

  • » [haiku-commits] r42458 - haiku/trunk/src/system/boot/platform/openfirmware/arch/ppc - kallisti5