Skip to content

Commit

Permalink
x86/limine: make platform_info->max_pfn more accurate
Browse files Browse the repository at this point in the history
  • Loading branch information
moodyhunter committed Jan 23, 2024
1 parent 076b6f5 commit c70c93e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 2 additions & 1 deletion arch/x86_64/boot/limine/limine_entry.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ static void add_to_memmap(pfn_t start, size_t npages, bool reserved, u32 type, c
entry->type = type;
pr_dinfo2(x86_startup, "%25s: " PFNADDR_RANGE " (%zu pages)", typestr, PFNADDR(entry->pfn_start, entry->pfn_start + entry->nframes), entry->nframes);

if (!entry->reserved)
if (entry->type == LIMINE_MEMMAP_USABLE || entry->type == LIMINE_MEMMAP_KERNEL_AND_MODULES || entry->type == LIMINE_MEMMAP_FRAMEBUFFER ||
entry->type == LIMINE_MEMMAP_BOOTLOADER_RECLAIMABLE || entry->type == LIMINE_MEMMAP_ACPI_RECLAIMABLE || entry->type == LIMINE_MEMMAP_ACPI_NVS)
platform_info->max_pfn = MAX(platform_info->max_pfn, entry->pfn_start + entry->nframes);
}

Expand Down
3 changes: 0 additions & 3 deletions arch/x86_64/x86_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,6 @@ void platform_startup_mm()

pmm_reserve_frames(X86_BIOS_MEMREGION_PADDR / MOS_PAGE_SIZE, BIOS_MEMREGION_SIZE / MOS_PAGE_SIZE);
pmm_reserve_frames(X86_EBDA_MEMREGION_PADDR / MOS_PAGE_SIZE, EBDA_MEMREGION_SIZE / MOS_PAGE_SIZE);

if (platform_info->initrd_npages)
pmm_reserve_frames(platform_info->initrd_pfn, platform_info->initrd_npages);
}

void platform_startup_late()
Expand Down

0 comments on commit c70c93e

Please sign in to comment.