signal.h 3.3 KB

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