signal.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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. #include <asm-generic/signal.h>
  90. struct old_sigaction {
  91. __sighandler_t sa_handler;
  92. old_sigset_t sa_mask;
  93. unsigned long sa_flags;
  94. __sigrestore_t sa_restorer;
  95. };
  96. struct sigaction {
  97. __sighandler_t sa_handler;
  98. unsigned long sa_flags;
  99. __sigrestore_t sa_restorer;
  100. sigset_t sa_mask; /* mask last for extensibility */
  101. };
  102. struct k_sigaction {
  103. struct sigaction sa;
  104. };
  105. typedef struct sigaltstack {
  106. void __user *ss_sp;
  107. int ss_flags;
  108. size_t ss_size;
  109. } stack_t;
  110. #ifdef __KERNEL__
  111. #include <asm/sigcontext.h>
  112. #define ptrace_signal_deliver(regs, cookie) do { } while (0)
  113. #endif /* __KERNEL__ */
  114. /*
  115. * These are parameters to dbg_sigreturn syscall. They enable or
  116. * disable certain debugging things that can be done from signal
  117. * handlers. The dbg_sigreturn syscall *must* be called from a
  118. * SA_SIGINFO signal so the ucontext can be passed to it. It takes an
  119. * array of struct sig_dbg_op, which has the debug operations to
  120. * perform before returning from the signal.
  121. */
  122. struct sig_dbg_op {
  123. int dbg_type;
  124. unsigned long dbg_value;
  125. };
  126. /* Enable or disable single-stepping. The value sets the state. */
  127. #define SIG_DBG_SINGLE_STEPPING 1
  128. /* Enable or disable branch tracing. The value sets the state. */
  129. #define SIG_DBG_BRANCH_TRACING 2
  130. #endif