diff options
author | davidxu <davidxu@FreeBSD.org> | 2004-07-02 14:19:44 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2004-07-02 14:19:44 +0000 |
commit | e4bfd018649abae34a0fbb4e0980aedc2fd607ff (patch) | |
tree | 15b4196989753942891f1493373b6a590ac1026f /lib/libc | |
parent | d4df3eec3445105c292c94f1228a30c2f975cdaf (diff) | |
download | FreeBSD-src-e4bfd018649abae34a0fbb4e0980aedc2fd607ff.zip FreeBSD-src-e4bfd018649abae34a0fbb4e0980aedc2fd607ff.tar.gz |
Use %esi to store next ucp pointer. Mark end of stack by
setting %ebp to zero, this avoids new gdb to dump a weird
backtrace.
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/i386/gen/_ctx_start.S | 2 | ||||
-rw-r--r-- | lib/libc/i386/gen/makecontext.c | 5 |
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; } |