mips-signal.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // mips-signal.h - Catch runtime signals and turn them into exceptions
  2. // on an mips based Linux system.
  3. /* Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004, 2006
  4. Free Software Foundation
  5. This file is part of libgcj.
  6. This software is copyrighted work licensed under the terms of the
  7. Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
  8. details. */
  9. /* Adapted from sparc-signal.h and powerpc-signal.h
  10. by David Daney <ddaney@avtrex.com> */
  11. #ifndef JAVA_SIGNAL_H
  12. #define JAVA_SIGNAL_H 1
  13. #include <signal.h>
  14. #include <unistd.h>
  15. #define HANDLE_SEGV 1
  16. #define HANDLE_FPE 1
  17. #define SIGNAL_HANDLER(_name) \
  18. static void _name (int _dummy __attribute__ ((__unused__)), \
  19. siginfo_t *_info __attribute__ ((__unused__)), \
  20. void *_arg __attribute__ ((__unused__)))
  21. #define MAKE_THROW_FRAME(_exception)
  22. #define _INIT_SIG_HANDLER(_SIG, _ACTION) \
  23. do \
  24. { \
  25. struct sigaction act; \
  26. act.sa_sigaction = _ACTION; \
  27. act.sa_flags = SA_SIGINFO | SA_NODEFER; \
  28. sigemptyset (&act.sa_mask); \
  29. sigaction(_SIG, &act, NULL); \
  30. } \
  31. while (0)
  32. #define INIT_SEGV _INIT_SIG_HANDLER (SIGSEGV, catch_segv)
  33. #define INIT_FPE _INIT_SIG_HANDLER (SIGFPE, catch_fpe)
  34. #undef HANDLE_DIVIDE_OVERFLOW
  35. #endif /* JAVA_SIGNAL_H */