signal.h 4.2 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_RESTART flag to get restarting signals (which were the default long ago)
  76. * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  77. * SA_RESETHAND clears the handler when the signal is delivered.
  78. * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
  79. * SA_NODEFER prevents the current signal from being masked in the handler.
  80. *
  81. * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
  82. * Unix names RESETHAND and NODEFER respectively.
  83. */
  84. #define SA_NOCLDSTOP 0x00000001
  85. #define SA_NOCLDWAIT 0x00000002
  86. #define SA_SIGINFO 0x00000004
  87. #define SA_ONSTACK 0x08000000
  88. #define SA_RESTART 0x10000000
  89. #define SA_NODEFER 0x40000000
  90. #define SA_RESETHAND 0x80000000
  91. #define SA_NOMASK SA_NODEFER
  92. #define SA_ONESHOT SA_RESETHAND
  93. #define SA_RESTORER 0x04000000
  94. /*
  95. * sigaltstack controls
  96. */
  97. #define SS_ONSTACK 1
  98. #define SS_DISABLE 2
  99. #define MINSIGSTKSZ 2048
  100. #define SIGSTKSZ 8192
  101. #include <asm-generic/signal-defs.h>
  102. #ifdef __KERNEL__
  103. struct old_sigaction {
  104. __sighandler_t sa_handler;
  105. old_sigset_t sa_mask;
  106. unsigned long sa_flags;
  107. void (*sa_restorer)(void);
  108. };
  109. struct sigaction {
  110. __sighandler_t sa_handler;
  111. unsigned long sa_flags;
  112. void (*sa_restorer)(void);
  113. sigset_t sa_mask; /* mask last for extensibility */
  114. };
  115. #define __ARCH_HAS_SA_RESTORER
  116. struct k_sigaction {
  117. struct sigaction sa;
  118. };
  119. #define ptrace_signal_deliver(regs, cookie) do { } while (0)
  120. #else
  121. /* Here we must cater to libcs that poke about in kernel headers. */
  122. struct sigaction {
  123. union {
  124. __sighandler_t _sa_handler;
  125. void (*_sa_sigaction)(int, struct siginfo *, void *);
  126. } _u;
  127. #ifndef __s390x__ /* lovely */
  128. sigset_t sa_mask;
  129. unsigned long sa_flags;
  130. void (*sa_restorer)(void);
  131. #else /* __s390x__ */
  132. unsigned long sa_flags;
  133. void (*sa_restorer)(void);
  134. sigset_t sa_mask;
  135. #endif /* __s390x__ */
  136. };
  137. #define sa_handler _u._sa_handler
  138. #define sa_sigaction _u._sa_sigaction
  139. #endif /* __KERNEL__ */
  140. typedef struct sigaltstack {
  141. void __user *ss_sp;
  142. int ss_flags;
  143. size_t ss_size;
  144. } stack_t;
  145. #endif