ia32, boot: Create device frames for unused RAM

The ia32 kernel is supposed to pass through type 1 memory that is
outside of the kernel window as device untyped. In a previous refactor
this memory stopped getting created as untypeds. This behaviour is fixed
by pre-clamping the memory before being given to the free region list.
This commit is contained in:
Kent McLeod
2019-10-08 11:17:02 +11:00
parent d09914aaa2
commit 0f1f56d4ad

View File

@@ -210,6 +210,11 @@ static BOOT_CODE bool_t add_mem_p_regs(p_region_t reg)
printf("Dropping memory region 0x%lx-0x%lx, try increasing MAX_NUM_FREEMEM_REG\n", reg.start, reg.end);
return false;
}
if (reg.end > PADDR_TOP) {
assert(reg.start <= PADDR_TOP);
/* Clamp a region to the top of the kernel window if it extends beyond */
reg.end = PADDR_TOP;
}
printf("Adding physical memory region 0x%lx-0x%lx\n", reg.start, reg.end);
boot_state.mem_p_regs.list[boot_state.mem_p_regs.count] = reg;
boot_state.mem_p_regs.count++;