vmm: change how vmm_destroycontext is handled

This commit is contained in:
Matheus
2023-06-10 12:07:52 -03:00
parent 5ac1745b5f
commit f2b76caa84
4 changed files with 20 additions and 18 deletions
+2 -3
View File
@@ -123,7 +123,7 @@ syscallret_t syscall_execve(context_t *context, char *upath, char *uargv[], char
if (vmmctx && ret.errno) {
vmm_switchcontext(oldctx);
vmm_destroycontext(vmmctx, 0);
vmm_destroycontext(vmmctx);
}
if (refnode)
@@ -136,8 +136,7 @@ syscallret_t syscall_execve(context_t *context, char *upath, char *uargv[], char
free(interp);
if (ret.errno == 0) {
// TODO sync mmap files (unmap all lower memory first before destroying context?)
vmm_destroycontext(oldctx, 0);
vmm_destroycontext(oldctx);
CTX_SP(context) = (uint64_t)stack;
CTX_IP(context) = (uint64_t)entry;
}