signal.h 5.7 KB

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