Skip to content

Commit

Permalink
x86: Add 'l' suffix to btr/bts instructions
Browse files Browse the repository at this point in the history
Add an explicit suffix to the btr/bts instructions within
atomic_test_and_{re,}set_bit. This addition silences the
following assembler warnings:

ktf/include/arch/x86/atomic.h:62: Warning: no instruction mnemonic suffix given and no register operands; using default for `bts'
ktf/include/arch/x86/atomic.h:74: Warning: no instruction mnemonic suffix given and no register operands; using default for `btr'

Signed-off-by: Connor Davis <[email protected]>
  • Loading branch information
cjams authored and 82marbag committed Nov 9, 2021
1 parent 35088f3 commit 5902578
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/arch/x86/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static inline bool atomic_test_bit(unsigned int bit, volatile void *addr) {
static inline bool atomic_test_and_set_bit(unsigned int bit, volatile void *addr) {
bool status;

asm volatile("lock bts %[bit], %[addr];"
asm volatile("lock btsl %[bit], %[addr];"
"setc %[status];"
: [ status ] "=r"(status)
: [ bit ] "Ir"(bit), [ addr ] "m"(*(uint8_t *) addr)
Expand All @@ -71,7 +71,7 @@ static inline bool atomic_test_and_set_bit(unsigned int bit, volatile void *addr
static inline bool atomic_test_and_reset_bit(unsigned int bit, volatile void *addr) {
bool status;

asm volatile("lock btr %[bit], %[addr];"
asm volatile("lock btrl %[bit], %[addr];"
"setc %[status];"
: [ status ] "=r"(status)
: [ bit ] "Ir"(bit), [ addr ] "m"(*(uint8_t *) addr)
Expand Down

0 comments on commit 5902578

Please sign in to comment.