From patchwork Mon Jun 14 08:08:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Ada] Set up alternative signal stack for PowerPC Linux Date: Sun, 13 Jun 2010 22:08:40 -0000 From: Arnaud Charlet X-Patchwork-Id: 55484 Message-Id: <20100614080840.GA30803@adacore.com> To: gcc-patches@gcc.gnu.org Cc: Jose Ruiz This patch initializes the alternative signal stack for PowerPC Linux. Tested on powerpc-linux, committed on trunk. 2010-06-14 Jose Ruiz * init.c (__gnat_alternate_stack): Define this space for PowerPC linux (__gnat_install_handler, PowerPC linux): Activate the alternative signal stack. Index: init.c =================================================================== --- init.c (revision 160705) +++ init.c (working copy) @@ -706,7 +706,7 @@ __gnat_error_handler (int sig, Raise_From_Signal_Handler (exception, msg); } -#if defined (i386) || defined (__x86_64__) +#if defined (i386) || defined (__x86_64__) || defined (__powerpc__) /* This must be in keeping with System.OS_Interface.Alternate_Stack_Size. */ char __gnat_alternate_stack[16 * 1024]; /* 2 * SIGSTKSZ */ #endif @@ -747,7 +747,7 @@ __gnat_install_handler (void) handled properly, avoiding a SEGV generation from stack usage by the handler itself. */ -#if defined (i386) || defined (__x86_64__) +#if defined (i386) || defined (__x86_64__) || defined (__powerpc__) stack_t stack; stack.ss_sp = __gnat_alternate_stack; stack.ss_size = sizeof (__gnat_alternate_stack); @@ -768,7 +768,7 @@ __gnat_install_handler (void) sigaction (SIGILL, &act, NULL); if (__gnat_get_interrupt_state (SIGBUS) != 's') sigaction (SIGBUS, &act, NULL); -#if defined (i386) || defined (__x86_64__) +#if defined (i386) || defined (__x86_64__) || defined (__powerpc__) act.sa_flags |= SA_ONSTACK; #endif if (__gnat_get_interrupt_state (SIGSEGV) != 's')