summaryrefslogtreecommitdiffstats
path: root/include/asm-i386/signal.h
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2005-11-21 06:56:52 -0800
committerDave Jones <davej@redhat.com>2005-11-21 06:56:52 -0800
commite7e37ee9c547213d726b29c2510cbb6696050405 (patch)
tree50c45625de666b23f209d79eb1bfae05c64feee9 /include/asm-i386/signal.h
parentc243f1f1f6545985afcc6adf1fc085729029c3ee (diff)
parentdb93a82fa9d8b4d6e31c227922eaae829253bb88 (diff)
downloadop-kernel-dev-e7e37ee9c547213d726b29c2510cbb6696050405.zip
op-kernel-dev-e7e37ee9c547213d726b29c2510cbb6696050405.tar.gz
Merge ../linus/
Diffstat (limited to 'include/asm-i386/signal.h')
-rw-r--r--include/asm-i386/signal.h31
1 files changed, 27 insertions, 4 deletions
diff --git a/include/asm-i386/signal.h b/include/asm-i386/signal.h
index cbb47d3..76524b4 100644
--- a/include/asm-i386/signal.h
+++ b/include/asm-i386/signal.h
@@ -159,14 +159,37 @@ typedef struct sigaltstack {
#define __HAVE_ARCH_SIG_BITOPS
-static __inline__ void sigaddset(sigset_t *set, int _sig)
+#define sigaddset(set,sig) \
+ (__builtin_constant_p(sig) ? \
+ __const_sigaddset((set),(sig)) : \
+ __gen_sigaddset((set),(sig)))
+
+static __inline__ void __gen_sigaddset(sigset_t *set, int _sig)
{
- __asm__("btsl %1,%0" : "=m"(*set) : "Ir"(_sig - 1) : "cc");
+ __asm__("btsl %1,%0" : "+m"(*set) : "Ir"(_sig - 1) : "cc");
}
-static __inline__ void sigdelset(sigset_t *set, int _sig)
+static __inline__ void __const_sigaddset(sigset_t *set, int _sig)
{
- __asm__("btrl %1,%0" : "=m"(*set) : "Ir"(_sig - 1) : "cc");
+ unsigned long sig = _sig - 1;
+ set->sig[sig / _NSIG_BPW] |= 1 << (sig % _NSIG_BPW);
+}
+
+#define sigdelset(set,sig) \
+ (__builtin_constant_p(sig) ? \
+ __const_sigdelset((set),(sig)) : \
+ __gen_sigdelset((set),(sig)))
+
+
+static __inline__ void __gen_sigdelset(sigset_t *set, int _sig)
+{
+ __asm__("btrl %1,%0" : "+m"(*set) : "Ir"(_sig - 1) : "cc");
+}
+
+static __inline__ void __const_sigdelset(sigset_t *set, int _sig)
+{
+ unsigned long sig = _sig - 1;
+ set->sig[sig / _NSIG_BPW] &= ~(1 << (sig % _NSIG_BPW));
}
static __inline__ int __const_sigismember(sigset_t *set, int _sig)
OpenPOWER on IntegriCloud