Fix page directory not getting switched on switch to user process

This commit is contained in:
Mark
2020-07-24 10:26:32 +03:00
parent 0f0f37ee39
commit 0ee4ab17fa
+2
View File
@@ -234,6 +234,8 @@ int sys_execve(const char *path, const char **argv, const char **envp) {
_assert(thr->data.fxsave);
thr->data.cr3 = MM_PHYS(proc->space);
// Switch CR3 to the newly allocated space!
asm volatile ("movq %0, %%rax; movq %%rax, %%cr3"::"a"(thr->data.cr3));
asm volatile ("sti");
} else {
mm_space_release(proc);