Kernel/MM: Skip non static reserved memory regions instead of crashing

Crashing seems a bit harsh, so let's just skip them instead, as they
actually show up in the device tree of RPis.
This commit is contained in:
Hendiadyoin1 2024-03-03 13:55:52 +01:00 committed by Andrew Kaster
parent e014296092
commit 2b13769dd5

View file

@ -458,6 +458,12 @@ UNMAP_AFTER_INIT void MemoryManager::parse_memory_map_fdt(MemoryManager::GlobalD
break;
case State::InReservedMemoryChild:
// FIXME: Handle non static allocations,
if (!state.start.has_value()) {
VERIFY(state.size.has_value());
dbgln("MM: Non static reserved memory range {} of size {:#x}, skipping for now", node_name, state.size.value());
state.state = State::InReservedMemory;
break;
}
VERIFY(state.start.has_value() && state.size.has_value());
dbgln("MM: Reserved Range {}: address: {} size {:#x}", node_name, PhysicalAddress { state.start.value() }, state.size.value());
global_data.physical_memory_ranges.append(PhysicalMemoryRange { PhysicalMemoryRangeType::Reserved, PhysicalAddress { state.start.value() }, state.size.value() });