Skip to contentSkip to conversation

x86 bitops adjustment

PATCH In review Jan Beulich 1 participant 1 message Aug 23, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/7 x86 bitops adjustment

(partly in preparation for initial PAE-guest-on-64bit patches) For constant_test_bit(), since the bitfield is split into 'unsigned int'-s, also only used an unsigned literal one for shifting (should produce slightly smaller code on x86-64).
For variable_test_bit(), the 'const' modifier was missing from the bitfield parameter - the 'variable' in the name is regarding the 'nr' parameter, not the bitfield.

xen/include/asm-x86/bitops.h +2 -2
Index: 2006-08-16/xen/include/asm-x86/bitops.h
===================================================================
@@ -224,10 +224,10 @@ static __inline__ int test_and_change_bi
 
 static __inline__ int constant_test_bit(int nr, const volatile void * addr)
 {
-	return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0;
+	return ((1U << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0;
 }
 
-static __inline__ int variable_test_bit(int nr, volatile void * addr)
+static __inline__ int variable_test_bit(int nr, const volatile void * addr)
 {
 	int oldbit;
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel