[multiple changes]
[official-gcc.git] / libjava / include / mips-signal.h
blob478e3a4e23c8ce4df942ec04e8d038792d161912
1 // mips-signal.h - Catch runtime signals and turn them into exceptions
2 // on an mips based Linux system.
4 /* Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004, 2006
5 Free Software Foundation
7 This file is part of libgcj.
9 This software is copyrighted work licensed under the terms of the
10 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
11 details. */
13 /* Adapted from sparc-signal.h and powerpc-signal.h
14 by David Daney <ddaney@avtrex.com> */
16 #ifndef JAVA_SIGNAL_H
17 #define JAVA_SIGNAL_H 1
19 #include <signal.h>
20 #include <unistd.h>
22 #define HANDLE_SEGV 1
23 #define HANDLE_FPE 1
25 #define SIGNAL_HANDLER(_name) \
26 static void _name (int _dummy __attribute__ ((__unused__)), \
27 siginfo_t *_info __attribute__ ((__unused__)), \
28 void *_arg __attribute__ ((__unused__)))
30 #define MAKE_THROW_FRAME(_exception)
32 #define _INIT_SIG_HANDLER(_SIG, _ACTION) \
33 do \
34 { \
35 struct sigaction act; \
36 act.sa_sigaction = _ACTION; \
37 act.sa_flags = SA_SIGINFO | SA_NODEFER; \
38 sigemptyset (&act.sa_mask); \
39 sigaction(_SIG, &act, NULL); \
40 } \
41 while (0)
43 #define INIT_SEGV _INIT_SIG_HANDLER (SIGSEGV, catch_segv)
45 #define INIT_FPE _INIT_SIG_HANDLER (SIGFPE, catch_fpe)
46 #undef HANDLE_DIVIDE_OVERFLOW
48 #endif /* JAVA_SIGNAL_H */