[haiku-commits] r37116 - in haiku/trunk: headers/private/kernel/boot src/system/boot/platform/bios_ia32

  • From: ingo_weinhold@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 12 Jun 2010 17:57:21 +0200 (CEST)

Author: bonefish
Date: 2010-06-12 17:57:21 +0200 (Sat, 12 Jun 2010)
New Revision: 37116
Changeset: http://dev.haiku-os.org/changeset/37116/haiku

Modified:
   haiku/trunk/headers/private/kernel/boot/kernel_args.h
   haiku/trunk/src/system/boot/platform/bios_ia32/mmu.cpp
Log:
x86 mmu_init(): Sum up the physical memory we ignore for whatever reason --
stored in kernel_args::ignored_physical_memory.


Modified: haiku/trunk/headers/private/kernel/boot/kernel_args.h
===================================================================
--- haiku/trunk/headers/private/kernel/boot/kernel_args.h       2010-06-12 
15:11:53 UTC (rev 37115)
+++ haiku/trunk/headers/private/kernel/boot/kernel_args.h       2010-06-12 
15:57:21 UTC (rev 37116)
@@ -54,6 +54,7 @@
        addr_range              
virtual_allocated_range[MAX_VIRTUAL_ALLOCATED_RANGE];
        uint32                  num_kernel_args_ranges;
        addr_range              kernel_args_range[MAX_KERNEL_ARGS_RANGE];
+       uint64                  ignored_physical_memory;
 
        uint32          num_cpus;
        addr_range      cpu_kstack[MAX_BOOT_CPUS];

Modified: haiku/trunk/src/system/boot/platform/bios_ia32/mmu.cpp
===================================================================
--- haiku/trunk/src/system/boot/platform/bios_ia32/mmu.cpp      2010-06-12 
15:11:53 UTC (rev 37115)
+++ haiku/trunk/src/system/boot/platform/bios_ia32/mmu.cpp      2010-06-12 
15:57:21 UTC (rev 37116)
@@ -653,7 +653,8 @@
                        // Type 1 is available memory
                        if (extMemoryBlock[i].type == 1) {
                                uint64 base = extMemoryBlock[i].base_addr;
-                               uint64 end = base + extMemoryBlock[i].length;
+                               uint64 length = extMemoryBlock[i].length;
+                               uint64 end = base + length;
 
                                // round everything up to page boundaries, 
exclusive of pages
                                // it partially occupies
@@ -675,6 +676,9 @@
                                if (base < 0x100000)
                                        base = 0x100000;
 
+                               gKernelArgs.ignored_physical_memory
+                                       += length - (max_c(end, base) - base);
+
                                if (end <= base)
                                        continue;
 
@@ -682,6 +686,9 @@
                                        panic("mmu_init(): Failed to add 
physical memory range "
                                                "%#" B_PRIx64 " - %#" B_PRIx64 
"\n", base, end);
                                }
+                       } else if (extMemoryBlock[i].type == 3) {
+                               // ACPI reclaim -- physical memory we could 
actually use later
+                               gKernelArgs.ignored_physical_memory += 
extMemoryBlock[i].length;
                        }
                }
 


Other related posts:

  • » [haiku-commits] r37116 - in haiku/trunk: headers/private/kernel/boot src/system/boot/platform/bios_ia32 - ingo_weinhold