Go to the documentation of this file. 1 #ifndef __ASM_SH_BITOPS_OP32_H
2 #define __ASM_SH_BITOPS_OP32_H
9 #if defined(__BIG_ENDIAN)
10 #define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7)
11 #define BYTE_NUMBER(nr) ((nr ^ BITOP_LE_SWIZZLE) / BITS_PER_BYTE)
12 #define BYTE_OFFSET(nr) ((nr ^ BITOP_LE_SWIZZLE) % BITS_PER_BYTE)
14 #define BYTE_NUMBER(nr) ((nr) / BITS_PER_BYTE)
15 #define BYTE_OFFSET(nr) ((nr) % BITS_PER_BYTE)
18 #define IS_IMMEDIATE(nr) (__builtin_constant_p(nr))
24 "bset.b %1, @(%O2,%0) ! __set_bit\n\t"
31 unsigned long *
p = ((
unsigned long *)addr) +
BIT_WORD(nr);
41 "bclr.b %1, @(%O2,%0) ! __clear_bit\n\t"
49 unsigned long *
p = ((
unsigned long *)addr) +
BIT_WORD(nr);
64 static inline void __change_bit(
int nr,
volatile unsigned long *addr)
68 "bxor.b %1, @(%O2,%0) ! __change_bit\n\t"
76 unsigned long *
p = ((
unsigned long *)addr) +
BIT_WORD(nr);
94 unsigned long *
p = ((
unsigned long *)addr) +
BIT_WORD(nr);
95 unsigned long old = *
p;
98 return (old & mask) != 0;
113 unsigned long *p = ((
unsigned long *)addr) +
BIT_WORD(nr);
114 unsigned long old = *
p;
117 return (old & mask) != 0;
122 volatile unsigned long *addr)
125 unsigned long *p = ((
unsigned long *)addr) +
BIT_WORD(nr);
126 unsigned long old = *
p;
129 return (old & mask) != 0;
137 static inline int test_bit(
int nr,
const volatile unsigned long *addr)