From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122300 invoked by alias); 8 Nov 2016 01:20:19 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 122276 invoked by uid 89); 8 Nov 2016 01:20:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.2 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RDNS_DYNAMIC,TVD_RCVD_IP,URIBL_RED autolearn=no version=3.3.2 spammy=hoped X-HELO: brightrain.aerifal.cx Date: Tue, 08 Nov 2016 01:20:00 -0000 From: Rich Felker To: Joseph Myers Cc: libc-alpha@sourceware.org Subject: Re: Make SH ucontext always match current kernels Message-ID: <20161108012001.GA12267@brightrain.aerifal.cx> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2016-11/txt/msg00263.txt.bz2 On Mon, Nov 07, 2016 at 11:18:32PM +0000, Joseph Myers wrote: > As discussed in the thread starting at > , there > are various problems with the sigcontext / mcontext / ucontext > structures on SH. The soft-float SH4 case in fact does not build at > present, with errors processing > sysdeps/unix/sysv/linux/sh/sh4/ucontext_i.sym with gen-as-const.awk > ("error: 'mcontext_t {aka struct }' has no member named > 'fpregs'"). > > Linux 4.8 (commit bbe6c77857c38f4acbdc4fc70399515226d1859a) moved to > always using the same sigcontext structure on SH, with room for > floating-point registers whether or not present on the processor. > This patch makes the glibc header match. > > Tested (compilation only) for sh4-linux-gnu hard float, and in > conjunction with other fixes for soft float. > > 2016-11-07 Joseph Myers > > * sysdeps/unix/sysv/linux/sh/sys/ucontext.h [__SH4__ || __SH4A__]: > Make code unconditional. > [!(__SH4__ || __SH4A__)]: Remove conditional code. > > diff --git a/sysdeps/unix/sysv/linux/sh/sys/ucontext.h b/sysdeps/unix/sysv/linux/sh/sys/ucontext.h > index 2c5fa04..4ee0b28 100644 > --- a/sysdeps/unix/sysv/linux/sh/sys/ucontext.h > +++ b/sysdeps/unix/sysv/linux/sh/sys/ucontext.h > @@ -76,7 +76,6 @@ enum > }; > #endif > > -#if (defined(__SH4__) || defined(__SH4A__)) > typedef int freg_t; > > /* Number of FPU registers. */ > @@ -102,20 +101,6 @@ typedef struct > unsigned int fpul; > unsigned int ownedfp; > } mcontext_t; > -#else > -/* Context to describe whole processor state. */ > -typedef struct > - { > - unsigned int oldmask; > - gregset_t gregs; > - unsigned int pc; > - unsigned int pr; > - unsigned int sr; > - unsigned int gbr; > - unsigned int mach; > - unsigned int macl; > - } mcontext_t; > -#endif /* __SH_FPU_ANY__ */ > > /* Userlevel context. */ > typedef struct ucontext I haven't tested the patch, but it looks like the change I expected/hoped to see glibc make when working on the kernel side. Thanks. Rich