signal.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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_INTERRUPT is a no-op, but left due to historical reasons. Use the
  116. * SA_RESTART flag to get restarting signals (which were the default long ago)
  117. * SA_SHIRQ flag is for shared interrupt support on PCI and EISA.
  118. */
  119. #define SA_NOCLDSTOP _SV_IGNCHILD
  120. #define SA_STACK _SV_SSTACK
  121. #define SA_ONSTACK _SV_SSTACK
  122. #define SA_RESTART _SV_INTR
  123. #define SA_ONESHOT _SV_RESET
  124. #define SA_INTERRUPT 0x10u
  125. #define SA_NOMASK 0x20u
  126. #define SA_NOCLDWAIT 0x100u
  127. #define SA_SIGINFO 0x200u
  128. #define SIG_BLOCK 0x01 /* for blocking signals */
  129. #define SIG_UNBLOCK 0x02 /* for unblocking signals */
  130. #define SIG_SETMASK 0x04 /* for setting the signal mask */
  131. /*
  132. * sigaltstack controls
  133. */
  134. #define SS_ONSTACK 1
  135. #define SS_DISABLE 2
  136. #define MINSIGSTKSZ 4096
  137. #define SIGSTKSZ 16384
  138. #include <asm-generic/signal.h>
  139. struct __new_sigaction {
  140. __sighandler_t sa_handler;
  141. unsigned long sa_flags;
  142. __sigrestore_t sa_restorer; /* not used by Linux/SPARC yet */
  143. __new_sigset_t sa_mask;
  144. };
  145. #ifdef __KERNEL__
  146. #ifdef CONFIG_COMPAT
  147. struct __new_sigaction32 {
  148. unsigned sa_handler;
  149. unsigned int sa_flags;
  150. unsigned sa_restorer; /* not used by Linux/SPARC yet */
  151. compat_sigset_t sa_mask;
  152. };
  153. #endif
  154. struct k_sigaction {
  155. struct __new_sigaction sa;
  156. void __user *ka_restorer;
  157. };
  158. #endif
  159. struct __old_sigaction {
  160. __sighandler_t sa_handler;
  161. __old_sigset_t sa_mask;
  162. unsigned long sa_flags;
  163. void (*sa_restorer)(void); /* not used by Linux/SPARC yet */
  164. };
  165. #ifdef __KERNEL__
  166. #ifdef CONFIG_COMPAT
  167. struct __old_sigaction32 {
  168. unsigned sa_handler;
  169. compat_old_sigset_t sa_mask;
  170. unsigned int sa_flags;
  171. unsigned sa_restorer; /* not used by Linux/SPARC yet */
  172. };
  173. #endif
  174. #endif
  175. typedef struct sigaltstack {
  176. void __user *ss_sp;
  177. int ss_flags;
  178. size_t ss_size;
  179. } stack_t;
  180. #ifdef __KERNEL__
  181. #ifdef CONFIG_COMPAT
  182. typedef struct sigaltstack32 {
  183. u32 ss_sp;
  184. int ss_flags;
  185. compat_size_t ss_size;
  186. } stack_t32;
  187. #endif
  188. struct signal_deliver_cookie {
  189. int restart_syscall;
  190. unsigned long orig_i0;
  191. };
  192. struct pt_regs;
  193. extern void ptrace_signal_deliver(struct pt_regs *regs, void *cookie);
  194. #endif /* !(__KERNEL__) */
  195. #endif /* !(__ASSEMBLY__) */
  196. #endif /* !(_ASMSPARC64_SIGNAL_H) */