From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8975 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] Separate siginfo_t for MIPS Date: Thu, 10 Dec 2015 13:36:33 +0100 Message-ID: <20151210123633.GD23362@port70.net> References: <20151210124712.3b4b811fd0d99a5b482b4ee3@ubnt.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1449751009 12436 80.91.229.3 (10 Dec 2015 12:36:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 10 Dec 2015 12:36:49 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8988-gllmg-musl=m.gmane.org@lists.openwall.com Thu Dec 10 13:36:49 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1a70Sl-0008Kd-KG for gllmg-musl@m.gmane.org; Thu, 10 Dec 2015 13:36:47 +0100 Original-Received: (qmail 26504 invoked by uid 550); 10 Dec 2015 12:36:45 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 26486 invoked from network); 10 Dec 2015 12:36:45 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: <20151210124712.3b4b811fd0d99a5b482b4ee3@ubnt.com> User-Agent: Mutt/1.5.24 (2015-08-30) Xref: news.gmane.org gmane.linux.lib.musl.general:8975 Archived-At: * Dmitry Ivanov [2015-12-10 12:47:12 +0200]: > MIPS has non-default siginfo_t structure. Also, some si_code values are > different. This patch is required for POSIX timers to work. > > --- > arch/aarch64/bits/siginfo.h | 0 > arch/arm/bits/siginfo.h | 0 > arch/i386/bits/siginfo.h | 0 > arch/microblaze/bits/siginfo.h | 0 > arch/mips/bits/siginfo.h | 52 ++++++++++++++++++++++++++++++++++++++++++ > arch/or1k/bits/siginfo.h | 0 > arch/powerpc/bits/siginfo.h | 0 > arch/sh/bits/siginfo.h | 0 > arch/x32/bits/siginfo.h | 0 > arch/x86_64/bits/siginfo.h | 0 > include/signal.h | 7 ++++++ > 11 files changed, 59 insertions(+) > create mode 100644 arch/aarch64/bits/siginfo.h > create mode 100644 arch/arm/bits/siginfo.h > create mode 100644 arch/i386/bits/siginfo.h > create mode 100644 arch/microblaze/bits/siginfo.h > create mode 100644 arch/mips/bits/siginfo.h > create mode 100644 arch/or1k/bits/siginfo.h > create mode 100644 arch/powerpc/bits/siginfo.h > create mode 100644 arch/sh/bits/siginfo.h > create mode 100644 arch/x32/bits/siginfo.h > create mode 100644 arch/x86_64/bits/siginfo.h > > diff --git a/arch/aarch64/bits/siginfo.h b/arch/aarch64/bits/siginfo.h > new file mode 100644 > index 0000000..e69de29 > diff --git a/arch/arm/bits/siginfo.h b/arch/arm/bits/siginfo.h > new file mode 100644 > index 0000000..e69de29 > diff --git a/arch/i386/bits/siginfo.h b/arch/i386/bits/siginfo.h > new file mode 100644 > index 0000000..e69de29 > diff --git a/arch/microblaze/bits/siginfo.h b/arch/microblaze/bits/siginfo.h > new file mode 100644 > index 0000000..e69de29 > diff --git a/arch/mips/bits/siginfo.h b/arch/mips/bits/siginfo.h > new file mode 100644 > index 0000000..42dbdf5 > --- /dev/null > +++ b/arch/mips/bits/siginfo.h > @@ -0,0 +1,52 @@ > +#define HAVE_ARCH_SIGINFO_T > + HAVE_... is not in the reserved namespace of the implementation > +#undef SI_ASYNCIO > +#undef SI_TIMER > +#undef SI_MESGQ > +#define SI_ASYNCIO -2 /* sent by AIO completion */ > +#define SI_TIMER -3 /* sent by timer expiration */ > +#define SI_MESGQ -4 /* sent by real time mesq state change */ > + negative numbers must be parethesized. and musl doesn't use such comments in public headers (they might be copyrightable). > +/* We can't use generic siginfo_t, because our si_code and si_errno are swapped */ > +typedef struct { > + int si_signo, si_code, si_errno; is this reordering the only change? (other than the SI_ macros) the ifdef and empty siginfo.h files are not nice, there are some plans to change bits/* to make this kind of arch specific changes less painful. until then i think it's enough to fix it in signal.h with some dirty ifdef around these members. > + union { > + char __pad[128 - 2*sizeof(int) - sizeof(long)]; > + struct { > + union { > + struct { > + pid_t si_pid; > + uid_t si_uid; > + } __piduid; > + struct { > + int si_timerid; > + int si_overrun; > + } __timer; > + } __first; > + union { > + union sigval si_value; > + struct { > + int si_status; > + clock_t si_utime, si_stime; > + } __sigchld; > + } __second; > + } __si_common; > + struct { > + void *si_addr; > + short si_addr_lsb; > + struct { > + void *si_lower; > + void *si_upper; > + } __addr_bnd; > + } __sigfault; > + struct { > + long si_band; > + int si_fd; > + } __sigpoll; > + struct { > + void *si_call_addr; > + int si_syscall; > + unsigned si_arch; > + } __sigsys; > + } __si_fields; > +} siginfo_t; > diff --git a/arch/or1k/bits/siginfo.h b/arch/or1k/bits/siginfo.h > new file mode 100644 > index 0000000..e69de29 > diff --git a/arch/powerpc/bits/siginfo.h b/arch/powerpc/bits/siginfo.h > new file mode 100644 > index 0000000..e69de29 > diff --git a/arch/sh/bits/siginfo.h b/arch/sh/bits/siginfo.h > new file mode 100644 > index 0000000..e69de29 > diff --git a/arch/x32/bits/siginfo.h b/arch/x32/bits/siginfo.h > new file mode 100644 > index 0000000..e69de29 > diff --git a/arch/x86_64/bits/siginfo.h b/arch/x86_64/bits/siginfo.h > new file mode 100644 > index 0000000..e69de29 > diff --git a/include/signal.h b/include/signal.h > index 559362f..087657b 100644 > --- a/include/signal.h > +++ b/include/signal.h > @@ -85,6 +85,11 @@ union sigval { > void *sival_ptr; > }; > > +#undef HAVE_ARCH_SIGINFO_T > + > +#include > + > +#ifndef HAVE_ARCH_SIGINFO_T > typedef struct { > int si_signo, si_errno, si_code; > union { > @@ -127,6 +132,8 @@ typedef struct { > } __sigsys; > } __si_fields; > } siginfo_t; > +#endif > +