frame: Add Reclaimable memory region to the `max_paddr` filter

This commit is contained in:
Yuke Peng 2025-12-02 10:25:47 +08:00 committed by Junyang Zhang
parent eec3dd0f34
commit 8dced6873e
1 changed files with 6 additions and 1 deletions

View File

@ -458,7 +458,12 @@ pub(crate) unsafe fn init() -> Segment<MetaPageMeta> {
let regions = &crate::boot::EARLY_INFO.get().unwrap().memory_regions;
regions
.iter()
.filter(|r| r.typ() == MemoryRegionType::Usable)
.filter(|r| {
matches!(
r.typ(),
MemoryRegionType::Usable | MemoryRegionType::Reclaimable
)
})
.map(|r| r.base() + r.len())
.max()
.unwrap()