Skip to content

Commit

Permalink
Merge pull request managarm#577 from Dennisbonke/mb2
Browse files Browse the repository at this point in the history
eir/mb2: Don't loop over the memory map twice
  • Loading branch information
qookei authored Oct 17, 2023
2 parents 4beda35 + 5058f75 commit 50477d0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions kernel/eir/arch/x86/multiboot2/multiboot2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,10 @@ extern "C" void eirMultiboot2Main(uint32_t info, uint32_t magic){
eir::infoLogger() << " Type " << map->type << " mapping."
<< " Base: 0x" << frg::hex_fmt{map->base}
<< ", length: 0x" << frg::hex_fmt{map->length} << frg::endlog;
}

for(Mb2MmapEntry* map = (Mb2MmapEntry*)mmap_start; map < (Mb2MmapEntry*)mmap_end; map++) {
if(map->type == 1)
createInitialRegions({map->base, map->length}, {reservedRegions, nReservedRegions});
}

setupRegionStructs();

eir::infoLogger() << "Kernel memory regions:" << frg::endlog;
Expand Down

0 comments on commit 50477d0

Please sign in to comment.