[kernel] Move pml4 create/delete into vm_space

vm_space and page_table continue to take over duties from
page_manager:

- creation and deletion of address spaces / pml4s
- cross-address-space copies for endpoints
- taking over pml4 ownership from process

Also fixed the bug where the wrong process was being set in the cpu
data.

To solve: now the kernel process has its own vm_space which is not
g_kernel_space.
This commit is contained in:
2020-09-18 01:22:49 -07:00
parent ac67111b83
commit 671a0ce0fb
14 changed files with 132 additions and 101 deletions

View File

@@ -58,4 +58,10 @@ namespace memory {
return reinterpret_cast<T*>(a|page_offset);
}
/// Get the number of pages needed for a given number of bytes.
/// \arg bytes The number of bytes desired
/// \returns The number of pages needed to contain the desired bytes
inline size_t page_count(size_t bytes) {
return ((bytes - 1) & (frame_size - 1)) + 1;
}
} // namespace memory