i386-signal.h, [...]: New files.
[gcc.git] / libjava / include / i386-signal.h
1 // i386-signal.h - Catch runtime signals and turn them into exceptions.
2
3 /* Copyright (C) 1998, 1999 Cygnus Solutions
4
5 This file is part of libgcj.
6
7 This software is copyrighted work licensed under the terms of the
8 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
9 details. */
10
11 /* This technique should work for all i386 based Unices which conform
12 to iBCS2. This includes all versions of Linux more recent than
13 version 1.3 */
14
15
16 #ifndef JAVA_SIGNAL_H
17 #define JAVA_SIGNAL_H 1
18
19 #include <signal.h>
20
21 #define HANDLE_SEGV 1
22 #define HANDLE_FPE 1
23
24
25 #define MAKE_THROW_FRAME(_dummy) \
26 { \
27 void **_p = (void **)&_dummy; \
28 struct sigcontext_struct *_regs = (struct sigcontext_struct *)++_p; \
29 \
30 register unsigned long _ebp = _regs->ebp; \
31 register unsigned long _eip = _regs->eip; \
32 \
33 asm volatile ("mov %0, (%%ebp); mov %1, 4(%%ebp)" \
34 : : "r"(_ebp), "r"(_eip)); \
35 }
36
37 #endif /* JAVA_SIGNAL_H */
38