dominance.c (calc_dfs_tree_nonrec): Reverse order of tests in if statement so we...
[official-gcc.git] / libjava / include / sparc-signal.h
blob03538eccf209fe93dbeb2ab928ba933328a8c53c
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
9 details. */
11 #ifndef JAVA_SIGNAL_H
12 #define JAVA_SIGNAL_H 1
14 #include <signal.h>
15 #include <ucontext.h>
17 #define HANDLE_SEGV 1
18 #define HANDLE_FPE 1
20 #define SIGNAL_HANDLER(_name) \
21 static void _name (int _dummy, siginfo_t *_info, void *arg)
23 #define FLUSH_REGISTER_WINDOWS \
24 asm volatile ("ta 3");
26 #define MAKE_THROW_FRAME(_exception) \
27 do \
28 { \
29 ucontext_t *_context = (ucontext_t *) arg; \
30 (void)_dummy; \
31 (void)_info; \
32 register int sp = _context->uc_mcontext.gregs[REG_SP]; \
33 register int retaddr = _context->uc_mcontext.gregs[REG_O7]; \
34 FLUSH_REGISTER_WINDOWS; \
35 asm volatile ("mov %0, %%i6; mov %1, %%i7" \
36 : : "r"(sp), "r"(retaddr)); \
37 } \
38 while (0)
40 #define INIT_SEGV \
41 do \
42 { \
43 nullp = new java::lang::NullPointerException (); \
44 struct sigaction act; \
45 act.sa_sigaction = catch_segv; \
46 act.sa_flags = SA_SIGINFO | SA_NODEFER; \
47 sigemptyset (&act.sa_mask); \
48 sigaction (SIGSEGV, &act, NULL); \
49 } \
50 while (0)
52 #define INIT_FPE \
53 do \
54 { \
55 arithexception = new java::lang::ArithmeticException \
56 (JvNewStringLatin1 ("/ by zero")); \
57 struct sigaction act; \
58 act.sa_flags = SA_SIGINFO | SA_NODEFER; \
59 act.sa_sigaction = catch_fpe; \
60 sigemptyset (&act.sa_mask); \
61 sigaction (SIGFPE, &act, NULL); \
62 } \
63 while (0)
65 #endif /* JAVA_SIGNAL_H */