signal_32.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. #ifndef _ASMSPARC_SIGNAL_H
  2. #define _ASMSPARC_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. */
  73. #define __OLD_NSIG 32
  74. #define __NEW_NSIG 64
  75. #define _NSIG_BPW 32
  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 __old_sigset_t old_sigset_t
  84. #define __old_sigaction old_sigaction
  85. #else
  86. #define _NSIG __OLD_NSIG
  87. #define __old_sigset_t sigset_t
  88. #define __old_sigaction sigaction
  89. #endif
  90. #ifndef __ASSEMBLY__
  91. typedef unsigned long __old_sigset_t;
  92. typedef struct {
  93. unsigned long sig[_NSIG_WORDS];
  94. } __new_sigset_t;
  95. #ifdef __KERNEL__
  96. /* A SunOS sigstack */
  97. struct sigstack {
  98. char *the_stack;
  99. int cur_status;
  100. };
  101. #endif
  102. /* Sigvec flags */
  103. #define _SV_SSTACK 1u /* This signal handler should use sig-stack */
  104. #define _SV_INTR 2u /* Sig return should not restart system call */
  105. #define _SV_RESET 4u /* Set handler to SIG_DFL upon taken signal */
  106. #define _SV_IGNCHILD 8u /* Do not send SIGCHLD */
  107. /*
  108. * sa_flags values: SA_STACK is not currently supported, but will allow the
  109. * usage of signal stacks by using the (now obsolete) sa_restorer field in
  110. * the sigaction structure as a stack pointer. This is now possible due to
  111. * the changes in signal handling. LBT 010493.
  112. * SA_RESTART flag to get restarting signals (which were the default long ago)
  113. */
  114. #define SA_NOCLDSTOP _SV_IGNCHILD
  115. #define SA_STACK _SV_SSTACK
  116. #define SA_ONSTACK _SV_SSTACK
  117. #define SA_RESTART _SV_INTR
  118. #define SA_ONESHOT _SV_RESET
  119. #define SA_NOMASK 0x20u
  120. #define SA_NOCLDWAIT 0x100u
  121. #define SA_SIGINFO 0x200u
  122. #define SIG_BLOCK 0x01 /* for blocking signals */
  123. #define SIG_UNBLOCK 0x02 /* for unblocking signals */
  124. #define SIG_SETMASK 0x04 /* for setting the signal mask */
  125. /*
  126. * sigaltstack controls
  127. */
  128. #define SS_ONSTACK 1
  129. #define SS_DISABLE 2
  130. #define MINSIGSTKSZ 4096
  131. #define SIGSTKSZ 16384
  132. #ifdef __KERNEL__
  133. /*
  134. * DJHR
  135. * SA_STATIC_ALLOC is used for the SPARC system to indicate that this
  136. * interrupt handler's irq structure should be statically allocated
  137. * by the request_irq routine.
  138. * The alternative is that arch/sparc/kernel/irq.c has carnal knowledge
  139. * of interrupt usage and that sucks. Also without a flag like this
  140. * it may be possible for the free_irq routine to attempt to free
  141. * statically allocated data.. which is NOT GOOD.
  142. *
  143. */
  144. #define SA_STATIC_ALLOC 0x8000
  145. #endif
  146. #include <asm-generic/signal.h>
  147. #ifdef __KERNEL__
  148. struct __new_sigaction {
  149. __sighandler_t sa_handler;
  150. unsigned long sa_flags;
  151. void (*sa_restorer)(void); /* Not used by Linux/SPARC */
  152. __new_sigset_t sa_mask;
  153. };
  154. struct k_sigaction {
  155. struct __new_sigaction sa;
  156. void __user *ka_restorer;
  157. };
  158. struct __old_sigaction {
  159. __sighandler_t sa_handler;
  160. __old_sigset_t sa_mask;
  161. unsigned long sa_flags;
  162. void (*sa_restorer) (void); /* not used by Linux/SPARC */
  163. };
  164. typedef struct sigaltstack {
  165. void __user *ss_sp;
  166. int ss_flags;
  167. size_t ss_size;
  168. } stack_t;
  169. #define ptrace_signal_deliver(regs, cookie) do { } while (0)
  170. #endif /* !(__KERNEL__) */
  171. #endif /* !(__ASSEMBLY__) */
  172. #endif /* !(_ASMSPARC_SIGNAL_H) */