summaryrefslogtreecommitdiff
path: root/libjava/include
diff options
context:
space:
mode:
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-09 03:39:35 +0000
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-09 03:39:35 +0000
commit7d05473109738c986965c6f6ef6700c0055ff981 (patch)
tree2882e9fa20bf7d913df5c34eeec6e334a5b1f795 /libjava/include
parent1922631399748632bd11f749af5a0ec79848cd60 (diff)
downloadgcc-7d05473109738c986965c6f6ef6700c0055ff981.tar.gz
* gcc/config/pa/pa32-linux.h (MD_FALLBACK_FRAME_STATE_FOR): Define.
* libjava/configure.in (SIGNAL_HANDLER): Use pa-signal.h for hppa. * libjava/configure: Regenerate. * libjava/configure.host: Set can_unwind_signal for hppa*-linux. * libjava/pa-signal.h: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84344 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/include')
-rw-r--r--libjava/include/pa-signal.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/libjava/include/pa-signal.h b/libjava/include/pa-signal.h
new file mode 100644
index 00000000000..0f7c05427ab
--- /dev/null
+++ b/libjava/include/pa-signal.h
@@ -0,0 +1,61 @@
+// pa-signal.h - Catch runtime signals and turn them into exceptions.
+
+/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
+
+ This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
+details. */
+
+#ifndef JAVA_SIGNAL_H
+#define JAVA_SIGNAL_H 1
+
+#include <signal.h>
+#include <ucontext.h>
+#include <sys/syscall.h>
+
+#define HANDLE_SEGV 1
+#define HANDLE_FPE 1
+
+#define SIGNAL_HANDLER(_name) \
+static void _Jv_##_name (int _dummy, siginfo_t *_info, void *arg)
+
+#define MAKE_THROW_FRAME(_exception) \
+do \
+{ \
+ struct ucontext *uc = (struct ucontext *)arg; \
+ struct sigcontext *sc = &uc->uc_mcontext; \
+ (void)_dummy; \
+ (void)_info; \
+ /* Advance the program counter so that it is after the start \
+ of the instruction: the exception handler expects \
+ the PC to point to the instruction after a call. */ \
+ sc->sc_iaoq[0] = sc->sc_iaoq[1]; \
+ sc->sc_iaoq[1] += 4; \
+} \
+while (0)
+
+#define INIT_SEGV \
+do \
+ { \
+ struct sigaction act; \
+ act.sa_sigaction = _Jv_catch_segv; \
+ sigemptyset (&act.sa_mask); \
+ act.sa_flags = SA_SIGINFO; \
+ syscall (SYS_rt_sigaction, SIGSEGV, &act, NULL, _NSIG / 8); \
+ } \
+while (0)
+
+#define INIT_FPE \
+do \
+ { \
+ struct sigaction act; \
+ act.sa_sigaction = _Jv_catch_fpe; \
+ sigemptyset (&act.sa_mask); \
+ act.sa_flags = SA_SIGINFO; \
+ syscall (SYS_rt_sigaction, SIGFPE, &act, NULL, _NSIG / 8); \
+ } \
+while (0)
+
+#endif /* JAVA_SIGNAL_H */