PERFORCE change 162189 for review
Ulf Lilleengen
lulf at FreeBSD.org
Sat May 16 22:45:39 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=162189
Change 162189 by lulf at lulf_carrot on 2009/05/16 22:45:22
- First take on sigreturn.
Affected files ...
.. //depot/projects/avr32/src/sys/avr32/avr32/pm_machdep.c#9 edit
Differences ...
==== //depot/projects/avr32/src/sys/avr32/avr32/pm_machdep.c#9 (text+ko) ====
@@ -215,7 +215,35 @@
int
sigreturn(struct thread *td, struct sigreturn_args *uap)
{
- avr32_impl();
- return (0);
+ struct trapframe *tf;
+ struct reg *regs;
+ const ucontext_t *ucp;
+ struct proc *p;
+ ucontext_t uc;
+ int error;
+
+ ucp = &uc;
+ p = td->td_proc;
+
+ error = copyin(uap->sigcntxp, &uc, sizeof(uc));
+ if (error != 0)
+ return (error);
+ tf = td->td_frame;
+ regs = &tf->regs;
+
+ /* Check magic */
+ if (ucp->uc_mcontext.mc_len != sizeof(ucp->uc_mcontext)) {
+ CTR2(KTR_SIG, "sigreturn: pid=%d, ucp %p\n", p->p_pid, ucp);
+ return (EINVAL);
+ }
+ bcopy(&ucp->uc_mcontext.mc_regs, regs,
+ sizeof(ucp->uc_mcontext.mc_regs));
+
+ PROC_LOCK(p);
+ td->td_sigmask = ucp->uc_sigmask;
+ SIG_CANTMASK(td->td_sigmask);
+ signotify(td);
+ PROC_UNLOCK(p);
+ return (EJUSTRETURN);
}
More information about the p4-projects
mailing list