1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <uapi/asm/signal.h>
7 /* Most things should be clean enough to redefine this at will, if care
8 is taken to make libc match. */
12 #define _NSIG_WORDS (_NSIG / _NSIG_BPW)
14 typedef unsigned long old_sigset_t
; /* at least 32 bits */
17 unsigned long sig
[_NSIG_WORDS
];
20 #define __ARCH_HAS_SA_RESTORER
22 #include <asm/sigcontext.h>
24 #ifndef CONFIG_CPU_HAS_NO_BITFIELDS
25 #define __HAVE_ARCH_SIG_BITOPS
27 static inline void sigaddset(sigset_t
*set
, int _sig
)
29 asm ("bfset %0{%1,#1}"
31 : "id" ((_sig
- 1) ^ 31)
35 static inline void sigdelset(sigset_t
*set
, int _sig
)
37 asm ("bfclr %0{%1,#1}"
39 : "id" ((_sig
- 1) ^ 31)
43 static inline int __const_sigismember(sigset_t
*set
, int _sig
)
45 unsigned long sig
= _sig
- 1;
46 return 1 & (set
->sig
[sig
/ _NSIG_BPW
] >> (sig
% _NSIG_BPW
));
49 static inline int __gen_sigismember(sigset_t
*set
, int _sig
)
52 asm ("bfextu %1{%2,#1},%0"
54 : "o" (*set
), "id" ((_sig
-1) ^ 31)
59 #define sigismember(set,sig) \
60 (__builtin_constant_p(sig) ? \
61 __const_sigismember(set,sig) : \
62 __gen_sigismember(set,sig))
64 #endif /* !CONFIG_CPU_HAS_NO_BITFIELDS */
66 #endif /* _M68K_SIGNAL_H */