1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09:00

Prekernel: Don't wrap around the PTE index improperly

The boot_pd0_pts variable contains more than 512 PTEs so we shouldn't
wrap the index here.
This commit is contained in:
Gunnar Beutner 2021-07-20 12:14:37 +02:00 committed by Andreas Kling
parent d29981e4a1
commit 05fc75f994
Notes: sideshowbarker 2024-07-18 08:41:22 +09:00

View file

@ -177,7 +177,7 @@ extern "C" [[noreturn]] void init()
// unmap the end_of_prekernel_image - MAX_KERNEL_SIZE region
for (FlatPtr vaddr = (FlatPtr)end_of_prekernel_image; vaddr < MAX_KERNEL_SIZE; vaddr += PAGE_SIZE)
boot_pd0_pts[vaddr >> 12 & 0x1ff] = 0;
boot_pd0_pts[vaddr >> 12] = 0;
void (*entry)(BootInfo const&) = (void (*)(BootInfo const&))kernel_elf_header.e_entry;
entry(*adjust_by_load_base(&info));