summaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-06 09:23:33 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-06 09:23:33 +0000
commit3126069a7ceb6454b6ea3ce200cd77e5a223a463 (patch)
tree91cfffa5e82f0d1408efd2607f733ba3a49f91eb /gcc/ada
parent0d12640be4501b419982546d58feb5e48c65d56f (diff)
downloadgcc-3126069a7ceb6454b6ea3ce200cd77e5a223a463.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123580 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-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 9e330797453..35dffd39f54 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). */