| 1 | // i386-signal.h - Catch runtime signals and turn them into exceptions
|
|---|
| 2 | // on an i386 based Linux system.
|
|---|
| 3 |
|
|---|
| 4 | /* Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation
|
|---|
| 5 |
|
|---|
| 6 | This file is part of libgcj.
|
|---|
| 7 |
|
|---|
| 8 | This software is copyrighted work licensed under the terms of the
|
|---|
| 9 | Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
|
|---|
| 10 | details. */
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 | #ifndef JAVA_SIGNAL_H
|
|---|
| 14 | #define JAVA_SIGNAL_H 1
|
|---|
| 15 |
|
|---|
| 16 | #include <signal.h>
|
|---|
| 17 | #include <sys/syscall.h>
|
|---|
| 18 |
|
|---|
| 19 | #define HANDLE_SEGV 1
|
|---|
| 20 | #define HANDLE_FPE 1
|
|---|
| 21 |
|
|---|
| 22 | #define SIGNAL_HANDLER(_name) \
|
|---|
| 23 | static void _name (int _dummy)
|
|---|
| 24 |
|
|---|
| 25 | #define MAKE_THROW_FRAME(_exception) \
|
|---|
| 26 | do \
|
|---|
| 27 | { \
|
|---|
| 28 | void **_p = (void **)&_dummy; \
|
|---|
| 29 | struct sigcontext_struct *_regs = (struct sigcontext_struct *)++_p; \
|
|---|
| 30 | \
|
|---|
| 31 | /* Advance the program counter so that it is after the start of the \
|
|---|
| 32 | instruction: the x86 exception handler expects \
|
|---|
| 33 | the PC to point to the instruction after a call. */ \
|
|---|
| 34 | _regs->eip += 2; \
|
|---|
| 35 | \
|
|---|
| 36 | } \
|
|---|
| 37 | while (0)
|
|---|
| 38 |
|
|---|
| 39 | #define HANDLE_DIVIDE_OVERFLOW \
|
|---|
| 40 | do \
|
|---|
| 41 | { \
|
|---|
| 42 | void **_p = (void **)&_dummy; \
|
|---|
|
|---|