18 #ifndef __L4UTIL__INCLUDE__ARCH_X86__BITOPS_ARCH_H__ 19 #define __L4UTIL__INCLUDE__ARCH_X86__BITOPS_ARCH_H__ 28 #define __L4UTIL_BITOPS_HAVE_ARCH_SET_BIT 34 "lock; btsl %1,%0 \n\t" 45 #define __L4UTIL_BITOPS_HAVE_ARCH_CLEAR_BIT 51 "lock; btrl %1,%0 \n\t" 62 #define __L4UTIL_BITOPS_HAVE_ARCH_COMPLEMENT_BIT 68 "lock; btcl %1,%0 \n\t" 79 #define __L4UTIL_BITOPS_HAVE_ARCH_TEST_BIT 102 #define __L4UTIL_BITOPS_HAVE_ARCH_BIT_TEST_AND_SET 110 "lock; btsl %2,%1 \n\t" 125 #define __L4UTIL_BITOPS_HAVE_ARCH_BIT_TEST_AND_RESET 133 "lock; btrl %2,%1 \n\t" 148 #define __L4UTIL_BITOPS_HAVE_ARCH_BIT_TEST_AND_COMPLEMENT 156 "lock; btcl %2,%1 \n\t" 171 #define __L4UTIL_BITOPS_HAVE_ARCH_BIT_SCAN_REVERSE 193 #define __L4UTIL_BITOPS_HAVE_ARCH_BIT_SCAN_FORWARD 214 #define __L4UTIL_BITOPS_HAVE_ARCH_FIND_FIRST_SET_BIT 224 "leal -4(%%edi),%%edi \n\t" 225 "bsfl (%%edi),%%eax \n" 227 "subl %%esi,%%edi \n\t" 229 "addl %%edi,%%eax \n\t" 231 "=a" (res),
"=c" (dummy0),
"=D" (dummy1)
233 "a"(0),
"c" ((size+31) >> 5),
"D" (dest),
"S" (dest)
240 #define __L4UTIL_BITOPS_HAVE_ARCH_FIND_FIRST_ZERO_BIT 253 "xorl -4(%%edi),%%eax \n\t" 255 "bsfl %%eax,%%edx \n" 257 "subl %%esi,%%edi \n\t" 259 "addl %%edi,%%edx \n\t" 261 "=d" (res),
"=c" (dummy0),
"=D" (dummy1),
"=a" (dummy2)
263 "a" (~0),
"c" ((size+31) >> 5),
"d"(0),
"D" (dest),
"S" (dest)
unsigned int l4_size_t
Unsigned size type.
signed char l4_int8_t
Signed 8bit value.
int l4util_test_bit(int b, const volatile l4_umword_t *dest)
Test bit (return value of bit)
signed long l4_mword_t
Signed machine word.
#define EXTERN_C_END
End section with C types and functions.
int l4util_btc(int b, volatile l4_umword_t *dest)
Bit test and complement.
int l4util_btr(int b, volatile l4_umword_t *dest)
Bit test and reset.
#define L4_UNLIKELY(x)
Expression is unlikely to execute.
int l4util_find_first_zero_bit(const void *dest, l4_size_t size)
Find the first zero bit in a memory region.
void l4util_complement_bit(int b, volatile l4_umword_t *dest)
Complement bit in memory.
int l4util_bsf(l4_umword_t word)
Bit scan forward.
void l4util_set_bit(int b, volatile l4_umword_t *dest)
Set bit in memory.
unsigned long l4_umword_t
Unsigned machine word.
#define EXTERN_C_BEGIN
Start section with C types and functions.
int l4util_bts(int b, volatile l4_umword_t *dest)
Bit test and set.
int l4util_find_first_set_bit(const void *dest, l4_size_t size)
Find the first set bit in a memory region.
void l4util_clear_bit(int b, volatile l4_umword_t *dest)
Clear bit in memory.
int l4util_bsr(l4_umword_t word)
Bit scan reverse.