Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14280
b: refs/heads/master
c: b7fd1ed
h: refs/heads/master
v: v3
  • Loading branch information
Constantine Gavrilov authored and Linus Torvalds committed Nov 17, 2005
1 parent 8e94f2f commit d127fed
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3b26b1100e26811e54770abaa221eae140ba840d
refs/heads/master: b7fd1edd2c0c225afa96af92d4adecb91e7d439d
31 changes: 27 additions & 4 deletions trunk/include/asm-i386/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_sigaddset(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)
Expand Down

0 comments on commit d127fed

Please sign in to comment.