signal.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. /*
  2. * include/asm-s390/signal.h
  3. *
  4. * S390 version
  5. *
  6. * Derived from "include/asm-i386/signal.h"
  7. */
  8. #ifndef _ASMS390_SIGNAL_H
  9. #define _ASMS390_SIGNAL_H
  10. #include <linux/types.h>
  11. #include <linux/time.h>
  12. /* Avoid too many header ordering problems. */
  13. struct siginfo;
  14. struct pt_regs;
  15. #ifdef __KERNEL__
  16. /* Most things should be clean enough to redefine this at will, if care
  17. is taken to make libc match. */
  18. #include <asm/sigcontext.h>
  19. #define _NSIG _SIGCONTEXT_NSIG
  20. #define _NSIG_BPW _SIGCONTEXT_NSIG_BPW
  21. #define _NSIG_WORDS _SIGCONTEXT_NSIG_WORDS
  22. typedef unsigned long old_sigset_t; /* at least 32 bits */
  23. typedef struct {
  24. unsigned long sig[_NSIG_WORDS];
  25. } sigset_t;
  26. #else
  27. /* Here we must cater to libcs that poke about in kernel headers. */
  28. #define NSIG 32
  29. typedef unsigned long sigset_t;
  30. #endif /* __KERNEL__ */
  31. #define SIGHUP 1
  32. #define SIGINT 2
  33. #define SIGQUIT 3
  34. #define SIGILL 4
  35. #define SIGTRAP 5
  36. #define SIGABRT 6
  37. #define SIGIOT 6
  38. #define SIGBUS 7
  39. #define SIGFPE 8
  40. #define SIGKILL 9
  41. #define SIGUSR1 10
  42. #define SIGSEGV 11
  43. #define SIGUSR2 12
  44. #define SIGPIPE 13
  45. #define SIGALRM 14
  46. #define SIGTERM 15
  47. #define SIGSTKFLT 16
  48. #define SIGCHLD 17
  49. #define SIGCONT 18
  50. #define SIGSTOP 19
  51. #define SIGTSTP 20
  52. #define SIGTTIN 21
  53. #define SIGTTOU 22
  54. #define SIGURG 23
  55. #define SIGXCPU 24
  56. #define SIGXFSZ 25
  57. #define SIGVTALRM 26
  58. #define SIGPROF 27
  59. #define SIGWINCH 28
  60. #define SIGIO 29
  61. #define SIGPOLL SIGIO
  62. /*
  63. #define SIGLOST 29
  64. */
  65. #define SIGPWR 30
  66. #define SIGSYS 31
  67. #define SIGUNUSED 31
  68. /* These should not be considered constants from userland. */
  69. #define SIGRTMIN 32
  70. #define SIGRTMAX _NSIG
  71. /*
  72. * SA_FLAGS values:
  73. *
  74. * SA_ONSTACK indicates that a registered stack_t will be used.
  75. * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  76. * SA_RESTART flag to get restarting signals (which were the default long ago)
  77. * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  78. * SA_RESETHAND clears the handler when the signal is delivered.
  79. * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
  80. * SA_NODEFER prevents the current signal from being masked in the handler.
  81. *
  82. * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
  83. * Unix names RESETHAND and NODEFER respectively.
  84. */
  85. #define SA_NOCLDSTOP 0x00000001
  86. #define SA_NOCLDWAIT 0x00000002
  87. #define SA_SIGINFO 0x00000004
  88. #define SA_ONSTACK 0x08000000
  89. #define SA_RESTART 0x10000000
  90. #define SA_NODEFER 0x40000000
  91. #define SA_RESETHAND 0x80000000
  92. #define SA_NOMASK SA_NODEFER
  93. #define SA_ONESHOT SA_RESETHAND
  94. #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */
  95. #define SA_RESTORER 0x04000000
  96. /*
  97. * sigaltstack controls
  98. */
  99. #define SS_ONSTACK 1
  100. #define SS_DISABLE 2
  101. #define MINSIGSTKSZ 2048
  102. #define SIGSTKSZ 8192
  103. #include <asm-generic/signal.h>
  104. #ifdef __KERNEL__
  105. struct old_sigaction {
  106. __sighandler_t sa_handler;
  107. old_sigset_t sa_mask;
  108. unsigned long sa_flags;
  109. void (*sa_restorer)(void);
  110. };
  111. struct sigaction {
  112. __sighandler_t sa_handler;
  113. unsigned long sa_flags;
  114. void (*sa_restorer)(void);
  115. sigset_t sa_mask; /* mask last for extensibility */
  116. };
  117. struct k_sigaction {
  118. struct sigaction sa;
  119. };
  120. #define ptrace_signal_deliver(regs, cookie) do { } while (0)
  121. #else
  122. /* Here we must cater to libcs that poke about in kernel headers. */
  123. struct sigaction {
  124. union {
  125. __sighandler_t _sa_handler;
  126. void (*_sa_sigaction)(int, struct siginfo *, void *);
  127. } _u;
  128. #ifndef __s390x__ /* lovely */
  129. sigset_t sa_mask;
  130. unsigned long sa_flags;
  131. void (*sa_restorer)(void);
  132. #else /* __s390x__ */
  133. unsigned long sa_flags;
  134. void (*sa_restorer)(void);
  135. sigset_t sa_mask;
  136. #endif /* __s390x__ */
  137. };
  138. #define sa_handler _u._sa_handler
  139. #define sa_sigaction _u._sa_sigaction
  140. #endif /* __KERNEL__ */
  141. typedef struct sigaltstack {
  142. void __user *ss_sp;
  143. int ss_flags;
  144. size_t ss_size;
  145. } stack_t;
  146. #endif