signal.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. #ifndef _ASMPPC64_SIGNAL_H
  2. #define _ASMPPC64_SIGNAL_H
  3. #include <linux/types.h>
  4. #include <linux/compiler.h>
  5. #include <asm/siginfo.h>
  6. /* Avoid too many header ordering problems. */
  7. struct siginfo;
  8. #define _NSIG 64
  9. #define _NSIG_BPW 64
  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_INTERRUPT is a no-op, but left due to historical reasons. Use the
  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_INTERRUPT 0x20000000u /* dummy -- ignored */
  79. #define SA_RESTORER 0x04000000u
  80. /*
  81. * sigaltstack controls
  82. */
  83. #define SS_ONSTACK 1
  84. #define SS_DISABLE 2
  85. #define MINSIGSTKSZ 2048
  86. #define SIGSTKSZ 8192
  87. #define SIG_BLOCK 0 /* for blocking signals */
  88. #define SIG_UNBLOCK 1 /* for unblocking signals */
  89. #define SIG_SETMASK 2 /* for setting the signal mask */
  90. /* Type of a signal handler. */
  91. typedef void __sigfunction(int);
  92. typedef __sigfunction __user * __sighandler_t;
  93. /* Type of the restorer function */
  94. typedef void __sigrestorer(void);
  95. typedef __sigrestorer __user * __sigrestorer_t;
  96. #define SIG_DFL ((__sighandler_t)0) /* default signal handling */
  97. #define SIG_IGN ((__sighandler_t)1) /* ignore signal */
  98. #define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
  99. struct old_sigaction {
  100. __sighandler_t sa_handler;
  101. old_sigset_t sa_mask;
  102. unsigned long sa_flags;
  103. __sigrestorer_t sa_restorer;
  104. };
  105. struct sigaction {
  106. __sighandler_t sa_handler;
  107. unsigned long sa_flags;
  108. __sigrestorer_t sa_restorer;
  109. sigset_t sa_mask; /* mask last for extensibility */
  110. };
  111. struct k_sigaction {
  112. struct sigaction sa;
  113. };
  114. typedef struct sigaltstack {
  115. void __user *ss_sp;
  116. int ss_flags;
  117. size_t ss_size;
  118. } stack_t;
  119. struct pt_regs;
  120. struct timespec;
  121. extern int do_signal(sigset_t *oldset, struct pt_regs *regs);
  122. extern int do_signal32(sigset_t *oldset, struct pt_regs *regs);
  123. #define ptrace_signal_deliver(regs, cookie) do { } while (0)
  124. #endif /* _ASMPPC64_SIGNAL_H */