From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14867 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] remaining steps for time64 switchover Date: Sun, 27 Oct 2019 00:15:24 -0400 Message-ID: <20191027041524.GW16318@brightrain.aerifal.cx> References: <20191021024643.GA6192@brightrain.aerifal.cx> <20191021124335.GH16318@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="33183"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-14883-gllmg-musl=m.gmane.org@lists.openwall.com Sun Oct 27 05:15:39 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1iOZxr-0008WF-Bg for gllmg-musl@m.gmane.org; Sun, 27 Oct 2019 05:15:39 +0100 Original-Received: (qmail 9899 invoked by uid 550); 27 Oct 2019 04:15:37 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 9877 invoked from network); 27 Oct 2019 04:15:36 -0000 Content-Disposition: inline In-Reply-To: <20191021124335.GH16318@brightrain.aerifal.cx> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:14867 Archived-At: On Mon, Oct 21, 2019 at 08:43:35AM -0400, Rich Felker wrote: > On Sun, Oct 20, 2019 at 10:46:43PM -0400, Rich Felker wrote: > > >From 31aae539d35550a3db0641f25d16968ed6a0702c Mon Sep 17 00:00:00 2001 > > From: Rich Felker > > Date: Sun, 20 Oct 2019 19:24:53 -0400 > > Subject: [PATCH 17/17] switch powerpc to 64-bit time_t > > > > --- > > arch/powerpc/arch.mak | 1 + > > arch/powerpc/bits/alltypes.h.in | 5 +++-- > > arch/powerpc/bits/ipcstat.h | 2 +- > > arch/powerpc/bits/msg.h | 15 +++++++++------ > > arch/powerpc/bits/sem.h | 10 ++++++---- > > arch/powerpc/bits/shm.h | 16 +++++++++------- > > arch/powerpc/bits/stat.h | 6 +++++- > > 7 files changed, 34 insertions(+), 21 deletions(-) > > create mode 100644 arch/powerpc/arch.mak > > > > diff --git a/arch/powerpc/arch.mak b/arch/powerpc/arch.mak > > new file mode 100644 > > index 00000000..aa4d05ce > > --- /dev/null > > +++ b/arch/powerpc/arch.mak > > @@ -0,0 +1 @@ > > +COMPAT_SRC_DIRS = compat/time32 > > diff --git a/arch/powerpc/bits/alltypes.h.in b/arch/powerpc/bits/alltypes.h.in > > index fd0c816c..8e003545 100644 > > --- a/arch/powerpc/bits/alltypes.h.in > > +++ b/arch/powerpc/bits/alltypes.h.in > > @@ -1,3 +1,4 @@ > > +#define _REDIR_TIME64 1 > > #define _Addr int > > #define _Int64 long long > > #define _Reg int > > @@ -18,5 +19,5 @@ TYPEDEF double double_t; > > > > TYPEDEF struct { long long __ll; long double __ld; } max_align_t; > > > > -TYPEDEF long time_t; > > -TYPEDEF long suseconds_t; > > +TYPEDEF long long time_t; > > +TYPEDEF long long suseconds_t; > > diff --git a/arch/powerpc/bits/ipcstat.h b/arch/powerpc/bits/ipcstat.h > > index 0018ad1e..4f4fcb0c 100644 > > --- a/arch/powerpc/bits/ipcstat.h > > +++ b/arch/powerpc/bits/ipcstat.h > > @@ -1 +1 @@ > > -#define IPC_STAT 2 > > +#define IPC_STAT 0x102 > > This could actually be dropped for powerpc... > > > diff --git a/arch/powerpc/bits/msg.h b/arch/powerpc/bits/msg.h > > index 171c11a3..9fb15dcc 100644 > > --- a/arch/powerpc/bits/msg.h > > +++ b/arch/powerpc/bits/msg.h > > @@ -1,15 +1,18 @@ > > struct msqid_ds { > > struct ipc_perm msg_perm; > > - int __unused1; > > - time_t msg_stime; > > - int __unused2; > > - time_t msg_rtime; > > - int __unused3; > > - time_t msg_ctime; > > + unsigned long __msg_stime_hi; > > + unsigned long __msg_stime_lo; > > + unsigned long __msg_rtime_hi; > > + unsigned long __msg_rtime_lo; > > + unsigned long __msg_ctime_hi; > > + unsigned long __msg_ctime_lo; > > by making this just: > > > + time_t msg_stime; > > + time_t msg_rtime; > > + time_t msg_ctime; > > since the alignments and endianness are correct (I'm pretty sure > they're correct for all 3 structs). Any ppc folks want to confirm > that? > > It's not a big deal either way but would be slightly "nicer". If there's any possibility of having a little-endian 32-bit powerpc target, then I think it's probably best not to do this -- it would have to be backed out conditional on endianness. Rich