Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Sep 1999 13:47:07 -0700 (PDT)
From:      John Polstra <jdp@polstra.com>
To:        Marcel Moolenaar <marcel@scc.nl>
Cc:        current@FreeBSD.ORG, Nate Williams <nate@mt.sri.com>
Subject:   Re: Now that sigcontext is gone ...
Message-ID:  <XFMail.990930134707.jdp@polstra.com>
In-Reply-To: <37F3C651.EC9305B7@scc.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
Marcel Moolenaar wrote:
> 
> That's right, it's not implemented yet. The work-around is to use
> ucontext. uc_mcontext contains the trapframe which has tf_err
> (uc.uc_mcontext.mc_tf.tf_err).

Thanks.

> I haven't paid any attention to implement any of the fields in siginfo_t
> because that may only have complicated matters. It may be required to do
> some non-trivial rewriting to get all the information at the right
> place. Since real-time signals are also in the pipeline and also may
> have specific needs, both "problems" can best be considered at the same
> time (IMO).

For this particular problem (getting the faulting address) it looks
like it will be easy to fix in "machdep.c:sendsig()".  The correct
value should be in regs->tf_err on the i386.  It's just a matter of
copying that into sf.sf_si.si_addr here (line 677):

        if (SIGISMEMBER(p->p_sigacts->ps_siginfo, sig)) {
                /* Signal handler installed with SA_SIGINFO. */
                sf.sf_siginfo = (register_t)&sfp->sf_si;
                sf.sf_ahu.sf_action = (__siginfohandler_t *)catcher;

                /* fill siginfo structure */
                sf.sf_si.si_signo = sig;
                sf.sf_si.si_code = code;
        }

On the alpha the value should come from frame->tf_regs[FRAME_TRAPARG_A0].
I'll try it when I get time.  (Feel free to beat me to the punch :-).

John
---
  John Polstra                                               jdp@polstra.com
  John D. Polstra & Co., Inc.                        Seattle, Washington USA
  "No matter how cynical I get, I just can't keep up."        -- Nora Ephron



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.990930134707.jdp>