Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 120766
b: refs/heads/master
c: 838e8bb
h: refs/heads/master
v: v3
  • Loading branch information
Uros Bizjak authored and H. Peter Anvin committed Nov 5, 2008
1 parent 7c4d639 commit 122acb3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 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: a376f30a95a796cde81d6dffde0f5243c8bd8f92
refs/heads/master: 838e8bb71dc0c892bf8f84abd3c709d8fe3a8d3c
10 changes: 9 additions & 1 deletion trunk/arch/x86/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,15 @@ static inline void __change_bit(int nr, volatile unsigned long *addr)
*/
static inline void change_bit(int nr, volatile unsigned long *addr)
{
asm volatile(LOCK_PREFIX "btc %1,%0" : ADDR : "Ir" (nr));
if (IS_IMMEDIATE(nr)) {
asm volatile(LOCK_PREFIX "xorb %1,%0"
: CONST_MASK_ADDR(nr, addr)
: "iq" ((u8)CONST_MASK(nr)));
} else {
asm volatile(LOCK_PREFIX "btc %1,%0"
: BITOP_ADDR(addr)
: "Ir" (nr));
}
}

/**
Expand Down

0 comments on commit 122acb3

Please sign in to comment.