[kernel] Add vm_space::allocate
Refactored out vm_space::handle_fault's allocation code into a separate vm_space::allocate function, and reimplemented handle_fault in terms of the new function.
This commit is contained in:
@@ -79,6 +79,13 @@ public:
|
||||
fetch = 0x10
|
||||
};
|
||||
|
||||
/// Allocate pages into virtual memory. May allocate less than requested.
|
||||
/// \arg virt The virtual address at which to allocate
|
||||
/// \arg count The number of pages to allocate
|
||||
/// \arg phys [out] The physical address of the pages allocated
|
||||
/// \returns The number of pages actually allocated
|
||||
size_t allocate(uintptr_t virt, size_t count, uintptr_t *phys);
|
||||
|
||||
/// Handle a page fault.
|
||||
/// \arg addr Address which caused the fault
|
||||
/// \arg ft Flags from the interrupt about the kind of fault
|
||||
|
||||
Reference in New Issue
Block a user