signal.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. #ifndef _UAPI__SPARC_SIGNAL_H
  2. #define _UAPI__SPARC_SIGNAL_H
  3. #include <asm/sigcontext.h>
  4. #include <linux/compiler.h>
  5. /* On the Sparc the signal handlers get passed a 'sub-signal' code
  6. * for certain signal types, which we document here.
  7. */
  8. #define SIGHUP 1
  9. #define SIGINT 2
  10. #define SIGQUIT 3
  11. #define SIGILL 4
  12. #define SUBSIG_STACK 0
  13. #define SUBSIG_ILLINST 2
  14. #define SUBSIG_PRIVINST 3
  15. #define SUBSIG_BADTRAP(t) (0x80 + (t))
  16. #define SIGTRAP 5
  17. #define SIGABRT 6
  18. #define SIGIOT 6
  19. #define SIGEMT 7
  20. #define SUBSIG_TAG 10
  21. #define SIGFPE 8
  22. #define SUBSIG_FPDISABLED 0x400
  23. #define SUBSIG_FPERROR 0x404
  24. #define SUBSIG_FPINTOVFL 0x001
  25. #define SUBSIG_FPSTSIG 0x002
  26. #define SUBSIG_IDIVZERO 0x014
  27. #define SUBSIG_FPINEXACT 0x0c4
  28. #define SUBSIG_FPDIVZERO 0x0c8
  29. #define SUBSIG_FPUNFLOW 0x0cc
  30. #define SUBSIG_FPOPERROR 0x0d0
  31. #define SUBSIG_FPOVFLOW 0x0d4
  32. #define SIGKILL 9
  33. #define SIGBUS 10
  34. #define SUBSIG_BUSTIMEOUT 1
  35. #define SUBSIG_ALIGNMENT 2
  36. #define SUBSIG_MISCERROR 5
  37. #define SIGSEGV 11
  38. #define SUBSIG_NOMAPPING 3
  39. #define SUBSIG_PROTECTION 4
  40. #define SUBSIG_SEGERROR 5
  41. #define SIGSYS 12
  42. #define SIGPIPE 13
  43. #define SIGALRM 14
  44. #define SIGTERM 15
  45. #define SIGURG 16
  46. /* SunOS values which deviate from the Linux/i386 ones */
  47. #define SIGSTOP 17
  48. #define SIGTSTP 18
  49. #define SIGCONT 19
  50. #define SIGCHLD 20
  51. #define SIGTTIN 21
  52. #define SIGTTOU 22
  53. #define SIGIO 23
  54. #define SIGPOLL SIGIO /* SysV name for SIGIO */
  55. #define SIGXCPU 24
  56. #define SIGXFSZ 25
  57. #define SIGVTALRM 26
  58. #define SIGPROF 27
  59. #define SIGWINCH 28
  60. #define SIGLOST 29
  61. #define SIGPWR SIGLOST
  62. #define SIGUSR1 30
  63. #define SIGUSR2 31
  64. /* Most things should be clean enough to redefine this at will, if care
  65. is taken to make libc match. */
  66. #define __OLD_NSIG 32
  67. #define __NEW_NSIG 64
  68. #ifdef __arch64__
  69. #define _NSIG_BPW 64
  70. #else
  71. #define _NSIG_BPW 32
  72. #endif
  73. #define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW)
  74. #define SIGRTMIN 32
  75. #define SIGRTMAX __NEW_NSIG
  76. #if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__)
  77. #define _NSIG __NEW_NSIG
  78. #define __new_sigset_t sigset_t
  79. #define __new_sigaction sigaction
  80. #define __new_sigaction32 sigaction32
  81. #define __old_sigset_t old_sigset_t
  82. #define __old_sigaction old_sigaction
  83. #define __old_sigaction32 old_sigaction32
  84. #else
  85. #define _NSIG __OLD_NSIG
  86. #define NSIG _NSIG
  87. #define __old_sigset_t sigset_t
  88. #define __old_sigaction sigaction
  89. #define __old_sigaction32 sigaction32
  90. #endif
  91. #ifndef __ASSEMBLY__
  92. typedef unsigned long __old_sigset_t; /* at least 32 bits */
  93. typedef struct {
  94. unsigned long sig[_NSIG_WORDS];
  95. } __new_sigset_t;
  96. /* A SunOS sigstack */
  97. struct sigstack {
  98. /* XXX 32-bit pointers pinhead XXX */
  99. char *the_stack;
  100. int cur_status;
  101. };
  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_NODEFER 0x20u
  120. #define SA_NOCLDWAIT 0x100u
  121. #define SA_SIGINFO 0x200u
  122. #define SA_NOMASK SA_NODEFER
  123. #define SIG_BLOCK 0x01 /* for blocking signals */
  124. #define SIG_UNBLOCK 0x02 /* for unblocking signals */
  125. #define SIG_SETMASK 0x04 /* for setting the signal mask */
  126. #define MINSIGSTKSZ 4096
  127. #define SIGSTKSZ 16384
  128. #include <asm-generic/signal-defs.h>
  129. #ifndef __KERNEL__
  130. struct __new_sigaction {
  131. __sighandler_t sa_handler;
  132. unsigned long sa_flags;
  133. __sigrestore_t sa_restorer; /* not used by Linux/SPARC yet */
  134. __new_sigset_t sa_mask;
  135. };
  136. struct __old_sigaction {
  137. __sighandler_t sa_handler;
  138. __old_sigset_t sa_mask;
  139. unsigned long sa_flags;
  140. void (*sa_restorer)(void); /* not used by Linux/SPARC yet */
  141. };
  142. #endif
  143. typedef struct sigaltstack {
  144. void __user *ss_sp;
  145. int ss_flags;
  146. size_t ss_size;
  147. } stack_t;
  148. #endif /* !(__ASSEMBLY__) */
  149. #endif /* _UAPI__SPARC_SIGNAL_H */