signal.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /*
  2. * Copyright (C) 2004-2006 Atmel Corporation
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #ifndef __ASM_AVR32_SIGNAL_H
  9. #define __ASM_AVR32_SIGNAL_H
  10. #include <linux/types.h>
  11. /* Avoid too many header ordering problems. */
  12. struct siginfo;
  13. #ifdef __KERNEL__
  14. /* Most things should be clean enough to redefine this at will, if care
  15. is taken to make libc match. */
  16. #define _NSIG 64
  17. #define _NSIG_BPW 32
  18. #define _NSIG_WORDS (_NSIG / _NSIG_BPW)
  19. typedef unsigned long old_sigset_t; /* at least 32 bits */
  20. typedef struct {
  21. unsigned long sig[_NSIG_WORDS];
  22. } sigset_t;
  23. #else
  24. /* Here we must cater to libcs that poke about in kernel headers. */
  25. #define NSIG 32
  26. typedef unsigned long sigset_t;
  27. #endif /* __KERNEL__ */
  28. #define SIGHUP 1
  29. #define SIGINT 2
  30. #define SIGQUIT 3
  31. #define SIGILL 4
  32. #define SIGTRAP 5
  33. #define SIGABRT 6
  34. #define SIGIOT 6
  35. #define SIGBUS 7
  36. #define SIGFPE 8
  37. #define SIGKILL 9
  38. #define SIGUSR1 10
  39. #define SIGSEGV 11
  40. #define SIGUSR2 12
  41. #define SIGPIPE 13
  42. #define SIGALRM 14
  43. #define SIGTERM 15
  44. #define SIGSTKFLT 16
  45. #define SIGCHLD 17
  46. #define SIGCONT 18
  47. #define SIGSTOP 19
  48. #define SIGTSTP 20
  49. #define SIGTTIN 21
  50. #define SIGTTOU 22
  51. #define SIGURG 23
  52. #define SIGXCPU 24
  53. #define SIGXFSZ 25
  54. #define SIGVTALRM 26
  55. #define SIGPROF 27
  56. #define SIGWINCH 28
  57. #define SIGIO 29
  58. #define SIGPOLL SIGIO
  59. /*
  60. #define SIGLOST 29
  61. */
  62. #define SIGPWR 30
  63. #define SIGSYS 31
  64. #define SIGUNUSED 31
  65. /* These should not be considered constants from userland. */
  66. #define SIGRTMIN 32
  67. #define SIGRTMAX (_NSIG-1)
  68. /*
  69. * SA_FLAGS values:
  70. *
  71. * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  72. * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
  73. * SA_SIGINFO deliver the signal with SIGINFO structs
  74. * SA_ONSTACK indicates that a registered stack_t will be used.
  75. * SA_RESTART flag to get restarting signals (which were the default long ago)
  76. * SA_NODEFER prevents the current signal from being masked in the handler.
  77. * SA_RESETHAND clears the handler when the signal is delivered.
  78. *
  79. * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
  80. * Unix names RESETHAND and NODEFER respectively.
  81. */
  82. #define SA_NOCLDSTOP 0x00000001
  83. #define SA_NOCLDWAIT 0x00000002
  84. #define SA_SIGINFO 0x00000004
  85. #define SA_RESTORER 0x04000000
  86. #define SA_ONSTACK 0x08000000
  87. #define SA_RESTART 0x10000000
  88. #define SA_NODEFER 0x40000000
  89. #define SA_RESETHAND 0x80000000
  90. #define SA_NOMASK SA_NODEFER
  91. #define SA_ONESHOT SA_RESETHAND
  92. /*
  93. * sigaltstack controls
  94. */
  95. #define SS_ONSTACK 1
  96. #define SS_DISABLE 2
  97. #define MINSIGSTKSZ 2048
  98. #define SIGSTKSZ 8192
  99. #include <asm-generic/signal-defs.h>
  100. #ifdef __KERNEL__
  101. struct old_sigaction {
  102. __sighandler_t sa_handler;
  103. old_sigset_t sa_mask;
  104. unsigned long sa_flags;
  105. __sigrestore_t sa_restorer;
  106. };
  107. struct sigaction {
  108. __sighandler_t sa_handler;
  109. unsigned long sa_flags;
  110. __sigrestore_t sa_restorer;
  111. sigset_t sa_mask; /* mask last for extensibility */
  112. };
  113. #define __ARCH_HAS_SA_RESTORER
  114. struct k_sigaction {
  115. struct sigaction sa;
  116. };
  117. #else
  118. /* Here we must cater to libcs that poke about in kernel headers. */
  119. struct sigaction {
  120. union {
  121. __sighandler_t _sa_handler;
  122. void (*_sa_sigaction)(int, struct siginfo *, void *);
  123. } _u;
  124. sigset_t sa_mask;
  125. unsigned long sa_flags;
  126. void (*sa_restorer)(void);
  127. };
  128. #define sa_handler _u._sa_handler
  129. #define sa_sigaction _u._sa_sigaction
  130. #endif /* __KERNEL__ */
  131. typedef struct sigaltstack {
  132. void __user *ss_sp;
  133. int ss_flags;
  134. size_t ss_size;
  135. } stack_t;
  136. #ifdef __KERNEL__
  137. #include <asm/sigcontext.h>
  138. #undef __HAVE_ARCH_SIG_BITOPS
  139. #define ptrace_signal_deliver(regs, cookie) do { } while (0)
  140. #endif /* __KERNEL__ */
  141. #endif