From owner-freebsd-arch@FreeBSD.ORG Thu Oct 13 17:55:02 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 21EA216A41F; Thu, 13 Oct 2005 17:55:02 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id BC98043D45; Thu, 13 Oct 2005 17:55:01 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id j9DHswFQ029799; Thu, 13 Oct 2005 10:54:58 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id j9DHsvaK029797; Thu, 13 Oct 2005 10:54:57 -0700 Date: Thu, 13 Oct 2005 10:54:57 -0700 From: Brooks Davis To: John Baldwin Message-ID: <20051013175457.GA27418@odin.ac.hmc.edu> References: <434DD327.7090200@126.com> <200510131031.53753.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zhXaljGHf11kAtnf" Content-Disposition: inline In-Reply-To: <200510131031.53753.jhb@freebsd.org> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu Cc: David Xu , freebsd-arch@freebsd.org Subject: Re: POSIX siginfo X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2005 17:55:02 -0000 --zhXaljGHf11kAtnf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 13, 2005 at 10:31:50AM -0400, John Baldwin wrote: > On Wednesday 12 October 2005 11:23 pm, David Xu wrote: > > I am trying to implement POSIX sigqueue, while staring some code > > in machdep.c and trap.c, I found our si_code for siginfo structure > > is not in POSIX standard, all are machine dependent magical values > > pushed by CPU. POSIX lists all these standard codes: > > > > http://www.opengroup.org/onlinepubs/009695399/basedefs/signal.h.html > > > > /* codes for SIGILL */ > > ILL_ILLOPC > > ILL_ILLOPN > > ILL_ILLADR > > ILL_ILLTRP > > ILL_PRVOPC > > ILL_PRVREG > > ILL_COPROC > > ILL_BADSTK > > > > /* codes for SIGBUS */ > > BUS_ADRALN > > BUS_ADRERR > > BUS_OBJERR > > BUS_RESERVED > > > > /* codes for SIGSEGV */ > > SEGV_MAPERR > > SEGV_ACCERR > > > > /* codes for SIGFPE */ > > FPE_INTOVF 1 > > FPE_INTDIV 2 > > FPE_FLTDIV 3 > > FPE_FLTOVF 4 > > FPE_FLTUND 5 > > FPE_FLTRES 6 > > FPE_FLTINV 7 > > FPE_FLTSUB 8 > > > > /* codes for SIGTRAP */ > > TRAP_BRKPT > > TRAP_TRACE > > > > ... > > > > Note that, NetBSD and Linux had already used the POSIX codes, should we > > use them too? >=20 > Hmm, looks like we do use these values in some cases on i386 at least for= =20 > SIGFPE and possibly SIGBUS. I think you should fix all the archs to use= =20 > these codes. I would even go ahead and commit that on its own before the= =20 > POSIX sigqueue stuff. I agree. I ran into our lack of many of these just yesterday when working on porting Open MPI[0]. I've got patches that make us compile there that will be needed for the foreseeable future, but to be blunt the current status of si_code support is really lame. We don't even have a list of values we do return other then some vague allusions to values SI_ and FPE_ in sigaction(2). It would be nice if we could at least define the values POSIX says we should define and either implement them or document what we do implement. -- Brooks [0] Of course what Open MPI is doing with the values is utterly evil since it calls all sorts of non-signal safe functions in the signal handler, but that's another story. --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --zhXaljGHf11kAtnf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFDTp9xXY6L6fI4GtQRAnjyAJ0VR6oDy03ZdsPto2erOqKp5BcvTwCfbfrU NeGUbqV7RAktO169pyGNeyg= =KuIS -----END PGP SIGNATURE----- --zhXaljGHf11kAtnf--