1 #ifndef _TOOLS_LINUX_ASM_GENERIC_BITOPS_ATOMIC_H_
2 #define _TOOLS_LINUX_ASM_GENERIC_BITOPS_ATOMIC_H_
5 #include <asm/bitsperlong.h>
7 static inline void set_bit(int nr
, unsigned long *addr
)
9 addr
[nr
/ __BITS_PER_LONG
] |= 1UL << (nr
% __BITS_PER_LONG
);
12 static inline void clear_bit(int nr
, unsigned long *addr
)
14 addr
[nr
/ __BITS_PER_LONG
] &= ~(1UL << (nr
% __BITS_PER_LONG
));
17 static __always_inline
int test_bit(unsigned int nr
, const unsigned long *addr
)
19 return ((1UL << (nr
% __BITS_PER_LONG
)) &
20 (((unsigned long *)addr
)[nr
/ __BITS_PER_LONG
])) != 0;
23 #endif /* _TOOLS_LINUX_ASM_GENERIC_BITOPS_ATOMIC_H_ */
This page took 0.050403 seconds and 5 git commands to generate.