diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-02 12:36:15 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-02 12:36:15 +0200 |
commit | 90878b1250d7ef591b61912449df3d14bdec05cd (patch) | |
tree | 89cb9b543c3451d8512a002e8807ce04bbc885d3 /gcc/ada/init.c | |
parent | 273adcdf9fbd8521e9f0d39e8a9f22d0c53b482d (diff) | |
download | gcc-90878b1250d7ef591b61912449df3d14bdec05cd.tar.gz |
[multiple changes]
2011-08-02 Ed Schonberg <schonberg@adacore.com>
* exp_ch5.adb (Expand_N_Assignment_Statement): under restriction
No_Dispatching_Calls, do not look for the Assign primitive, because
predefined primitives are not created in this case.
2011-08-02 Bob Duff <duff@adacore.com>
* stylesw.ads: Minor comment fixes.
2011-08-02 Robert Dewar <dewar@adacore.com>
* freeze.adb (Add_To_Result): New procedure.
2011-08-02 Jose Ruiz <ruiz@adacore.com>
* exp_attr.adb (Find_Stream_Subprogram): When using a configurable run
time, if the specific run-time routines for handling streams of strings
are not available, use the default mechanism.
2011-08-02 Arnaud Charlet <charlet@adacore.com>
* s-regpat.ads: Fix typo.
2011-08-02 Vincent Celier <celier@adacore.com>
* prj-conf.adb (Get_Or_Create_Configuration_File): If On_Load_Config is
not null, call it to create the in memory config project file without
parsing an existing default config project file.
2011-08-02 Eric Botcazou <ebotcazou@adacore.com>
* atree.adb (Allocate_Initialize_Node): Remove useless temporaries.
2011-08-02 Ed Schonberg <schonberg@adacore.com>
* sem_elim.adb: an abstract subprogram does not need an eliminate
pragma for its descendant to be eliminable.
2011-08-02 Ed Falis <falis@adacore.com>
* init.c: revert to handling before previous checkin for VxWorks
* s-intman-vxworks.adb: delete unnecessary declarations related to
using Ada interrupt facilities for handling signals.
Delete Initialize_Interrupts. Use __gnat_install_handler instead.
* s-intman-vxworks.ads: Import __gnat_install_handler as
Initialize_Interrupts.
* s-taprop-vxworks.adb: Delete Signal_Mask.
(Abort_Handler): change construction of mask to unblock exception
signals.
From-SVN: r177130
Diffstat (limited to 'gcc/ada/init.c')
-rw-r--r-- | gcc/ada/init.c | 64 |
1 files changed, 25 insertions, 39 deletions
diff --git a/gcc/ada/init.c b/gcc/ada/init.c index 53d72d9dbe9..822837c0d19 100644 --- a/gcc/ada/init.c +++ b/gcc/ada/init.c @@ -10,19 +10,20 @@ * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * - * ware Foundation; either version 3, or (at your option) any later ver- * + * ware Foundation; either version 2, or (at your option) any later ver- * * sion. GNAT is distributed in the hope that it will be useful, but WITH- * * OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * - * or FITNESS FOR A PARTICULAR PURPOSE. * + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * + * for more details. You should have received a copy of the GNU General * + * Public License distributed with GNAT; see file COPYING. If not, write * + * to the Free Software Foundation, 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301, USA. * * * - * As a special exception under Section 7 of GPL version 3, you are granted * - * additional permissions described in the GCC Runtime Library Exception, * - * version 3.1, as published by the Free Software Foundation. * - * * - * You should have received a copy of the GNU General Public License and * - * a copy of the GCC Runtime Library Exception along with this program; * - * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see * - * <http://www.gnu.org/licenses/>. * + * As a special exception, if you link this file with other files to * + * produce an executable, this file does not by itself cause the resulting * + * executable to be covered by the GNU General Public License. This except- * + * ion does not however invalidate any other reasons why the executable * + * file might be covered by the GNU Public License. * * * * GNAT was originally developed by the GNAT team at New York University. * * Extensive contributions were provided by Ada Core Technologies Inc. * @@ -378,7 +379,7 @@ __gnat_error_handler (int sig, siginfo_t *si, void *ucontext) } recurse = 0; - Raise_From_Signal_Handler (exception, (const char *) msg); + Raise_From_Signal_Handler (exception, (char *) msg); } void @@ -1975,23 +1976,20 @@ __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; - /* This routine handles the exception signals for all tasks */ - - sigprocmask (SIG_UNBLOCK, &__gnat_signal_mask, NULL); + /* 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); __gnat_map_signal (sig); } @@ -2003,24 +2001,14 @@ __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! 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); + signal that might cause a scheduling event! */ act.sa_handler = __gnat_error_handler; act.sa_flags = SA_SIGINFO | SA_ONSTACK; - 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. */ + sigemptyset (&act.sa_mask); + /* 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); @@ -2040,7 +2028,6 @@ __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; @@ -2049,7 +2036,6 @@ __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 @@ -2057,7 +2043,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. For all except VxWorks 653 */ + process thread. */ asm ("finit"); #endif |