mirror of
https://github.com/limine-bootloader/limine
synced 2025-01-05 20:34:33 +03:00
pmm: Fix bug where align_entry() would return the wrong error value
This commit is contained in:
parent
9cd21c6a30
commit
af78abb14b
BIN
limine-pxe.bin
BIN
limine-pxe.bin
Binary file not shown.
BIN
limine.bin
BIN
limine.bin
Binary file not shown.
BIN
stage2.map
BIN
stage2.map
Binary file not shown.
@ -47,7 +47,7 @@ void print_memmap(struct e820_entry_t *mm, size_t size) {
|
||||
|
||||
static bool align_entry(uint64_t *base, uint64_t *length) {
|
||||
if (*length < PAGE_SIZE)
|
||||
return -1;
|
||||
return false;
|
||||
|
||||
uint64_t orig_base = *base;
|
||||
|
||||
@ -109,11 +109,8 @@ static void sanitise_entries(bool align_entries) {
|
||||
memmap[i].length = top - base;
|
||||
}
|
||||
|
||||
bool success = true;
|
||||
if (align_entries)
|
||||
success = align_entry(&memmap[i].base, &memmap[i].length);
|
||||
|
||||
if (!memmap[i].length || !success) {
|
||||
if (!memmap[i].length
|
||||
|| (align_entries && !align_entry(&memmap[i].base, &memmap[i].length))) {
|
||||
// Eradicate from memmap
|
||||
for (size_t j = i; j < memmap_entries - 1; j++) {
|
||||
memmap[j] = memmap[j+1];
|
||||
|
Loading…
Reference in New Issue
Block a user