mirror of https://github.com/wolfSSL/wolfBoot.git
x86: paging: add end of reserved memory check
if users call the mapping function without specifying a physical page to use, then the function uses a page from a reserved pool. Check that we don't finish them.pull/365/head
parent
e95dad8dfe
commit
ce90b3b7dc
|
@ -197,6 +197,10 @@ static void x86_paging_map_page(uint64_t vaddress, uint64_t paddress)
|
|||
if (paddress == 0) {
|
||||
paddress = (uint64_t)mem;
|
||||
mem += PAGE_TABLE_PAGE_SIZE;
|
||||
if (mem >= _mem + MEM_SIZE) {
|
||||
wolfBoot_printf("No more pages to satisfy virtual allocation");
|
||||
panic();
|
||||
}
|
||||
}
|
||||
x86_paging_setup_entry(pl1e, paddress);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue