signal.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  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. #ifdef __KERNEL__
  140. /*
  141. * DJHR
  142. * SA_STATIC_ALLOC is used for the SPARC system to indicate that this
  143. * interrupt handler's irq structure should be statically allocated
  144. * by the request_irq routine.
  145. * The alternative is that arch/sparc/kernel/irq.c has carnal knowledge
  146. * of interrupt usage and that sucks. Also without a flag like this
  147. * it may be possible for the free_irq routine to attempt to free
  148. * statically allocated data.. which is NOT GOOD.
  149. *
  150. */
  151. #define SA_STATIC_ALLOC 0x80
  152. #endif
  153. #include <asm-generic/signal.h>
  154. struct __new_sigaction {
  155. __sighandler_t sa_handler;
  156. unsigned long sa_flags;
  157. __sigrestore_t sa_restorer; /* not used by Linux/SPARC yet */
  158. __new_sigset_t sa_mask;
  159. };
  160. #ifdef __KERNEL__
  161. #ifdef CONFIG_COMPAT
  162. struct __new_sigaction32 {
  163. unsigned sa_handler;
  164. unsigned int sa_flags;
  165. unsigned sa_restorer; /* not used by Linux/SPARC yet */
  166. compat_sigset_t sa_mask;
  167. };
  168. #endif
  169. struct k_sigaction {
  170. struct __new_sigaction sa;
  171. void __user *ka_restorer;
  172. };
  173. #endif
  174. struct __old_sigaction {
  175. __sighandler_t sa_handler;
  176. __old_sigset_t sa_mask;
  177. unsigned long sa_flags;
  178. void (*sa_restorer)(void); /* not used by Linux/SPARC yet */
  179. };
  180. #ifdef __KERNEL__
  181. #ifdef CONFIG_COMPAT
  182. struct __old_sigaction32 {
  183. unsigned sa_handler;
  184. compat_old_sigset_t sa_mask;
  185. unsigned int sa_flags;
  186. unsigned sa_restorer; /* not used by Linux/SPARC yet */
  187. };
  188. #endif
  189. #endif
  190. typedef struct sigaltstack {
  191. void __user *ss_sp;
  192. int ss_flags;
  193. size_t ss_size;
  194. } stack_t;
  195. #ifdef __KERNEL__
  196. #ifdef CONFIG_COMPAT
  197. typedef struct sigaltstack32 {
  198. u32 ss_sp;
  199. int ss_flags;
  200. compat_size_t ss_size;
  201. } stack_t32;
  202. #endif
  203. struct signal_deliver_cookie {
  204. int restart_syscall;
  205. unsigned long orig_i0;
  206. };
  207. struct pt_regs;
  208. extern void ptrace_signal_deliver(struct pt_regs *regs, void *cookie);
  209. #endif /* !(__KERNEL__) */
  210. #endif /* !(__ASSEMBLY__) */
  211. #endif /* !(_ASMSPARC64_SIGNAL_H) */