aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2007-04-06 11:23:33 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2007-04-06 11:23:33 +0200
commit00f74faf0ab88647128d8b8a94a5da867f0cf5a6 (patch)
tree91cfffa5e82f0d1408efd2607f733ba3a49f91eb /gcc
parent815f44d0cd91db97ee2793bcdf007f498f78f8aa (diff)
downloadgcc-00f74faf0ab88647128d8b8a94a5da867f0cf5a6.zip
gcc-00f74faf0ab88647128d8b8a94a5da867f0cf5a6.tar.gz
gcc-00f74faf0ab88647128d8b8a94a5da867f0cf5a6.tar.bz2
init.c: Reuse PA/HP-UX code for IA-64/HP-UX, except __gnat_adjust_context_for_raise.
2007-04-06 Eric Botcazou <botcazou@adacore.com> Arnaud Charlet <charlet@adacore.com> * init.c: Reuse PA/HP-UX code for IA-64/HP-UX, except __gnat_adjust_context_for_raise. (__gnat_init_float): on x86 vxworks 5.x and 6.x, we use the same implementation of floating point operations as native x86 targets. So the FPU should be initialized in the same way using finit. Fix floating point operations accuracy issues. (__gnat_install_handler, case FreeBSD): Use proper type for sa_sigaction member in struct sigaction, so as to avoid warning for incompatible pointer types. From-SVN: r123580
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/init.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/gcc/ada/init.c b/gcc/ada/init.c
index 9e33079..35dffd3 100644
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -447,11 +447,11 @@ __gnat_machine_state_length (void)
return sizeof (struct sigcontext);
}
-/********************/
-/* PA HP-UX section */
-/********************/
+/*****************/
+/* HP-UX section */
+/*****************/
-#elif defined (__hppa__) && defined (__hpux__)
+#elif defined (__hpux__)
#include <signal.h>
#include <sys/ucontext.h>
@@ -459,6 +459,8 @@ __gnat_machine_state_length (void)
static void
__gnat_error_handler (int sig, siginfo_t *siginfo, void *ucontext);
+#if defined (__hppa__)
+
/* __gnat_adjust_context_for_raise - see comments along with the default
version later in this file. */
@@ -475,6 +477,8 @@ __gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED, void *ucontext)
mcontext->ss_narrow.ss_pcoq_head ++;
}
+#endif
+
static void
__gnat_error_handler
(int sig, siginfo_t *siginfo ATTRIBUTE_UNUSED, void *ucontext)
@@ -1627,7 +1631,8 @@ __gnat_install_handler ()
exceptions. Make sure that the handler isn't interrupted by another
signal that might cause a scheduling event! */
- act.sa_handler = __gnat_error_handler;
+ act.sa_sigaction
+ = (void (*)(int, struct __siginfo *, void*)) __gnat_error_handler;
act.sa_flags = SA_NODEFER | SA_RESTART | SA_SIGINFO;
(void) sigemptyset (&act.sa_mask);
@@ -1805,6 +1810,12 @@ __gnat_init_float (void)
asm ("mtfsb0 26");
#endif
+#if (defined (__i386__) || defined (i386)) && !defined (VTHREADS)
+ /* This is used to properly initialize the FPU on an x86 for each
+ process thread. */
+ asm ("finit");
+#endif
+
/* Similarly for sparc64. Achieved by masking bits in the Trap Enable Mask
field of the Floating-point Status Register (see the SPARC Architecture
Manual Version 9, p 48). */