diff options
author | cognet <cognet@FreeBSD.org> | 2004-11-05 23:53:02 +0000 |
---|---|---|
committer | cognet <cognet@FreeBSD.org> | 2004-11-05 23:53:02 +0000 |
commit | 0008c63bf13c49ee25b6411234c9ca0beefd2b32 (patch) | |
tree | 9eff7d57a1a288f8782c38df2e224bc2d179c1f4 /lib/libc/arm/gen/makecontext.c | |
parent | 5ee799d6b4708a9b00d399a19ef36ab7682ef336 (diff) | |
download | FreeBSD-src-0008c63bf13c49ee25b6411234c9ca0beefd2b32.zip FreeBSD-src-0008c63bf13c49ee25b6411234c9ca0beefd2b32.tar.gz |
Fix signalcontext and makecontext.
Diffstat (limited to 'lib/libc/arm/gen/makecontext.c')
-rw-r--r-- | lib/libc/arm/gen/makecontext.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/libc/arm/gen/makecontext.c b/lib/libc/arm/gen/makecontext.c index 18aadf1..4fd3953 100644 --- a/lib/libc/arm/gen/makecontext.c +++ b/lib/libc/arm/gen/makecontext.c @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include <stdarg.h> -extern void _ctx_start(ucontext_t *, int argc, ...); +extern void _ctx_start(void); void ctx_done(ucontext_t *ucp) @@ -72,7 +72,8 @@ __makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) /* Compute and align stack pointer. */ sp = (unsigned int *) - (((uintptr_t)ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size) & ~7); + (((uintptr_t)ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size - + sizeof(double)) & ~7); /* Allocate necessary stack space for arguments exceeding r0-3. */ if (argc > 4) sp -= argc - 4; @@ -80,8 +81,9 @@ __makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) /* Wipe out frame pointer. */ gr[_REG_FP] = 0; /* Arrange for return via the trampoline code. */ - gr[_REG_LR] = (__greg_t)_ctx_start; - gr[_REG_PC] = (__greg_t)func; + gr[_REG_PC] = (__greg_t)_ctx_start; + gr[_REG_R4] = (__greg_t)func; + gr[_REG_R5] = (__greg_t)ucp; va_start(ap, argc); /* Pass up to four arguments in r0-3. */ |