Use shared_ptr for PageTable
This commit is contained in:
parent
e4afa8e512
commit
96432589bd
10 changed files with 34 additions and 33 deletions
|
@ -52,10 +52,10 @@ std::shared_ptr<Process> KernelSystem::GetCurrentProcess() const {
|
|||
|
||||
void KernelSystem::SetCurrentProcess(std::shared_ptr<Process> process) {
|
||||
current_process = process;
|
||||
SetCurrentMemoryPageTable(&process->vm_manager.page_table);
|
||||
SetCurrentMemoryPageTable(process->vm_manager.page_table);
|
||||
}
|
||||
|
||||
void KernelSystem::SetCurrentMemoryPageTable(Memory::PageTable* page_table) {
|
||||
void KernelSystem::SetCurrentMemoryPageTable(std::shared_ptr<Memory::PageTable> page_table) {
|
||||
memory.SetCurrentPageTable(page_table);
|
||||
if (current_cpu != nullptr) {
|
||||
current_cpu->PageTableChanged(); // notify the CPU the page table in memory has changed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue