aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2021-02-27 15:05:20 +0000
committerMichael Brown <mcb30@ipxe.org>2021-02-27 15:45:31 +0000
commit16d95227a4b92bba068b43070545b96ce0a90e14 (patch)
treee07a225e5a96f54c2994d652090d338e22bf9e99
parentb76281a8855632df7cc20ad9174e55e29dc6ce67 (diff)
downloadipxe-16d95227a4b92bba068b43070545b96ce0a90e14.zip
ipxe-16d95227a4b92bba068b43070545b96ce0a90e14.tar.gz
ipxe-16d95227a4b92bba068b43070545b96ce0a90e14.tar.bz2
[bitops] Provide an explicit operand size for bit test instructions
Recent versions of the GNU assembler (observed with GNU as 2.35 on Fedora 33) will produce a warning message Warning: no instruction mnemonic suffix given and no register operands; using default for `bts' The operand size affects only the potential range for the bit number. Since we pass the bit number as an unsigned int, it is already constrained to 32 bits for both i386 and x86_64. Silence the assembler warning by specifying an explicit 32-bit operand size (and thereby matching the choice that the assembler would otherwise make automatically). Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--src/arch/x86/include/bits/bitops.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/arch/x86/include/bits/bitops.h b/src/arch/x86/include/bits/bitops.h
index 17dcf10..f697b8c 100644
--- a/src/arch/x86/include/bits/bitops.h
+++ b/src/arch/x86/include/bits/bitops.h
@@ -29,7 +29,7 @@ set_bit ( unsigned int bit, volatile void *bits ) {
uint8_t byte[ ( bit / 8 ) + 1 ];
} *bytes = bits;
- __asm__ __volatile__ ( "lock bts %1, %0"
+ __asm__ __volatile__ ( "lock btsl %k1, %0"
: "+m" ( *bytes ) : "Ir" ( bit ) );
}
@@ -45,7 +45,7 @@ clear_bit ( unsigned int bit, volatile void *bits ) {
uint8_t byte[ ( bit / 8 ) + 1 ];
} *bytes = bits;
- __asm__ __volatile__ ( "lock btr %1, %0"
+ __asm__ __volatile__ ( "lock btrl %k1, %0"
: "+m" ( *bytes ) : "Ir" ( bit ) );
}
@@ -63,7 +63,7 @@ test_and_set_bit ( unsigned int bit, volatile void *bits ) {
} *bytes = bits;
int old;
- __asm__ __volatile__ ( "lock bts %2, %0\n\t"
+ __asm__ __volatile__ ( "lock btsl %k2, %0\n\t"
"sbb %1, %1\n\t"
: "+m" ( *bytes ), "=r" ( old )
: "Ir" ( bit ) );
@@ -84,7 +84,7 @@ test_and_clear_bit ( unsigned int bit, volatile void *bits ) {
} *bytes = bits;
int old;
- __asm__ __volatile__ ( "lock btr %2, %0\n\t"
+ __asm__ __volatile__ ( "lock btrl %k2, %0\n\t"
"sbb %1, %1\n\t"
: "+m" ( *bytes ), "=r" ( old )
: "Ir" ( bit ) );