signal.h 3.4 KB

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