better panic
This commit is contained in:
@@ -66,7 +66,10 @@ static uintptr_t g_freelist = 0;
|
||||
|
||||
uintptr_t pmm_alloc()
|
||||
{
|
||||
if (!g_freelist) return 0;
|
||||
if (!g_freelist)
|
||||
{
|
||||
panic(NULL, "PMM is out of memory!");
|
||||
}
|
||||
uintptr_t addr = g_freelist;
|
||||
g_freelist = *(uintptr_t*) PHYS_TO_VIRT(g_freelist);
|
||||
return addr;
|
||||
@@ -104,4 +107,4 @@ void pmm_init(struct limine_memmap_response* memmap, struct limine_hhdm_response
|
||||
// Now we have biggest USABLE region,
|
||||
// so to populate the free list we just iterate through it
|
||||
pmm_init_freelist();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user