signal.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. #ifndef _ASMPPC_SIGNAL_H
  2. #define _ASMPPC_SIGNAL_H
  3. #ifdef __KERNEL__
  4. #include <linux/types.h>
  5. #endif /* __KERNEL__ */
  6. /* Avoid too many header ordering problems. */
  7. struct siginfo;
  8. /* Most things should be clean enough to redefine this at will, if care
  9. is taken to make libc match. */
  10. #define _NSIG 64
  11. #define _NSIG_BPW 32
  12. #define _NSIG_WORDS (_NSIG / _NSIG_BPW)
  13. typedef unsigned long old_sigset_t; /* at least 32 bits */
  14. typedef struct {
  15. unsigned long sig[_NSIG_WORDS];
  16. } sigset_t;
  17. #define SIGHUP 1
  18. #define SIGINT 2
  19. #define SIGQUIT 3
  20. #define SIGILL 4
  21. #define SIGTRAP 5
  22. #define SIGABRT 6
  23. #define SIGIOT 6
  24. #define SIGBUS 7
  25. #define SIGFPE 8
  26. #define SIGKILL 9
  27. #define SIGUSR1 10
  28. #define SIGSEGV 11
  29. #define SIGUSR2 12
  30. #define SIGPIPE 13
  31. #define SIGALRM 14
  32. #define SIGTERM 15
  33. #define SIGSTKFLT 16
  34. #define SIGCHLD 17
  35. #define SIGCONT 18
  36. #define SIGSTOP 19
  37. #define SIGTSTP 20
  38. #define SIGTTIN 21
  39. #define SIGTTOU 22
  40. #define SIGURG 23
  41. #define SIGXCPU 24
  42. #define SIGXFSZ 25
  43. #define SIGVTALRM 26
  44. #define SIGPROF 27
  45. #define SIGWINCH 28
  46. #define SIGIO 29
  47. #define SIGPOLL SIGIO
  48. /*
  49. #define SIGLOST 29
  50. */
  51. #define SIGPWR 30
  52. #define SIGSYS 31
  53. #define SIGUNUSED 31
  54. /* These should not be considered constants from userland. */
  55. #define SIGRTMIN 32
  56. #define SIGRTMAX _NSIG
  57. /*
  58. * SA_FLAGS values:
  59. *
  60. * SA_ONSTACK is not currently supported, but will allow sigaltstack(2).
  61. * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  62. * SA_RESTART flag to get restarting signals (which were the default long ago)
  63. * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  64. * SA_RESETHAND clears the handler when the signal is delivered.
  65. * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
  66. * SA_NODEFER prevents the current signal from being masked in the handler.
  67. *
  68. * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
  69. * Unix names RESETHAND and NODEFER respectively.
  70. */
  71. #define SA_NOCLDSTOP 0x00000001
  72. #define SA_NOCLDWAIT 0x00000002
  73. #define SA_SIGINFO 0x00000004
  74. #define SA_ONSTACK 0x08000000
  75. #define SA_RESTART 0x10000000
  76. #define SA_NODEFER 0x40000000
  77. #define SA_RESETHAND 0x80000000
  78. #define SA_NOMASK SA_NODEFER
  79. #define SA_ONESHOT SA_RESETHAND
  80. #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */
  81. #define SA_RESTORER 0x04000000
  82. /*
  83. * sigaltstack controls
  84. */
  85. #define SS_ONSTACK 1
  86. #define SS_DISABLE 2
  87. #define MINSIGSTKSZ 2048
  88. #define SIGSTKSZ 8192
  89. #define SIG_BLOCK 0 /* for blocking signals */
  90. #define SIG_UNBLOCK 1 /* for unblocking signals */
  91. #define SIG_SETMASK 2 /* for setting the signal mask */
  92. /* Type of a signal handler. */
  93. typedef void __signalfn_t(int);
  94. typedef __signalfn_t __user *__sighandler_t;
  95. typedef void __restorefn_t(void);
  96. typedef __restorefn_t __user *__sigrestore_t;
  97. #define SIG_DFL ((__sighandler_t)0) /* default signal handling */
  98. #define SIG_IGN ((__sighandler_t)1) /* ignore signal */
  99. #define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
  100. struct old_sigaction {
  101. __sighandler_t sa_handler;
  102. old_sigset_t sa_mask;
  103. unsigned long sa_flags;
  104. __sigrestore_t sa_restorer;
  105. };
  106. struct sigaction {
  107. __sighandler_t sa_handler;
  108. unsigned long sa_flags;
  109. __sigrestore_t sa_restorer;
  110. sigset_t sa_mask; /* mask last for extensibility */
  111. };
  112. struct k_sigaction {
  113. struct sigaction sa;
  114. };
  115. typedef struct sigaltstack {
  116. void __user *ss_sp;
  117. int ss_flags;
  118. size_t ss_size;
  119. } stack_t;
  120. #ifdef __KERNEL__
  121. #include <asm/sigcontext.h>
  122. #define ptrace_signal_deliver(regs, cookie) do { } while (0)
  123. #endif /* __KERNEL__ */
  124. /*
  125. * These are parameters to dbg_sigreturn syscall. They enable or
  126. * disable certain debugging things that can be done from signal
  127. * handlers. The dbg_sigreturn syscall *must* be called from a
  128. * SA_SIGINFO signal so the ucontext can be passed to it. It takes an
  129. * array of struct sig_dbg_op, which has the debug operations to
  130. * perform before returning from the signal.
  131. */
  132. struct sig_dbg_op {
  133. int dbg_type;
  134. unsigned long dbg_value;
  135. };
  136. /* Enable or disable single-stepping. The value sets the state. */
  137. #define SIG_DBG_SINGLE_STEPPING 1
  138. /* Enable or disable branch tracing. The value sets the state. */
  139. #define SIG_DBG_BRANCH_TRACING 2
  140. #endif