Date: Sat, 16 May 2009 22:45:37 GMT From: Ulf Lilleengen <lulf@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 162189 for review Message-ID: <200905162245.n4GMjblc095171@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=162189 Change 162189 by lulf@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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905162245.n4GMjblc095171>