1 #ifndef _ASM_X86_SIGNAL_H
2 #define _ASM_X86_SIGNAL_H
5 #include <linux/linkage.h>
7 /* Most things should be clean enough to redefine this at will, if care
8 is taken to make libc match. */
18 #define _NSIG_WORDS (_NSIG / _NSIG_BPW)
20 typedef unsigned long old_sigset_t
; /* at least 32 bits */
23 unsigned long sig
[_NSIG_WORDS
];
27 typedef sigset_t compat_sigset_t
;
30 #endif /* __ASSEMBLY__ */
31 #include <uapi/asm/signal.h>
33 extern void do_signal(struct pt_regs
*regs
);
35 #define __ARCH_HAS_SA_RESTORER
37 #include <uapi/asm/sigcontext.h>
41 #define __HAVE_ARCH_SIG_BITOPS
43 #define sigaddset(set,sig) \
44 (__builtin_constant_p(sig) \
45 ? __const_sigaddset((set), (sig)) \
46 : __gen_sigaddset((set), (sig)))
48 static inline void __gen_sigaddset(sigset_t
*set
, int _sig
)
50 asm("btsl %1,%0" : "+m"(*set
) : "Ir"(_sig
- 1) : "cc");
53 static inline void __const_sigaddset(sigset_t
*set
, int _sig
)
55 unsigned long sig
= _sig
- 1;
56 set
->sig
[sig
/ _NSIG_BPW
] |= 1 << (sig
% _NSIG_BPW
);
59 #define sigdelset(set, sig) \
60 (__builtin_constant_p(sig) \
61 ? __const_sigdelset((set), (sig)) \
62 : __gen_sigdelset((set), (sig)))
65 static inline void __gen_sigdelset(sigset_t
*set
, int _sig
)
67 asm("btrl %1,%0" : "+m"(*set
) : "Ir"(_sig
- 1) : "cc");
70 static inline void __const_sigdelset(sigset_t
*set
, int _sig
)
72 unsigned long sig
= _sig
- 1;
73 set
->sig
[sig
/ _NSIG_BPW
] &= ~(1 << (sig
% _NSIG_BPW
));
76 static inline int __const_sigismember(sigset_t
*set
, int _sig
)
78 unsigned long sig
= _sig
- 1;
79 return 1 & (set
->sig
[sig
/ _NSIG_BPW
] >> (sig
% _NSIG_BPW
));
82 static inline int __gen_sigismember(sigset_t
*set
, int _sig
)
85 asm("btl %2,%1\n\tsbbl %0,%0"
86 : "=r"(ret
) : "m"(*set
), "Ir"(_sig
-1) : "cc");
90 #define sigismember(set, sig) \
91 (__builtin_constant_p(sig) \
92 ? __const_sigismember((set), (sig)) \
93 : __gen_sigismember((set), (sig)))
99 #undef __HAVE_ARCH_SIG_BITOPS
101 #endif /* !__i386__ */
103 #endif /* __ASSEMBLY__ */
104 #endif /* _ASM_X86_SIGNAL_H */