signal.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef _M68K_SIGNAL_H
  2. #define _M68K_SIGNAL_H
  3. #include <uapi/asm/signal.h>
  4. /* Most things should be clean enough to redefine this at will, if care
  5. is taken to make libc match. */
  6. #define _NSIG 64
  7. #define _NSIG_BPW 32
  8. #define _NSIG_WORDS (_NSIG / _NSIG_BPW)
  9. typedef unsigned long old_sigset_t; /* at least 32 bits */
  10. typedef struct {
  11. unsigned long sig[_NSIG_WORDS];
  12. } sigset_t;
  13. #define __ARCH_HAS_SA_RESTORER
  14. #include <asm/sigcontext.h>
  15. #ifndef CONFIG_CPU_HAS_NO_BITFIELDS
  16. #define __HAVE_ARCH_SIG_BITOPS
  17. static inline void sigaddset(sigset_t *set, int _sig)
  18. {
  19. asm ("bfset %0{%1,#1}"
  20. : "+o" (*set)
  21. : "id" ((_sig - 1) ^ 31)
  22. : "cc");
  23. }
  24. static inline void sigdelset(sigset_t *set, int _sig)
  25. {
  26. asm ("bfclr %0{%1,#1}"
  27. : "+o" (*set)
  28. : "id" ((_sig - 1) ^ 31)
  29. : "cc");
  30. }
  31. static inline int __const_sigismember(sigset_t *set, int _sig)
  32. {
  33. unsigned long sig = _sig - 1;
  34. return 1 & (set->sig[sig / _NSIG_BPW] >> (sig % _NSIG_BPW));
  35. }
  36. static inline int __gen_sigismember(sigset_t *set, int _sig)
  37. {
  38. int ret;
  39. asm ("bfextu %1{%2,#1},%0"
  40. : "=d" (ret)
  41. : "o" (*set), "id" ((_sig-1) ^ 31)
  42. : "cc");
  43. return ret;
  44. }
  45. #define sigismember(set,sig) \
  46. (__builtin_constant_p(sig) ? \
  47. __const_sigismember(set,sig) : \
  48. __gen_sigismember(set,sig))
  49. #endif /* !CONFIG_CPU_HAS_NO_BITFIELDS */
  50. #ifndef __uClinux__
  51. extern void ptrace_signal_deliver(void);
  52. #define ptrace_signal_deliver ptrace_signal_deliver
  53. #endif /* __uClinux__ */
  54. #endif /* _M68K_SIGNAL_H */