From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14751 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH V3] riscv64: Change container for riscv floating-point state to __riscv_mc_fp_state Date: Sun, 29 Sep 2019 23:54:39 -0400 Message-ID: <20190930035439.GN9017@brightrain.aerifal.cx> References: <20190929003101.2886019-1-raj.khem@gmail.com> 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="163750"; 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-14767-gllmg-musl=m.gmane.org@lists.openwall.com Mon Sep 30 05:54:55 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 1iEmly-000gVt-RH for gllmg-musl@m.gmane.org; Mon, 30 Sep 2019 05:54:54 +0200 Original-Received: (qmail 29999 invoked by uid 550); 30 Sep 2019 03:54:52 -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 29981 invoked from network); 30 Sep 2019 03:54:51 -0000 Content-Disposition: inline In-Reply-To: <20190929003101.2886019-1-raj.khem@gmail.com> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:14751 Archived-At: On Sat, Sep 28, 2019 at 05:31:01PM -0700, Khem Raj wrote: > Match the struct elements with glibc > glibc also uses __riscv_mc prefix, some packages like gdb uses that > include signal.h in sys/user.h for __riscv_mc_fp_state type definition > > Signed-off-by: Khem Raj > --- > v2: Include bits/signal.h in sys/user.h > v3: Replace bits/signal.h with signal.h > > arch/riscv64/bits/signal.h | 18 +++++++++--------- > arch/riscv64/bits/user.h | 4 +++- > 2 files changed, 12 insertions(+), 10 deletions(-) > > diff --git a/arch/riscv64/bits/signal.h b/arch/riscv64/bits/signal.h > index 76d7ad80..aba7ab00 100644 > --- a/arch/riscv64/bits/signal.h > +++ b/arch/riscv64/bits/signal.h > @@ -13,25 +13,25 @@ typedef unsigned long greg_t; > typedef unsigned long gregset_t[32]; > > struct __riscv_mc_f_ext_state { > - unsigned int f[32]; > - unsigned int fcsr; > + unsigned int __f[32]; > + unsigned int __fcsr; > }; > > struct __riscv_mc_d_ext_state { > - unsigned long long f[32]; > - unsigned int fcsr; > + unsigned long long __f[32]; > + unsigned int __fcsr; > }; > > struct __riscv_mc_q_ext_state { > - unsigned long long f[64] __attribute__((aligned(16))); > - unsigned int fcsr; > + unsigned long long __f[64] __attribute__((aligned(16))); > + unsigned int __fcsr; > unsigned int reserved[3]; > }; > > union __riscv_mc_fp_state { > - struct __riscv_mc_f_ext_state f; > - struct __riscv_mc_d_ext_state d; > - struct __riscv_mc_q_ext_state q; > + struct __riscv_mc_f_ext_state __f; > + struct __riscv_mc_d_ext_state __d; > + struct __riscv_mc_q_ext_state __q; > }; > > typedef union __riscv_mc_fp_state fpregset_t; > diff --git a/arch/riscv64/bits/user.h b/arch/riscv64/bits/user.h > index d2e383b2..9cc0bc70 100644 > --- a/arch/riscv64/bits/user.h > +++ b/arch/riscv64/bits/user.h > @@ -1,3 +1,5 @@ > +#include > + > struct user_fpregs_struct { > double f[32]; > unsigned int fcsr; > @@ -5,4 +7,4 @@ struct user_fpregs_struct { > > #define ELF_NGREG 32 > typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG]; > -typedef struct user_fpregs_struct elf_fpregset_t; > +typedef union __riscv_mc_fp_state elf_fpregset_t; > -- > 2.23.0 I'm splitting this into two parts, one modifying bits/signal.h to fix the above and other issues there, and the other to fix bits/user.h and further remove the unused struct user_fpregs_struct which had no precedent. Crediting you as the basis for both. Thanks! Rich