signal.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. #ifndef _ASMPPC_SIGNAL_H
  2. #define _ASMPPC_SIGNAL_H
  3. #include <linux/types.h>
  4. /* Avoid too many header ordering problems. */
  5. struct siginfo;
  6. /* Most things should be clean enough to redefine this at will, if care
  7. is taken to make libc match. */
  8. #define _NSIG 64
  9. #define _NSIG_BPW 32
  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-1)
  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 0x00000001
  70. #define SA_NOCLDWAIT 0x00000002 /* not supported yet */
  71. #define SA_SIGINFO 0x00000004
  72. #define SA_ONSTACK 0x08000000
  73. #define SA_RESTART 0x10000000
  74. #define SA_NODEFER 0x40000000
  75. #define SA_RESETHAND 0x80000000
  76. #define SA_NOMASK SA_NODEFER
  77. #define SA_ONESHOT SA_RESETHAND
  78. #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */
  79. #define SA_RESTORER 0x04000000
  80. /*
  81. * sigaltstack controls
  82. */
  83. #define SS_ONSTACK 1
  84. #define SS_DISABLE 2
  85. #define MINSIGSTKSZ 2048
  86. #define SIGSTKSZ 8192
  87. #ifdef __KERNEL__
  88. /*
  89. * These values of sa_flags are used only by the kernel as part of the
  90. * irq handling routines.
  91. *
  92. * SA_INTERRUPT is also used by the irq handling routines.
  93. * SA_SHIRQ is for shared interrupt support on PCI and EISA.
  94. */
  95. #define SA_PROBE SA_ONESHOT
  96. #define SA_SAMPLE_RANDOM SA_RESTART
  97. #define SA_SHIRQ 0x04000000
  98. #endif
  99. #define SIG_BLOCK 0 /* for blocking signals */
  100. #define SIG_UNBLOCK 1 /* for unblocking signals */
  101. #define SIG_SETMASK 2 /* for setting the signal mask */
  102. /* Type of a signal handler. */
  103. typedef void (*__sighandler_t)(int);
  104. #define SIG_DFL ((__sighandler_t)0) /* default signal handling */
  105. #define SIG_IGN ((__sighandler_t)1) /* ignore signal */
  106. #define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
  107. struct old_sigaction {
  108. __sighandler_t sa_handler;
  109. old_sigset_t sa_mask;
  110. unsigned long sa_flags;
  111. void (*sa_restorer)(void);
  112. };
  113. struct sigaction {
  114. __sighandler_t sa_handler;
  115. unsigned long sa_flags;
  116. void (*sa_restorer)(void);
  117. sigset_t sa_mask; /* mask last for extensibility */
  118. };
  119. struct k_sigaction {
  120. struct sigaction sa;
  121. };
  122. typedef struct sigaltstack {
  123. void *ss_sp;
  124. int ss_flags;
  125. size_t ss_size;
  126. } stack_t;
  127. #ifdef __KERNEL__
  128. #include <asm/sigcontext.h>
  129. #endif
  130. #endif