refactor: decouple i386 specific instruction invocation
[lunaix-os.git] / lunaix-os / kernel / exe / exec.c
index 3c4e253249b99c0ba999659b1b09a70f88654c47..8a14c4ad0f8059694430f3cc65b98956f586e6ba 100644 (file)
@@ -220,9 +220,12 @@ __DEFINE_LXSYSCALL3(int,
 
     // we will jump to new entry point (_u_start) upon syscall's
     // return so execve 'will not return' from the perspective of it's invoker
-    volatile struct exec_param* execp = __current->intr_ctx.execp;
-    execp->esp = container.stack_top;
-    execp->eip = container.exe.entry;
+    eret_target(__current) = container.exe.entry;
+    eret_stack(__current) = container.stack_top;
+
+    // these become meaningless once execved!
+    __current->ustack_top = 0;
+    proc_clear_signal(__current);
 
 done:
     // set return value