signal.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _UAPI__SPARC_SIGNAL_H
  3. #define _UAPI__SPARC_SIGNAL_H
  4. #include <asm/sigcontext.h>
  5. #include <linux/compiler.h>
  6. /* On the Sparc the signal handlers get passed a 'sub-signal' code
  7. * for certain signal types, which we document here.
  8. */
  9. #define SIGHUP 1
  10. #define SIGINT 2
  11. #define SIGQUIT 3
  12. #define SIGILL 4
  13. #define SUBSIG_STACK 0
  14. #define SUBSIG_ILLINST 2
  15. #define SUBSIG_PRIVINST 3
  16. #define SUBSIG_BADTRAP(t) (0x80 + (t))
  17. #define SIGTRAP 5
  18. #define SIGABRT 6
  19. #define SIGIOT 6
  20. #define SIGEMT 7
  21. #define SUBSIG_TAG 10
  22. #define SIGFPE 8
  23. #define SUBSIG_FPDISABLED 0x400
  24. #define SUBSIG_FPERROR 0x404
  25. #define SUBSIG_FPINTOVFL 0x001
  26. #define SUBSIG_FPSTSIG 0x002
  27. #define SUBSIG_IDIVZERO 0x014
  28. #define SUBSIG_FPINEXACT 0x0c4
  29. #define SUBSIG_FPDIVZERO 0x0c8
  30. #define SUBSIG_FPUNFLOW 0x0cc
  31. #define SUBSIG_FPOPERROR 0x0d0
  32. #define SUBSIG_FPOVFLOW 0x0d4
  33. #define SIGKILL 9
  34. #define SIGBUS 10
  35. #define SUBSIG_BUSTIMEOUT 1
  36. #define SUBSIG_ALIGNMENT 2
  37. #define SUBSIG_MISCERROR 5
  38. #define SIGSEGV 11
  39. #define SUBSIG_NOMAPPING 3
  40. #define SUBSIG_PROTECTION 4
  41. #define SUBSIG_SEGERROR 5
  42. #define SIGSYS 12
  43. #define SIGPIPE 13
  44. #define SIGALRM 14
  45. #define SIGTERM 15
  46. #define SIGURG 16
  47. /* SunOS values which deviate from the Linux/i386 ones */
  48. #define SIGSTOP 17
  49. #define SIGTSTP 18
  50. #define SIGCONT 19
  51. #define SIGCHLD 20
  52. #define SIGTTIN 21
  53. #define SIGTTOU 22
  54. #define SIGIO 23
  55. #define SIGPOLL SIGIO /* SysV name for SIGIO */
  56. #define SIGXCPU 24
  57. #define SIGXFSZ 25
  58. #define SIGVTALRM 26
  59. #define SIGPROF 27
  60. #define SIGWINCH 28
  61. #define SIGLOST 29
  62. #define SIGPWR SIGLOST
  63. #define SIGUSR1 30
  64. #define SIGUSR2 31
  65. /* Most things should be clean enough to redefine this at will, if care
  66. is taken to make libc match. */
  67. #define __OLD_NSIG 32
  68. #define __NEW_NSIG 64
  69. #ifdef __arch64__
  70. #define _NSIG_BPW 64
  71. #else
  72. #define _NSIG_BPW 32
  73. #endif
  74. #define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW)
  75. #define SIGRTMIN 32
  76. #define SIGRTMAX __NEW_NSIG
  77. #if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__)
  78. #define _NSIG __NEW_NSIG
  79. #define __new_sigset_t sigset_t
  80. #define __new_sigaction sigaction
  81. #define __new_sigaction32 sigaction32
  82. #define __old_sigset_t old_sigset_t
  83. #define __old_sigaction old_sigaction
  84. #define __old_sigaction32 old_sigaction32
  85. #else
  86. #define _NSIG __OLD_NSIG
  87. #define NSIG _NSIG
  88. #define __old_sigset_t sigset_t
  89. #define __old_sigaction sigaction
  90. #define __old_sigaction32 sigaction32
  91. #endif
  92. #ifndef __ASSEMBLY__
  93. typedef unsigned long __old_sigset_t; /* at least 32 bits */
  94. typedef struct {
  95. unsigned long sig[_NSIG_WORDS];
  96. } __new_sigset_t;
  97. /* A SunOS sigstack */
  98. struct sigstack {
  99. /* XXX 32-bit pointers pinhead XXX */
  100. char *the_stack;
  101. int cur_status;
  102. };
  103. /* Sigvec flags */
  104. #define _SV_SSTACK 1u /* This signal handler should use sig-stack */
  105. #define _SV_INTR 2u /* Sig return should not restart system call */
  106. #define _SV_RESET 4u /* Set handler to SIG_DFL upon taken signal */
  107. #define _SV_IGNCHILD 8u /* Do not send SIGCHLD */
  108. /*
  109. * sa_flags values: SA_STACK is not currently supported, but will allow the
  110. * usage of signal stacks by using the (now obsolete) sa_restorer field in
  111. * the sigaction structure as a stack pointer. This is now possible due to
  112. * the changes in signal handling. LBT 010493.
  113. * SA_RESTART flag to get restarting signals (which were the default long ago)
  114. */
  115. #define SA_NOCLDSTOP _SV_IGNCHILD
  116. #define SA_STACK _SV_SSTACK
  117. #define SA_ONSTACK _SV_SSTACK
  118. #define SA_RESTART _SV_INTR
  119. #define SA_RESETHAND _SV_RESET
  120. #define SA_NODEFER 0x20u
  121. #define SA_NOCLDWAIT 0x100u
  122. #define SA_SIGINFO 0x200u
  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. #include <asm/posix_types.h>
  130. #ifndef __KERNEL__
  131. struct __new_sigaction {
  132. __sighandler_t sa_handler;
  133. unsigned long sa_flags;
  134. __sigrestore_t sa_restorer; /* not used by Linux/SPARC yet */
  135. __new_sigset_t sa_mask;
  136. };
  137. struct __old_sigaction {
  138. __sighandler_t sa_handler;
  139. __old_sigset_t sa_mask;
  140. unsigned long sa_flags;
  141. void (*sa_restorer)(void); /* not used by Linux/SPARC yet */
  142. };
  143. #endif
  144. typedef struct sigaltstack {
  145. void __user *ss_sp;
  146. int ss_flags;
  147. __kernel_size_t ss_size;
  148. } stack_t;
  149. #endif /* !(__ASSEMBLY__) */
  150. #endif /* _UAPI__SPARC_SIGNAL_H */