Kernel: Add pointer validation API to page table

This commit is contained in:
Bananymous
2023-09-18 21:37:37 +03:00
parent 3a9c6fc51a
commit bc1087f5a7
2 changed files with 10 additions and 1 deletions

View File

@@ -110,6 +110,13 @@ namespace Kernel
return *s_current;
}
bool PageTable::is_valid_pointer(uintptr_t pointer)
{
if (!is_canonical(pointer))
return false;
return true;
}
static uint64_t* allocate_zeroed_page_aligned_page()
{
void* page = kmalloc(PAGE_SIZE, PAGE_SIZE, true);