pmm: Increase the max size of the memory map
This commit is contained in:
parent
86780fc776
commit
5217f50bbd
|
@ -182,7 +182,7 @@ bool efi_exit_boot_services(void) {
|
|||
// Go through new EFI memmap and free up bootloader entries
|
||||
size_t entry_count = efi_mmap_size / efi_desc_size;
|
||||
|
||||
EFI_MEMORY_DESCRIPTOR *efi_copy = ext_mem_alloc(256 * efi_desc_size);
|
||||
EFI_MEMORY_DESCRIPTOR *efi_copy = ext_mem_alloc(MEMMAP_MAX_ENTRIES * efi_desc_size);
|
||||
size_t efi_copy_i = 0;
|
||||
|
||||
for (size_t i = 0; i < entry_count; i++) {
|
||||
|
@ -205,7 +205,7 @@ bool efi_exit_boot_services(void) {
|
|||
new_entry->NumberOfPages = (untouched_memmap[j].base - base) / 4096;
|
||||
|
||||
efi_copy_i++;
|
||||
if (efi_copy_i == 256) {
|
||||
if (efi_copy_i == MEMMAP_MAX_ENTRIES) {
|
||||
panic("efi: New memory map exhausted");
|
||||
}
|
||||
new_entry = (void *)efi_copy + efi_copy_i * efi_desc_size;
|
||||
|
@ -234,7 +234,7 @@ bool efi_exit_boot_services(void) {
|
|||
new_entry->NumberOfPages = untouched_memmap[j].length / 4096;
|
||||
|
||||
efi_copy_i++;
|
||||
if (efi_copy_i == 256) {
|
||||
if (efi_copy_i == MEMMAP_MAX_ENTRIES) {
|
||||
panic("efi: New memory map exhausted");
|
||||
}
|
||||
new_entry = (void *)efi_copy + efi_copy_i * efi_desc_size;
|
||||
|
@ -249,7 +249,7 @@ bool efi_exit_boot_services(void) {
|
|||
}
|
||||
|
||||
efi_copy_i++;
|
||||
if (efi_copy_i == 256) {
|
||||
if (efi_copy_i == MEMMAP_MAX_ENTRIES) {
|
||||
panic("efi: New memory map exhausted");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
#include <stdbool.h>
|
||||
#include <sys/e820.h>
|
||||
|
||||
#define MEMMAP_MAX_ENTRIES 1024
|
||||
|
||||
#define MEMMAP_USABLE 1
|
||||
#define MEMMAP_RESERVED 2
|
||||
#define MEMMAP_ACPI_RECLAIMABLE 3
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#endif
|
||||
|
||||
#define PAGE_SIZE 4096
|
||||
#define MEMMAP_MAX_ENTRIES 384
|
||||
|
||||
#if bios == 1
|
||||
extern symbol bss_end;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include <lib/print.h>
|
||||
#include <mm/pmm.h>
|
||||
|
||||
#define MAX_E820_ENTRIES 256
|
||||
#define MAX_E820_ENTRIES 512
|
||||
|
||||
struct e820_entry_t e820_map[MAX_E820_ENTRIES];
|
||||
size_t e820_entries = 0;
|
||||
|
|
Loading…
Reference in New Issue