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/signalcontext.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/signalcontext.c')
-rw-r--r-- | lib/libc/arm/gen/signalcontext.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/libc/arm/gen/signalcontext.c b/lib/libc/arm/gen/signalcontext.c index 35108fd..bb9a54d 100644 --- a/lib/libc/arm/gen/signalcontext.c +++ b/lib/libc/arm/gen/signalcontext.c @@ -51,11 +51,8 @@ __signalcontext(ucontext_t *ucp, int sig, __sighandler_t *func) struct sigframe *sfp; __greg_t *gr = ucp->uc_mcontext.__gregs; unsigned int *sp; - mcontext_t *mc; - mc = &ucp->uc_mcontext; - sp = (unsigned int *) - (((uintptr_t)ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size) & ~7); + sp = (unsigned int *)gr[_REG_SP]; sfp = (struct sigframe *)sp - 1; @@ -63,13 +60,16 @@ __signalcontext(ucontext_t *ucp, int sig, __sighandler_t *func) bcopy(ucp, &sfp->sf_uc, sizeof(*ucp)); sfp->sf_si.si_signo = sig; - gr[_REG_SP] = (__greg_t)sp; + gr[_REG_SP] = (__greg_t)sfp; /* 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_R0] = (__greg_t)ucp; + gr[_REG_PC] = (__greg_t)_ctx_start; + gr[_REG_R4] = (__greg_t)func; + gr[_REG_R5] = (__greg_t)ucp; + gr[_REG_R0] = (__greg_t)sig; + gr[_REG_R1] = (__greg_t)&sfp->sf_si; + gr[_REG_R2] = (__greg_t)&sfp->sf_uc; ucp->uc_link = &sfp->sf_uc; sigdelset(&ucp->uc_sigmask, sig); |