summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libc/i386/gen/_ctx_start.S2
-rw-r--r--lib/libc/i386/gen/makecontext.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/i386/gen/_ctx_start.S b/lib/libc/i386/gen/_ctx_start.S
index bfff53a..91a06b8 100644
--- a/lib/libc/i386/gen/_ctx_start.S
+++ b/lib/libc/i386/gen/_ctx_start.S
@@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$");
ENTRY(_ctx_start)
popl %eax /* get start function */
call *%eax /* call start function */
- movl %ebp, %esp /*
+ movl %esi, %esp /*
* setup stack for completion routine;
* ucp is now at top of stack
*/
diff --git a/lib/libc/i386/gen/makecontext.c b/lib/libc/i386/gen/makecontext.c
index a6fc6ad..1154459 100644
--- a/lib/libc/i386/gen/makecontext.c
+++ b/lib/libc/i386/gen/makecontext.c
@@ -150,10 +150,11 @@ __makecontext(ucontext_t *ucp, void (*start)(void), int argc, ...)
* wrapper. Note that setcontext() pushes the return
* address onto the top of the stack, so allow for this
* by adjusting the stack downward 1 slot. Also set
- * %ebp to point to the base of the stack where ucp
+ * %esi to point to the base of the stack where ucp
* is stored.
*/
- ucp->uc_mcontext.mc_ebp = (int)argp;
+ ucp->uc_mcontext.mc_esi = (int)argp;
+ ucp->uc_mcontext.mc_ebp = 0;
ucp->uc_mcontext.mc_esp = (int)stack_top + sizeof(caddr_t);
ucp->uc_mcontext.mc_eip = (int)_ctx_start;
}
OpenPOWER on IntegriCloud