1 #ifndef _ASM_IA64_BITOPS_H
2 #define _ASM_IA64_BITOPS_H
12 #ifndef _LINUX_BITOPS_H
13 #error only <linux/bitops.h> can be included directly
16 #include <linux/compiler.h>
17 #include <linux/types.h>
18 #include <asm/intrinsics.h>
44 m = (
volatile __u32 *) addr + (nr >> 5);
65 *((
__u32 *) addr + (nr >> 5)) |= (1 << (nr & 31));
71 #define smp_mb__before_clear_bit() smp_mb()
72 #define smp_mb__after_clear_bit() do { ; } while (0)
91 m = (
volatile __u32 *) addr + (nr >> 5);
92 mask = ~(1 << (nr & 31));
115 m = (
volatile __u32 *) addr + (nr >> 5);
116 mask = ~(1 << (nr & 31));
136 __u32 const new = *m & ~(1 << (nr & 31));
153 *((
__u32 *) addr + (nr >> 5)) &= ~(1 << (nr & 31));
172 m = (
volatile __u32 *) addr + (nr >> 5);
173 bit = (1 << (nr & 31));
193 *((
__u32 *) addr + (nr >> 5)) ^= (1 << (nr & 31));
211 m = (
volatile __u32 *) addr + (nr >> 5);
212 bit = 1 << (nr & 31);
218 return (old & bit) != 0;
228 #define test_and_set_bit_lock test_and_set_bit
243 __u32 m = 1 << (nr & 31);
244 int oldbitset = (*p &
m) != 0;
265 m = (
volatile __u32 *) addr + (nr >> 5);
266 mask = ~(1 << (nr & 31));
272 return (old & ~mask) != 0;
288 __u32 m = 1 << (nr & 31);
289 int oldbitset = (*p &
m) != 0;
310 m = (
volatile __u32 *) addr + (nr >> 5);
311 bit = (1 << (nr & 31));
317 return (old & bit) != 0;
330 __u32 old, bit = (1 << (nr & 31));
335 return (old & bit) != 0;
339 test_bit (
int nr,
const volatile void *addr)
341 return 1 & (((
const volatile __u32 *) addr)[nr >> 5] >> (nr & 31));
351 static inline unsigned long
352 ffz (
unsigned long x)
367 __ffs (
unsigned long x)
381 static inline unsigned long
382 ia64_fls (
unsigned long x)
398 unsigned long x = t & 0xffffffff
u;
414 static inline unsigned long
415 __fls (
unsigned long x)
434 #define ffs(x) __builtin_ffs(x)
440 static __inline__ unsigned long __arch_hweight64(
unsigned long x)
447 #define __arch_hweight32(x) ((unsigned int) __arch_hweight64((x) & 0xfffffffful))
448 #define __arch_hweight16(x) ((unsigned int) __arch_hweight64((x) & 0xfffful))
449 #define __arch_hweight8(x) ((unsigned int) __arch_hweight64((x) & 0xfful))