kernel: Let the kernel handle all page table changes when switching processes
It will both change the page table in memory and notify the CPU about the change by itself. This way there is no need to call memory.SetCurrentPageTable() when kernel.setCurrentProcess() and the management is kept internally in the kernel
This commit is contained in:
parent
ac9755306c
commit
dbfd830695
6 changed files with 25 additions and 11 deletions
|
@ -112,9 +112,6 @@ void ThreadManager::SwitchContext(Thread* new_thread) {
|
|||
|
||||
if (previous_process.get() != current_thread->owner_process) {
|
||||
kernel.SetCurrentProcess(SharedFrom(current_thread->owner_process));
|
||||
kernel.memory.SetCurrentPageTable(
|
||||
¤t_thread->owner_process->vm_manager.page_table);
|
||||
cpu->PageTableChanged(); // notify the CPU the page table in memory has changed
|
||||
}
|
||||
|
||||
cpu->LoadContext(new_thread->context);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue