signal_64.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. #ifndef _ASMSPARC64_SIGNAL_H
  2. #define _ASMSPARC64_SIGNAL_H
  3. #include <asm/sigcontext.h>
  4. #ifdef __KERNEL__
  5. #ifndef __ASSEMBLY__
  6. #include <linux/personality.h>
  7. #include <linux/types.h>
  8. #endif
  9. #endif
  10. /* On the Sparc the signal handlers get passed a 'sub-signal' code
  11. * for certain signal types, which we document here.
  12. */
  13. #define SIGHUP 1
  14. #define SIGINT 2
  15. #define SIGQUIT 3
  16. #define SIGILL 4
  17. #define SUBSIG_STACK 0
  18. #define SUBSIG_ILLINST 2
  19. #define SUBSIG_PRIVINST 3
  20. #define SUBSIG_BADTRAP(t) (0x80 + (t))
  21. #define SIGTRAP 5
  22. #define SIGABRT 6
  23. #define SIGIOT 6
  24. #define SIGEMT 7
  25. #define SUBSIG_TAG 10
  26. #define SIGFPE 8
  27. #define SUBSIG_FPDISABLED 0x400
  28. #define SUBSIG_FPERROR 0x404
  29. #define SUBSIG_FPINTOVFL 0x001
  30. #define SUBSIG_FPSTSIG 0x002
  31. #define SUBSIG_IDIVZERO 0x014
  32. #define SUBSIG_FPINEXACT 0x0c4
  33. #define SUBSIG_FPDIVZERO 0x0c8
  34. #define SUBSIG_FPUNFLOW 0x0cc
  35. #define SUBSIG_FPOPERROR 0x0d0
  36. #define SUBSIG_FPOVFLOW 0x0d4
  37. #define SIGKILL 9
  38. #define SIGBUS 10
  39. #define SUBSIG_BUSTIMEOUT 1
  40. #define SUBSIG_ALIGNMENT 2
  41. #define SUBSIG_MISCERROR 5
  42. #define SIGSEGV 11
  43. #define SUBSIG_NOMAPPING 3
  44. #define SUBSIG_PROTECTION 4
  45. #define SUBSIG_SEGERROR 5
  46. #define SIGSYS 12
  47. #define SIGPIPE 13
  48. #define SIGALRM 14
  49. #define SIGTERM 15
  50. #define SIGURG 16
  51. /* SunOS values which deviate from the Linux/i386 ones */
  52. #define SIGSTOP 17
  53. #define SIGTSTP 18
  54. #define SIGCONT 19
  55. #define SIGCHLD 20
  56. #define SIGTTIN 21
  57. #define SIGTTOU 22
  58. #define SIGIO 23
  59. #define SIGPOLL SIGIO /* SysV name for SIGIO */
  60. #define SIGXCPU 24
  61. #define SIGXFSZ 25
  62. #define SIGVTALRM 26
  63. #define SIGPROF 27
  64. #define SIGWINCH 28
  65. #define SIGLOST 29
  66. #define SIGPWR SIGLOST
  67. #define SIGUSR1 30
  68. #define SIGUSR2 31
  69. /* Most things should be clean enough to redefine this at will, if care
  70. is taken to make libc match. */
  71. #define __OLD_NSIG 32
  72. #define __NEW_NSIG 64
  73. #define _NSIG_BPW 64
  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_ONESHOT _SV_RESET
  120. #define SA_NOMASK 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. /*
  127. * sigaltstack controls
  128. */
  129. #define SS_ONSTACK 1
  130. #define SS_DISABLE 2
  131. #define MINSIGSTKSZ 4096
  132. #define SIGSTKSZ 16384
  133. #include <asm-generic/signal.h>
  134. struct __new_sigaction {
  135. __sighandler_t sa_handler;
  136. unsigned long sa_flags;
  137. __sigrestore_t sa_restorer; /* not used by Linux/SPARC yet */
  138. __new_sigset_t sa_mask;
  139. };
  140. struct __old_sigaction {
  141. __sighandler_t sa_handler;
  142. __old_sigset_t sa_mask;
  143. unsigned long sa_flags;
  144. void (*sa_restorer)(void); /* not used by Linux/SPARC yet */
  145. };
  146. typedef struct sigaltstack {
  147. void __user *ss_sp;
  148. int ss_flags;
  149. size_t ss_size;
  150. } stack_t;
  151. #ifdef __KERNEL__
  152. struct k_sigaction {
  153. struct __new_sigaction sa;
  154. void __user *ka_restorer;
  155. };
  156. #define ptrace_signal_deliver(regs, cookie) do { } while (0)
  157. #endif /* !(__KERNEL__) */
  158. #endif /* !(__ASSEMBLY__) */
  159. #endif /* !(_ASMSPARC64_SIGNAL_H) */