signal.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. /* $Id: signal.h,v 1.9 1999/09/06 08:22:11 jj Exp $ */
  2. #ifndef _ASMSPARC64_SIGNAL_H
  3. #define _ASMSPARC64_SIGNAL_H
  4. #include <asm/sigcontext.h>
  5. #ifdef __KERNEL__
  6. #ifndef __ASSEMBLY__
  7. #include <linux/personality.h>
  8. #include <linux/types.h>
  9. #include <linux/compat.h>
  10. #endif
  11. #endif
  12. /* On the Sparc the signal handlers get passed a 'sub-signal' code
  13. * for certain signal types, which we document here.
  14. */
  15. #define SIGHUP 1
  16. #define SIGINT 2
  17. #define SIGQUIT 3
  18. #define SIGILL 4
  19. #define SUBSIG_STACK 0
  20. #define SUBSIG_ILLINST 2
  21. #define SUBSIG_PRIVINST 3
  22. #define SUBSIG_BADTRAP(t) (0x80 + (t))
  23. #define SIGTRAP 5
  24. #define SIGABRT 6
  25. #define SIGIOT 6
  26. #define SIGEMT 7
  27. #define SUBSIG_TAG 10
  28. #define SIGFPE 8
  29. #define SUBSIG_FPDISABLED 0x400
  30. #define SUBSIG_FPERROR 0x404
  31. #define SUBSIG_FPINTOVFL 0x001
  32. #define SUBSIG_FPSTSIG 0x002
  33. #define SUBSIG_IDIVZERO 0x014
  34. #define SUBSIG_FPINEXACT 0x0c4
  35. #define SUBSIG_FPDIVZERO 0x0c8
  36. #define SUBSIG_FPUNFLOW 0x0cc
  37. #define SUBSIG_FPOPERROR 0x0d0
  38. #define SUBSIG_FPOVFLOW 0x0d4
  39. #define SIGKILL 9
  40. #define SIGBUS 10
  41. #define SUBSIG_BUSTIMEOUT 1
  42. #define SUBSIG_ALIGNMENT 2
  43. #define SUBSIG_MISCERROR 5
  44. #define SIGSEGV 11
  45. #define SUBSIG_NOMAPPING 3
  46. #define SUBSIG_PROTECTION 4
  47. #define SUBSIG_SEGERROR 5
  48. #define SIGSYS 12
  49. #define SIGPIPE 13
  50. #define SIGALRM 14
  51. #define SIGTERM 15
  52. #define SIGURG 16
  53. /* SunOS values which deviate from the Linux/i386 ones */
  54. #define SIGSTOP 17
  55. #define SIGTSTP 18
  56. #define SIGCONT 19
  57. #define SIGCHLD 20
  58. #define SIGTTIN 21
  59. #define SIGTTOU 22
  60. #define SIGIO 23
  61. #define SIGPOLL SIGIO /* SysV name for SIGIO */
  62. #define SIGXCPU 24
  63. #define SIGXFSZ 25
  64. #define SIGVTALRM 26
  65. #define SIGPROF 27
  66. #define SIGWINCH 28
  67. #define SIGLOST 29
  68. #define SIGPWR SIGLOST
  69. #define SIGUSR1 30
  70. #define SIGUSR2 31
  71. /* Most things should be clean enough to redefine this at will, if care
  72. is taken to make libc match. */
  73. #define __OLD_NSIG 32
  74. #define __NEW_NSIG 64
  75. #define _NSIG_BPW 64
  76. #define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW)
  77. #define SIGRTMIN 32
  78. #define SIGRTMAX __NEW_NSIG
  79. #if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__)
  80. #define _NSIG __NEW_NSIG
  81. #define __new_sigset_t sigset_t
  82. #define __new_sigaction sigaction
  83. #define __new_sigaction32 sigaction32
  84. #define __old_sigset_t old_sigset_t
  85. #define __old_sigaction old_sigaction
  86. #define __old_sigaction32 old_sigaction32
  87. #else
  88. #define _NSIG __OLD_NSIG
  89. #define NSIG _NSIG
  90. #define __old_sigset_t sigset_t
  91. #define __old_sigaction sigaction
  92. #define __old_sigaction32 sigaction32
  93. #endif
  94. #ifndef __ASSEMBLY__
  95. typedef unsigned long __old_sigset_t; /* at least 32 bits */
  96. typedef struct {
  97. unsigned long sig[_NSIG_WORDS];
  98. } __new_sigset_t;
  99. /* A SunOS sigstack */
  100. struct sigstack {
  101. /* XXX 32-bit pointers pinhead XXX */
  102. char *the_stack;
  103. int cur_status;
  104. };
  105. /* Sigvec flags */
  106. #define _SV_SSTACK 1u /* This signal handler should use sig-stack */
  107. #define _SV_INTR 2u /* Sig return should not restart system call */
  108. #define _SV_RESET 4u /* Set handler to SIG_DFL upon taken signal */
  109. #define _SV_IGNCHILD 8u /* Do not send SIGCHLD */
  110. /*
  111. * sa_flags values: SA_STACK is not currently supported, but will allow the
  112. * usage of signal stacks by using the (now obsolete) sa_restorer field in
  113. * the sigaction structure as a stack pointer. This is now possible due to
  114. * the changes in signal handling. LBT 010493.
  115. * SA_RESTART flag to get restarting signals (which were the default long ago)
  116. */
  117. #define SA_NOCLDSTOP _SV_IGNCHILD
  118. #define SA_STACK _SV_SSTACK
  119. #define SA_ONSTACK _SV_SSTACK
  120. #define SA_RESTART _SV_INTR
  121. #define SA_ONESHOT _SV_RESET
  122. #define SA_NOMASK 0x20u
  123. #define SA_NOCLDWAIT 0x100u
  124. #define SA_SIGINFO 0x200u
  125. #define SIG_BLOCK 0x01 /* for blocking signals */
  126. #define SIG_UNBLOCK 0x02 /* for unblocking signals */
  127. #define SIG_SETMASK 0x04 /* for setting the signal mask */
  128. /*
  129. * sigaltstack controls
  130. */
  131. #define SS_ONSTACK 1
  132. #define SS_DISABLE 2
  133. #define MINSIGSTKSZ 4096
  134. #define SIGSTKSZ 16384
  135. #include <asm-generic/signal.h>
  136. struct __new_sigaction {
  137. __sighandler_t sa_handler;
  138. unsigned long sa_flags;
  139. __sigrestore_t sa_restorer; /* not used by Linux/SPARC yet */
  140. __new_sigset_t sa_mask;
  141. };
  142. #ifdef __KERNEL__
  143. #ifdef CONFIG_COMPAT
  144. struct __new_sigaction32 {
  145. unsigned sa_handler;
  146. unsigned int sa_flags;
  147. unsigned sa_restorer; /* not used by Linux/SPARC yet */
  148. compat_sigset_t sa_mask;
  149. };
  150. #endif
  151. struct k_sigaction {
  152. struct __new_sigaction sa;
  153. void __user *ka_restorer;
  154. };
  155. #endif
  156. struct __old_sigaction {
  157. __sighandler_t sa_handler;
  158. __old_sigset_t sa_mask;
  159. unsigned long sa_flags;
  160. void (*sa_restorer)(void); /* not used by Linux/SPARC yet */
  161. };
  162. #ifdef __KERNEL__
  163. #ifdef CONFIG_COMPAT
  164. struct __old_sigaction32 {
  165. unsigned sa_handler;
  166. compat_old_sigset_t sa_mask;
  167. unsigned int sa_flags;
  168. unsigned sa_restorer; /* not used by Linux/SPARC yet */
  169. };
  170. #endif
  171. #endif
  172. typedef struct sigaltstack {
  173. void __user *ss_sp;
  174. int ss_flags;
  175. size_t ss_size;
  176. } stack_t;
  177. #ifdef __KERNEL__
  178. #ifdef CONFIG_COMPAT
  179. typedef struct sigaltstack32 {
  180. u32 ss_sp;
  181. int ss_flags;
  182. compat_size_t ss_size;
  183. } stack_t32;
  184. #endif
  185. struct signal_deliver_cookie {
  186. int restart_syscall;
  187. unsigned long orig_i0;
  188. };
  189. struct pt_regs;
  190. extern void ptrace_signal_deliver(struct pt_regs *regs, void *cookie);
  191. #endif /* !(__KERNEL__) */
  192. #endif /* !(__ASSEMBLY__) */
  193. #endif /* !(_ASMSPARC64_SIGNAL_H) */