x86_64: check for failure in alloc test
This commit is contained in:
@@ -59,10 +59,13 @@ int ml_init(uintptr_t arg)
|
|||||||
|
|
||||||
/* test allocation */
|
/* test allocation */
|
||||||
vm_page_t *p = vm_page_alloc(VM_PAGE_16K, 0);
|
vm_page_t *p = vm_page_alloc(VM_PAGE_16K, 0);
|
||||||
void *p_ptr = vm_page_get_vaddr(p);
|
if (p) {
|
||||||
memset(p_ptr, 0x00, vm_page_order_to_bytes(VM_PAGE_16K));
|
void *p_ptr = vm_page_get_vaddr(p);
|
||||||
|
|
||||||
printk("allocated 16K at %p", p_ptr);
|
printk("allocated 16K at %p", p_ptr);
|
||||||
|
} else {
|
||||||
|
printk("alloc failed");
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user