summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2012-03-06 08:10:48 +0000
committerjmallett <jmallett@FreeBSD.org>2012-03-06 08:10:48 +0000
commita0eb1ecb3c3352ad1798dd22f4189f5b8c3a477d (patch)
tree3c1b5b2a86635d3e6770bffa13bf6e5612b80369
parentefb612d7ca2cb924c2fcb6796c8a0cc480d765c0 (diff)
downloadFreeBSD-src-a0eb1ecb3c3352ad1798dd22f4189f5b8c3a477d.zip
FreeBSD-src-a0eb1ecb3c3352ad1798dd22f4189f5b8c3a477d.tar.gz
Make the native sigreturn just wrap set_mcontext, much as freebsd32_sigreturn
does.
-rw-r--r--sys/mips/mips/pm_machdep.c39
1 files changed, 5 insertions, 34 deletions
diff --git a/sys/mips/mips/pm_machdep.c b/sys/mips/mips/pm_machdep.c
index b709284..5c6205d 100644
--- a/sys/mips/mips/pm_machdep.c
+++ b/sys/mips/mips/pm_machdep.c
@@ -216,51 +216,22 @@ cpu_thread_siginfo(int sig, u_long code, siginfo_t *si)
int
sys_sigreturn(struct thread *td, struct sigreturn_args *uap)
{
- struct trapframe *regs;
- ucontext_t *ucp;
ucontext_t uc;
int error;
- ucp = &uc;
-
error = copyin(uap->sigcntxp, &uc, sizeof(uc));
if (error != 0)
return (error);
- regs = td->td_frame;
-
-/* #ifdef DEBUG */
- if (ucp->uc_mcontext.mc_regs[ZERO] != UCONTEXT_MAGIC) {
- printf("sigreturn: pid %d, ucp %p\n", td->td_proc->p_pid, ucp);
- printf(" old sp %p ra %p pc %p\n",
- (void *)(intptr_t)regs->sp, (void *)(intptr_t)regs->ra, (void *)(intptr_t)regs->pc);
- printf(" new sp %p ra %p pc %p z %p\n",
- (void *)(intptr_t)ucp->uc_mcontext.mc_regs[SP],
- (void *)(intptr_t)ucp->uc_mcontext.mc_regs[RA],
- (void *)(intptr_t)ucp->uc_mcontext.mc_regs[PC],
- (void *)(intptr_t)ucp->uc_mcontext.mc_regs[ZERO]);
- return EINVAL;
- }
-/* #endif */
-
- bcopy((const void *)&ucp->uc_mcontext.mc_regs[1], (void *)&regs->ast,
- sizeof(ucp->uc_mcontext.mc_regs) - sizeof(register_t));
-
- if (ucp->uc_mcontext.mc_fpused)
- bcopy((const void *)ucp->uc_mcontext.mc_fpregs,
- (void *)&td->td_frame->f0,
- sizeof(ucp->uc_mcontext.mc_fpregs));
-
- regs->pc = ucp->uc_mcontext.mc_pc;
- regs->mullo = ucp->uc_mcontext.mullo;
- regs->mulhi = ucp->uc_mcontext.mulhi;
+ error = set_mcontext(td, &uc.uc_mcontext);
+ if (error != 0)
+ return (error);
- kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0);
+ kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0);
- return(EJUSTRETURN);
+ return (EJUSTRETURN);
}
-
int
ptrace_set_pc(struct thread *td, unsigned long addr)
{
OpenPOWER on IntegriCloud