x86 mmu_init(): Sum up the physical memory we ignore for whatever reason --

stored in kernel_args::ignored_physical_memory.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37116 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2010-06-12 15:57:21 +00:00
parent 61d2b06c40
commit 84e9db7fb7
2 changed files with 9 additions and 1 deletions

View File

@ -54,6 +54,7 @@ typedef struct kernel_args {
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];

View File

@ -653,7 +653,8 @@ mmu_init(void)
// 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 @@ mmu_init(void)
if (base < 0x100000)
base = 0x100000;
gKernelArgs.ignored_physical_memory
+= length - (max_c(end, base) - base);
if (end <= base)
continue;
@ -682,6 +686,9 @@ mmu_init(void)
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;
}
}