summaryrefslogtreecommitdiff
path: root/gcc/ada/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/init.c')
-rw-r--r--gcc/ada/init.c150
1 files changed, 0 insertions, 150 deletions
diff --git a/gcc/ada/init.c b/gcc/ada/init.c
index 80a02b1734f..87124b6a4ea 100644
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -295,156 +295,6 @@ __gnat_install_handler (void)
}
/*****************/
-/* Tru64 section */
-/*****************/
-
-#elif defined(__alpha__) && defined(__osf__)
-
-#include <signal.h>
-#include <sys/siginfo.h>
-
-extern char *__gnat_get_code_loc (struct sigcontext *);
-extern void __gnat_set_code_loc (struct sigcontext *, char *);
-extern size_t __gnat_machine_state_length (void);
-
-#define HAVE_GNAT_ADJUST_CONTEXT_FOR_RAISE
-
-void
-__gnat_adjust_context_for_raise (int signo, void *ucontext)
-{
- struct sigcontext *sigcontext = (struct sigcontext *) ucontext;
-
- /* The unwinder expects the signal context to contain the address of the
- faulting instruction. For SIGFPE, this depends on the trap shadow
- situation (see man ieee). We nonetheless always compensate for it,
- considering that PC designates the instruction following the one that
- trapped. This is not necessarily true but corresponds to what we have
- always observed. */
- if (signo == SIGFPE)
- sigcontext->sc_pc--;
-}
-
-static void
-__gnat_error_handler (int sig, siginfo_t *si, void *ucontext)
-{
- struct Exception_Data *exception;
- static int recurse = 0;
- const char *msg;
-
- /* Adjusting is required for every fault context, so adjust for this one
- now, before we possibly trigger a recursive fault below. */
- __gnat_adjust_context_for_raise (sig, ucontext);
-
- /* If this was an explicit signal from a "kill", just resignal it. */
- if (SI_FROMUSER (si))
- {
- signal (sig, SIG_DFL);
- kill (getpid(), sig);
- }
-
- /* Otherwise, treat it as something we handle. */
- switch (sig)
- {
- case SIGSEGV:
- /* If the problem was permissions, this is a constraint error.
- Likewise if the failing address isn't maximally aligned or if
- we've recursed.
-
- ??? Using a static variable here isn't task-safe, but it's
- much too hard to do anything else and we're just determining
- which exception to raise. */
- if (si->si_code == SEGV_ACCERR
- || (long) si->si_addr == 0
- || (((long) si->si_addr) & 3) != 0
- || recurse)
- {
- exception = &constraint_error;
- msg = "SIGSEGV";
- }
- else
- {
- /* See if the page before the faulting page is accessible. Do that
- by trying to access it. We'd like to simply try to access
- 4096 + the faulting address, but it's not guaranteed to be
- the actual address, just to be on the same page. */
- recurse++;
- ((volatile char *)
- ((long) si->si_addr & - getpagesize ()))[getpagesize ()];
- exception = &storage_error;
- msg = "stack overflow or erroneous memory access";
- }
- break;
-
- case SIGBUS:
- exception = &program_error;
- msg = "SIGBUS";
- break;
-
- case SIGFPE:
- exception = &constraint_error;
- msg = "SIGFPE";
- break;
-
- default:
- exception = &program_error;
- msg = "unhandled signal";
- }
-
- recurse = 0;
- Raise_From_Signal_Handler (exception, CONST_CAST (char *, msg));
-}
-
-void
-__gnat_install_handler (void)
-{
- struct sigaction act;
-
- /* 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! */
-
- act.sa_handler = (void (*) (int)) __gnat_error_handler;
- act.sa_flags = SA_RESTART | SA_NODEFER | SA_SIGINFO;
- sigemptyset (&act.sa_mask);
-
- /* Do not install handlers if interrupt state is "System". */
- if (__gnat_get_interrupt_state (SIGABRT) != 's')
- sigaction (SIGABRT, &act, NULL);
- if (__gnat_get_interrupt_state (SIGFPE) != 's')
- sigaction (SIGFPE, &act, NULL);
- if (__gnat_get_interrupt_state (SIGILL) != 's')
- sigaction (SIGILL, &act, NULL);
- if (__gnat_get_interrupt_state (SIGSEGV) != 's')
- sigaction (SIGSEGV, &act, NULL);
- if (__gnat_get_interrupt_state (SIGBUS) != 's')
- sigaction (SIGBUS, &act, NULL);
-
- __gnat_handler_installed = 1;
-}
-
-/* Routines called by s-mastop-tru64.adb. */
-
-#define SC_GP 29
-
-char *
-__gnat_get_code_loc (struct sigcontext *context)
-{
- return (char *) context->sc_pc;
-}
-
-void
-__gnat_set_code_loc (struct sigcontext *context, char *pc)
-{
- context->sc_pc = (long) pc;
-}
-
-size_t
-__gnat_machine_state_length (void)
-{
- return sizeof (struct sigcontext);
-}
-
-/*****************/
/* HP-UX section */
/*****************/