diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-02 10:13:21 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-02 10:13:21 +0200 |
commit | 806f6d372157633408dc26c7903e43b732710530 (patch) | |
tree | d10af131f48cfe83e17d537c53b5f2c9bdf5aaa6 /gcc/ada/init.c | |
parent | 780d052e3446d6bc848a173d70db8b7160d52fa9 (diff) | |
download | gcc-806f6d372157633408dc26c7903e43b732710530.zip gcc-806f6d372157633408dc26c7903e43b732710530.tar.gz gcc-806f6d372157633408dc26c7903e43b732710530.tar.bz2 |
[multiple changes]
2011-08-02 Javier Miranda <miranda@adacore.com>
* sem_ch6.adb (Can_Override_Operator): New function.
(Verify_Overriding_Indicator): Add missing code to check overriding
indicator in operators. Fixes regression.
(Check_Overriding_Indicator): Minor reformating after replacing the
code that evaluates if the subprogram can override an operator by
invocations to the above new function.
* einfo.adb
(Write_Field26_Name): Add missing code to ensure that, following
the documentation in einfo.ads, this field is not shown as attribute
"Static_Initialization" on non-dispatching functions.
2011-08-02 Jose Ruiz <ruiz@adacore.com>
* sem_res.adb (Resolve_Call): A call to
Ada.Real_Time.Timing_Events.Set_Handler violates restriction
No_Relative_Delay (AI-0211) only when it sets a relative timing event,
i.e., when the second parameter is of type Time_Span.
2011-08-02 Vincent Celier <celier@adacore.com>
* make.adb (Gnatmake): use <library dir>/lib<library name>.a to link
with an archive instead of -L<library dir> -l<library name>.
2011-08-02 Ed Schonberg <schonberg@adacore.com>
* sem_ch8.adb (Analyze_Use_Type): If the clause is being re-analyzed,
mark the base types In_Use in addition to making the operations
use_visible.
2011-08-02 Ed Falis <falis@adacore.com>
* init.c: add and setup __gnat_signal_mask for the exception signals
* s-inmaop-vxworks.adb: new file.
* s-intman-vxworks.adb: remove unnecessary initializations and
simplify remaining
* s-intman-vxworks.ads: remove unnecessary variable
* s-taprop-vxworks.adb: simplify signal initialization
From-SVN: r177092
Diffstat (limited to 'gcc/ada/init.c')
-rw-r--r-- | gcc/ada/init.c | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/gcc/ada/init.c b/gcc/ada/init.c index 52d7755..53d72d9 100644 --- a/gcc/ada/init.c +++ b/gcc/ada/init.c @@ -1975,20 +1975,23 @@ __gnat_map_signal (int sig) /* Tasking and Non-tasking signal handler. Map SIGnal to Ada exception propagation after the required low level adjustments. */ +sigset_t __gnat_signal_mask; + + /* VxWorks will always mask out the signal during the signal handler and + will reenable it on a longjmp. GNAT does not generate a longjmp to + return from a signal handler so exception signals will still be masked + unless we unmask it. __gnat_signal mask tells sigaction to block the + exception signals and sigprocmask to unblock them. */ + void __gnat_error_handler (int sig, void *si ATTRIBUTE_UNUSED, struct sigcontext *sc ATTRIBUTE_UNUSED) { - sigset_t mask; - /* VxWorks will always mask out the signal during the signal handler and - will reenable it on a longjmp. GNAT does not generate a longjmp to - return from a signal handler so the signal will still be masked unless - we unmask it. */ - sigprocmask (SIG_SETMASK, NULL, &mask); - sigdelset (&mask, sig); - sigprocmask (SIG_SETMASK, &mask, NULL); + /* This routine handles the exception signals for all tasks */ + + sigprocmask (SIG_UNBLOCK, &__gnat_signal_mask, NULL); __gnat_map_signal (sig); } @@ -2000,14 +2003,24 @@ __gnat_install_handler (void) /* Setup signal handler to map synchronous signals to appropriate exceptions. Make sure that the handler isn't interrupted by another - signal that might cause a scheduling event! */ + signal that might cause a scheduling event! This routine is called + only once, for the environment task. Other tasks are set up in the + System.Interrupt_Manager package. */ + + sigemptyset (&__gnat_signal_mask); + sigaddset (SIGBUS, &__gnat_signal_mask); + sigaddset (SIGFPE, &__gnat_signal_mask); + sigaddset (SIGILL, &__gnat_signal_mask); + sigaddset (SIGSEGV, &__gnat_signal_mask); act.sa_handler = __gnat_error_handler; act.sa_flags = SA_SIGINFO | SA_ONSTACK; - sigemptyset (&act.sa_mask); + act.sa_mask = __gnat_signal_mask; + + /* For VxWorks, unconditionally install the exception signal handlers, since + pragma Interrupt_State applies to vectored hardware interrupts, not + signals. */ - /* For VxWorks, install all signal handlers, since pragma Interrupt_State - applies to vectored hardware interrupts, not signals. */ sigaction (SIGFPE, &act, NULL); sigaction (SIGILL, &act, NULL); sigaction (SIGSEGV, &act, NULL); @@ -2027,6 +2040,7 @@ __gnat_init_float (void) below have no effect. */ #if defined (_ARCH_PPC) && !defined (_SOFT_FLOAT) && !defined (VTHREADS) #if defined (__SPE__) + /* VxWorks 6 */ { const unsigned long spefscr_mask = 0xfffffff3; unsigned long spefscr; @@ -2035,6 +2049,7 @@ __gnat_init_float (void) asm ("mtspr 512, %0\n\tisync" : : "r" (spefscr)); } #else + /* all except VxWorks 653 and MILS */ asm ("mtfsb0 25"); asm ("mtfsb0 26"); #endif @@ -2042,7 +2057,7 @@ __gnat_init_float (void) #if (defined (__i386__) || defined (i386)) && !defined (VTHREADS) /* This is used to properly initialize the FPU on an x86 for each - process thread. */ + process thread. For all except VxWorks 653 */ asm ("finit"); #endif |