Skip to content

Commit

Permalink
fixup! pmm: simpler and bugfix process_memory_range loop
Browse files Browse the repository at this point in the history
  • Loading branch information
sktt committed Jan 16, 2024
1 parent 8ed80cb commit 8e1bf05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/pmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ static size_t process_memory_range(unsigned index, unsigned first_avail_region)
}

while (cur + PAGE_SIZE <= end) {
unsigned int order = __builtin_ctz(cur) - 12;
unsigned int order = __builtin_ctz(cur) - PAGE_SHIFT;
if (order >= PAGE_ORDER_1G && cur + ORDER_TO_SIZE(PAGE_ORDER_1G) <= end) {
add_frame(paddr_to_mfn(cur), PAGE_ORDER_1G);
cur += ORDER_TO_SIZE(PAGE_ORDER_1G);
Expand Down

0 comments on commit 8e1bf05

Please sign in to comment.