signal.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. /* MN10300 Signal definitions
  2. *
  3. * Copyright (C) 2007 Matsushita Electric Industrial Co., Ltd.
  4. * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public Licence
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the Licence, or (at your option) any later version.
  10. */
  11. #ifndef _ASM_SIGNAL_H
  12. #define _ASM_SIGNAL_H
  13. #include <linux/types.h>
  14. /* Avoid too many header ordering problems. */
  15. struct siginfo;
  16. #ifdef __KERNEL__
  17. /* Most things should be clean enough to redefine this at will, if care
  18. is taken to make libc match. */
  19. #define _NSIG 64
  20. #define _NSIG_BPW 32
  21. #define _NSIG_WORDS (_NSIG / _NSIG_BPW)
  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 0x00000001U
  85. #define SA_NOCLDWAIT 0x00000002U
  86. #define SA_SIGINFO 0x00000004U
  87. #define SA_ONSTACK 0x08000000U
  88. #define SA_RESTART 0x10000000U
  89. #define SA_NODEFER 0x40000000U
  90. #define SA_RESETHAND 0x80000000U
  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. __sigrestore_t sa_restorer;
  108. };
  109. struct sigaction {
  110. __sighandler_t sa_handler;
  111. unsigned long sa_flags;
  112. __sigrestore_t sa_restorer;
  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. #else
  120. /* Here we must cater to libcs that poke about in kernel headers. */
  121. struct sigaction {
  122. union {
  123. __sighandler_t _sa_handler;
  124. void (*_sa_sigaction)(int, struct siginfo *, void *);
  125. } _u;
  126. sigset_t sa_mask;
  127. unsigned long sa_flags;
  128. void (*sa_restorer)(void);
  129. };
  130. #define sa_handler _u._sa_handler
  131. #define sa_sigaction _u._sa_sigaction
  132. #endif /* __KERNEL__ */
  133. typedef struct sigaltstack {
  134. void __user *ss_sp;
  135. int ss_flags;
  136. size_t ss_size;
  137. } stack_t;
  138. #ifdef __KERNEL__
  139. #include <asm/sigcontext.h>
  140. struct pt_regs;
  141. #define ptrace_signal_deliver(regs, cookie) do { } while (0)
  142. #endif /* __KERNEL__ */
  143. #endif /* _ASM_SIGNAL_H */