This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch commit] Adjust SH fpu_control.h and ucontext.h files


"Joseph S. Myers" <joseph@codesourcery.com> wrote:
> I didn't see any response to my point in 
> <https://sourceware.org/ml/libc-alpha/2014-01/msg00382.html> that the 
> actual ucontext ABI, as used by both the kernel and previous glibc, should 
> use something other than __SH_FPU_ANY__ as the conditional for FPRs being 
> part of the context.  I'm not sure exactly what - is __SH4__ defined in 
> all relevant cases or do you need to test __SH4A__ as well (it looks like 
> GCC might not define __SH4__ in all SH4A cases)? - but it certainly seems 
> to me that the ABI has the FPRs in the context (just not used there, but 
> affecting the size and layout) for soft-float SH4.

You are right.  I've missed your point about __SH_FPU_ANY__ use in
ucontext.  If I remember it correctly, the soft-float SH4 setting
and the use of __SH_FPU_ANY__ is for no-fpu SH4 like SH4AL-DSP.
I thought that ucontext for such CPU doesn't need FPRs staff and
forgot that it changes the current ABI for the soft-float SH4 in
the size and layout of ucontext.
And yes, we should check also __SH4A__ for sh4a gcc.  Perhaps
SH4A folks use -m4 and -m4-nofpu setting to avoid issues.
I have no SH4A environment for tests and it seems a bit intrusive
to change all of them at just before new release. 
Does the attached patch look OK now?

Regards,
	kaz
--
	* sysdeps/unix/sysv/linux/sh/sys/ucontext.h: Use __SH4__ and
	__SH4A__ instead of __SH_FPU_ANY__.

diff --git a/sysdeps/unix/sysv/linux/sh/sys/ucontext.h b/sysdeps/unix/sysv/linux/sh/sys/ucontext.h
index 269d29a..2fb4d5d 100644
--- a/sysdeps/unix/sysv/linux/sh/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/sh/sys/ucontext.h
@@ -75,7 +75,7 @@ enum
 };
 #endif
 
-#ifdef __SH_FPU_ANY__
+#if (defined(__SH4__) || defined(__SH4A__))
 typedef int freg_t;
 
 /* Number of FPU registers.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]