From: Rich Felker <dalias@libc.org>
To: Joseph Myers <joseph@codesourcery.com>
Cc: libc-alpha@sourceware.org
Subject: Re: Make SH ucontext always match current kernels
Date: Tue, 08 Nov 2016 01:20:00 -0000 [thread overview]
Message-ID: <20161108012001.GA12267@brightrain.aerifal.cx> (raw)
In-Reply-To: <alpine.DEB.2.20.1611072317460.23588@digraph.polyomino.org.uk>
On Mon, Nov 07, 2016 at 11:18:32PM +0000, Joseph Myers wrote:
> As discussed in the thread starting at
> <https://sourceware.org/ml/libc-alpha/2015-06/msg00657.html>, 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 <anonymous>}' 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 <joseph@codesourcery.com>
>
> * 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
next prev parent reply other threads:[~2016-11-08 1:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-07 23:18 Joseph Myers
2016-11-08 1:20 ` Rich Felker [this message]
2016-11-14 23:38 ` Ping " Joseph Myers
2016-11-15 20:48 ` Mike Frysinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161108012001.GA12267@brightrain.aerifal.cx \
--to=dalias@libc.org \
--cc=joseph@codesourcery.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).