[PATCH] newlib/configure.host: Turn off sti/cli for i386 setjmp for i386-rtems*

Corinna Vinschen vinschen@redhat.com
Fri Feb 26 16:29:00 GMT 2016


On Feb 26 09:34, Joel Sherrill wrote:
> On 2/26/2016 9:26 AM, Corinna Vinschen wrote:
> >On Feb 26 04:54, Joel Sherrill wrote:
> >>On 2/26/2016 4:44 AM, Corinna Vinschen wrote:
> >>>Would it make sense to enable _I386MACH_ALLOW_HW_INTERRUPTS by default
> >>>on x86/x86_64?
> >>
> >>I can't see any downside. I spot checked other ports and no other port seemed to have comparable code. I would be OK with that. Where is it defaulted?
> >
> >I thought changing the definition from _I386MACH_ALLOW_HW_INTERRUPTS to,
> >e.g, _I386MACH_DISABLE_HW_INTERRUPTS wouldn't hurt, as in the patch
> >below.
> >
> >However, we might have to make sure how to handle explicitly mentioned
> >ix86 systems (rdos, sco, netware).  I know basically nothing about
> >these.
> 
> I don't know about rdos but sco and netware would be running setjmp/longjmp
> in user space and thus not be able to us the instructions.
> 
> Seems as though they would have complained if there were any users. :)

You have a point there.  We may want to add -D_I386MACH_DISABLE_HW_INTERRUPTS
to rdos for backward compat and just skip it everywhere else.

Jeff, does that sound ok to you?  See the below patch suggestion.


Corinna


> >[...]
> >diff --git a/newlib/configure.host b/newlib/configure.host
> >index 5fa37d4..9054230 100644
> >--- a/newlib/configure.host
> >+++ b/newlib/configure.host
> >@@ -469,7 +469,6 @@ case "${host}" in
> >  	default_newlib_io_pos_args="yes"
> >  	#newlib_cflags="${newlib_cflags} -Werror" # DEBUGGING ONLY;BREAKS BUILD
> >  	newlib_cflags="${newlib_cflags} -Wall"
> >-	newlib_cflags="${newlib_cflags} -D_I386MACH_ALLOW_HW_INTERRUPTS"
> >  	newlib_cflags="${newlib_cflags} -DHAVE_FCNTL"
> >  	newlib_cflags="${newlib_cflags} -DHAVE_GETOPT"
> >  	newlib_cflags="${newlib_cflags} -D_NO_POSIX_SPAWN"
> >diff --git a/newlib/libc/machine/i386/i386mach.h b/newlib/libc/machine/i386/i386mach.h
> >index 23c3219..403d24b 100644
> >--- a/newlib/libc/machine/i386/i386mach.h
> >+++ b/newlib/libc/machine/i386/i386mach.h
> >@@ -74,7 +74,7 @@
> >  #define SOTYPE_FUNCTION(sym)
> >  #endif
> >
> >-#ifdef _I386MACH_ALLOW_HW_INTERRUPTS
> >+#ifndef _I386MACH_DISABLE_HW_INTERRUPTS
> >  #define        __CLI
> >  #define        __STI
> >  #else
> >diff --git a/newlib/libc/machine/x86_64/x86_64mach.h b/newlib/libc/machine/x86_64/x86_64mach.h
> >index 84cb2f8..05e6392 100644
> >--- a/newlib/libc/machine/x86_64/x86_64mach.h
> >+++ b/newlib/libc/machine/x86_64/x86_64mach.h
> >@@ -104,7 +104,7 @@
> >  #define SOTYPE_FUNCTION(sym)
> >  #endif
> >
> >-#ifdef _I386MACH_ALLOW_HW_INTERRUPTS
> >+#ifndef _I386MACH_DISABLE_HW_INTERRUPTS
> >  #define        __CLI
> >  #define        __STI
> >  #else
> >diff --git a/newlib/libc/sys/linux/machine/i386/i386mach.h b/newlib/libc/sys/linux/machine/i386/i386mach.h
> >index 23c3219..403d24b 100644
> >--- a/newlib/libc/sys/linux/machine/i386/i386mach.h
> >+++ b/newlib/libc/sys/linux/machine/i386/i386mach.h
> >@@ -74,7 +74,7 @@
> >  #define SOTYPE_FUNCTION(sym)
> >  #endif
> >
> >-#ifdef _I386MACH_ALLOW_HW_INTERRUPTS
> >+#ifndef _I386MACH_DISABLE_HW_INTERRUPTS
> >  #define        __CLI
> >  #define        __STI
> >  #else
> >diff --git a/newlib/libm/machine/i386/i386mach.h b/newlib/libm/machine/i386/i386mach.h
> >index 23c3219..403d24b 100644
> >--- a/newlib/libm/machine/i386/i386mach.h
> >+++ b/newlib/libm/machine/i386/i386mach.h
> >@@ -74,7 +74,7 @@
> >  #define SOTYPE_FUNCTION(sym)
> >  #endif
> >
> >-#ifdef _I386MACH_ALLOW_HW_INTERRUPTS
> >+#ifndef _I386MACH_DISABLE_HW_INTERRUPTS
> >  #define        __CLI
> >  #define        __STI
> >  #else
> >
> >
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20160226/fe9df398/attachment.sig>


More information about the Newlib mailing list