iwlwifi: mvm: fix version check for GEO_TX_POWER_LIMIT support
[linux/fpc-iii.git] / arch / x86 / include / asm / signal.h
blob33d3c88a7225ff938d81c8912d5ec05457b07e60
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_X86_SIGNAL_H
3 #define _ASM_X86_SIGNAL_H
5 #ifndef __ASSEMBLY__
6 #include <linux/linkage.h>
8 /* Most things should be clean enough to redefine this at will, if care
9 is taken to make libc match. */
11 #define _NSIG 64
13 #ifdef __i386__
14 # define _NSIG_BPW 32
15 #else
16 # define _NSIG_BPW 64
17 #endif
19 #define _NSIG_WORDS (_NSIG / _NSIG_BPW)
21 typedef unsigned long old_sigset_t; /* at least 32 bits */
23 typedef struct {
24 unsigned long sig[_NSIG_WORDS];
25 } sigset_t;
27 /* non-uapi in-kernel SA_FLAGS for those indicates ABI for a signal frame */
28 #define SA_IA32_ABI 0x02000000u
29 #define SA_X32_ABI 0x01000000u
31 #ifndef CONFIG_COMPAT
32 typedef sigset_t compat_sigset_t;
33 #endif
35 #endif /* __ASSEMBLY__ */
36 #include <uapi/asm/signal.h>
37 #ifndef __ASSEMBLY__
38 extern void do_signal(struct pt_regs *regs);
40 #define __ARCH_HAS_SA_RESTORER
42 #include <asm/asm.h>
43 #include <uapi/asm/sigcontext.h>
45 #ifdef __i386__
47 #define __HAVE_ARCH_SIG_BITOPS
49 #define sigaddset(set,sig) \
50 (__builtin_constant_p(sig) \
51 ? __const_sigaddset((set), (sig)) \
52 : __gen_sigaddset((set), (sig)))
54 static inline void __gen_sigaddset(sigset_t *set, int _sig)
56 asm("btsl %1,%0" : "+m"(*set) : "Ir"(_sig - 1) : "cc");
59 static inline void __const_sigaddset(sigset_t *set, int _sig)
61 unsigned long sig = _sig - 1;
62 set->sig[sig / _NSIG_BPW] |= 1 << (sig % _NSIG_BPW);
65 #define sigdelset(set, sig) \
66 (__builtin_constant_p(sig) \
67 ? __const_sigdelset((set), (sig)) \
68 : __gen_sigdelset((set), (sig)))
71 static inline void __gen_sigdelset(sigset_t *set, int _sig)
73 asm("btrl %1,%0" : "+m"(*set) : "Ir"(_sig - 1) : "cc");
76 static inline void __const_sigdelset(sigset_t *set, int _sig)
78 unsigned long sig = _sig - 1;
79 set->sig[sig / _NSIG_BPW] &= ~(1 << (sig % _NSIG_BPW));
82 static inline int __const_sigismember(sigset_t *set, int _sig)
84 unsigned long sig = _sig - 1;
85 return 1 & (set->sig[sig / _NSIG_BPW] >> (sig % _NSIG_BPW));
88 static inline int __gen_sigismember(sigset_t *set, int _sig)
90 bool ret;
91 asm("btl %2,%1" CC_SET(c)
92 : CC_OUT(c) (ret) : "m"(*set), "Ir"(_sig-1));
93 return ret;
96 #define sigismember(set, sig) \
97 (__builtin_constant_p(sig) \
98 ? __const_sigismember((set), (sig)) \
99 : __gen_sigismember((set), (sig)))
101 struct pt_regs;
103 #else /* __i386__ */
105 #undef __HAVE_ARCH_SIG_BITOPS
107 #endif /* !__i386__ */
109 #endif /* __ASSEMBLY__ */
110 #endif /* _ASM_X86_SIGNAL_H */