1 // sparc-signal.h - Catch runtime signals and turn them into exceptions.
3 /* Copyright (C) 1998, 1999, 2000 Free Software Foundation
5 This file is part of libgcj.
7 This software is copyrighted work licensed under the terms of the
8 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
12 #define JAVA_SIGNAL_H 1
20 #define SIGNAL_HANDLER(_name) \
21 static void _name (int _dummy, siginfo_t *_info, void *arg)
24 #define FLUSH_REGISTER_WINDOWS \
25 asm volatile ("flushw");
27 #define FLUSH_REGISTER_WINDOWS \
28 asm volatile ("ta 3");
31 #define MAKE_THROW_FRAME(_exception) \
34 ucontext_t *_context = (ucontext_t *) arg; \
37 register long sp = _context->uc_mcontext.gregs[REG_SP]; \
38 register long retaddr = _context->uc_mcontext.gregs[REG_O7]; \
39 FLUSH_REGISTER_WINDOWS; \
40 asm volatile ("mov %0, %%i6; mov %1, %%i7" \
41 : : "r"(sp), "r"(retaddr)); \
48 struct sigaction act; \
49 act.sa_sigaction = catch_segv; \
50 act.sa_flags = SA_SIGINFO | SA_NODEFER; \
51 sigemptyset (&act.sa_mask); \
52 sigaction (SIGSEGV, &act, NULL); \
59 struct sigaction act; \
60 act.sa_flags = SA_SIGINFO | SA_NODEFER; \
61 act.sa_sigaction = catch_fpe; \
62 sigemptyset (&act.sa_mask); \
63 sigaction (SIGFPE, &act, NULL); \
67 #endif /* JAVA_SIGNAL_H */