signal.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. #ifndef __SPARC_SIGNAL_H
  2. #define __SPARC_SIGNAL_H
  3. #include <asm/sigcontext.h>
  4. #include <linux/compiler.h>
  5. #ifdef __KERNEL__
  6. #ifndef __ASSEMBLY__
  7. #include <linux/personality.h>
  8. #include <linux/types.h>
  9. #endif
  10. #endif
  11. /* On the Sparc the signal handlers get passed a 'sub-signal' code
  12. * for certain signal types, which we document here.
  13. */
  14. #define SIGHUP 1
  15. #define SIGINT 2
  16. #define SIGQUIT 3
  17. #define SIGILL 4
  18. #define SUBSIG_STACK 0
  19. #define SUBSIG_ILLINST 2
  20. #define SUBSIG_PRIVINST 3
  21. #define SUBSIG_BADTRAP(t) (0x80 + (t))
  22. #define SIGTRAP 5
  23. #define SIGABRT 6
  24. #define SIGIOT 6
  25. #define SIGEMT 7
  26. #define SUBSIG_TAG 10
  27. #define SIGFPE 8
  28. #define SUBSIG_FPDISABLED 0x400
  29. #define SUBSIG_FPERROR 0x404
  30. #define SUBSIG_FPINTOVFL 0x001
  31. #define SUBSIG_FPSTSIG 0x002
  32. #define SUBSIG_IDIVZERO 0x014
  33. #define SUBSIG_FPINEXACT 0x0c4
  34. #define SUBSIG_FPDIVZERO 0x0c8
  35. #define SUBSIG_FPUNFLOW 0x0cc
  36. #define SUBSIG_FPOPERROR 0x0d0
  37. #define SUBSIG_FPOVFLOW 0x0d4
  38. #define SIGKILL 9
  39. #define SIGBUS 10
  40. #define SUBSIG_BUSTIMEOUT 1
  41. #define SUBSIG_ALIGNMENT 2
  42. #define SUBSIG_MISCERROR 5
  43. #define SIGSEGV 11
  44. #define SUBSIG_NOMAPPING 3
  45. #define SUBSIG_PROTECTION 4
  46. #define SUBSIG_SEGERROR 5
  47. #define SIGSYS 12
  48. #define SIGPIPE 13
  49. #define SIGALRM 14
  50. #define SIGTERM 15
  51. #define SIGURG 16
  52. /* SunOS values which deviate from the Linux/i386 ones */
  53. #define SIGSTOP 17
  54. #define SIGTSTP 18
  55. #define SIGCONT 19
  56. #define SIGCHLD 20
  57. #define SIGTTIN 21
  58. #define SIGTTOU 22
  59. #define SIGIO 23
  60. #define SIGPOLL SIGIO /* SysV name for SIGIO */
  61. #define SIGXCPU 24
  62. #define SIGXFSZ 25
  63. #define SIGVTALRM 26
  64. #define SIGPROF 27
  65. #define SIGWINCH 28
  66. #define SIGLOST 29
  67. #define SIGPWR SIGLOST
  68. #define SIGUSR1 30
  69. #define SIGUSR2 31
  70. /* Most things should be clean enough to redefine this at will, if care
  71. is taken to make libc match. */
  72. #define __OLD_NSIG 32
  73. #define __NEW_NSIG 64
  74. #ifdef __arch64__
  75. #define _NSIG_BPW 64
  76. #else
  77. #define _NSIG_BPW 32
  78. #endif
  79. #define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW)
  80. #define SIGRTMIN 32
  81. #define SIGRTMAX __NEW_NSIG
  82. #if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__)
  83. #define _NSIG __NEW_NSIG
  84. #define __new_sigset_t sigset_t
  85. #define __new_sigaction sigaction
  86. #define __new_sigaction32 sigaction32
  87. #define __old_sigset_t old_sigset_t
  88. #define __old_sigaction old_sigaction
  89. #define __old_sigaction32 old_sigaction32
  90. #else
  91. #define _NSIG __OLD_NSIG
  92. #define NSIG _NSIG
  93. #define __old_sigset_t sigset_t
  94. #define __old_sigaction sigaction
  95. #define __old_sigaction32 sigaction32
  96. #endif
  97. #ifndef __ASSEMBLY__
  98. typedef unsigned long __old_sigset_t; /* at least 32 bits */
  99. typedef struct {
  100. unsigned long sig[_NSIG_WORDS];
  101. } __new_sigset_t;
  102. /* A SunOS sigstack */
  103. struct sigstack {
  104. /* XXX 32-bit pointers pinhead XXX */
  105. char *the_stack;
  106. int cur_status;
  107. };
  108. /* Sigvec flags */
  109. #define _SV_SSTACK 1u /* This signal handler should use sig-stack */
  110. #define _SV_INTR 2u /* Sig return should not restart system call */
  111. #define _SV_RESET 4u /* Set handler to SIG_DFL upon taken signal */
  112. #define _SV_IGNCHILD 8u /* Do not send SIGCHLD */
  113. /*
  114. * sa_flags values: SA_STACK is not currently supported, but will allow the
  115. * usage of signal stacks by using the (now obsolete) sa_restorer field in
  116. * the sigaction structure as a stack pointer. This is now possible due to
  117. * the changes in signal handling. LBT 010493.
  118. * SA_RESTART flag to get restarting signals (which were the default long ago)
  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_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. #ifdef __KERNEL__
  139. /*
  140. * DJHR
  141. * SA_STATIC_ALLOC is used for the sparc32 system to indicate that this
  142. * interrupt handler's irq structure should be statically allocated
  143. * by the request_irq routine.
  144. * The alternative is that arch/sparc/kernel/irq.c has carnal knowledge
  145. * of interrupt usage and that sucks. Also without a flag like this
  146. * it may be possible for the free_irq routine to attempt to free
  147. * statically allocated data.. which is NOT GOOD.
  148. *
  149. */
  150. #define SA_STATIC_ALLOC 0x8000
  151. #endif
  152. #include <asm-generic/signal-defs.h>
  153. struct __new_sigaction {
  154. __sighandler_t sa_handler;
  155. unsigned long sa_flags;
  156. __sigrestore_t sa_restorer; /* not used by Linux/SPARC yet */
  157. __new_sigset_t sa_mask;
  158. };
  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. typedef struct sigaltstack {
  166. void __user *ss_sp;
  167. int ss_flags;
  168. size_t ss_size;
  169. } stack_t;
  170. #ifdef __KERNEL__
  171. struct k_sigaction {
  172. struct __new_sigaction sa;
  173. void __user *ka_restorer;
  174. };
  175. #define ptrace_signal_deliver(regs, cookie) do { } while (0)
  176. #endif /* !(__KERNEL__) */
  177. #endif /* !(__ASSEMBLY__) */
  178. #endif /* !(__SPARC_SIGNAL_H) */