[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

@@ -19,8 +19,7 @@ public:
constexpr static size_t stack_size = 0x4000;
/// Constructor.
/// \args pml4 Root of the process' page tables
process(page_table *pml4);
process();
/// Destructor.
virtual ~process();
@@ -35,9 +34,6 @@ public:
/// Update internal bookkeeping about threads.
void update();
/// Get the process' page table root
page_table * pml4() { return m_pml4; }
/// Get the process' virtual memory space
vm_space & space() { return m_space; }
@@ -75,7 +71,6 @@ public:
private:
uint32_t m_return_code;
page_table *m_pml4;
vm_space m_space;
kutil::vector<thread*> m_threads;