Go to the documentation of this file. 1 #ifndef __ASM_SH_BITOPS_LLSC_H
2 #define __ASM_SH_BITOPS_LLSC_H
7 volatile unsigned int *
a =
addr;
11 mask = 1 << (nr & 0x1f);
15 "movli.l @%1, %0 ! set_bit \n\t"
17 "movco.l %0, @%1 \n\t"
25 static inline void clear_bit(
int nr,
volatile void *addr)
28 volatile unsigned int *a =
addr;
32 mask = 1 << (nr & 0x1f);
36 "movli.l @%1, %0 ! clear_bit \n\t"
38 "movco.l %0, @%1 \n\t"
41 :
"r" (a),
"r" (~mask)
46 static inline void change_bit(
int nr,
volatile void *addr)
49 volatile unsigned int *a =
addr;
53 mask = 1 << (nr & 0x1f);
57 "movli.l @%1, %0 ! change_bit \n\t"
59 "movco.l %0, @%1 \n\t"
70 volatile unsigned int *a =
addr;
74 mask = 1 << (nr & 0x1f);
78 "movli.l @%2, %0 ! test_and_set_bit \n\t"
81 "movco.l %0, @%2 \n\t"
84 :
"=&z" (tmp),
"=&r" (retval)
95 volatile unsigned int *a =
addr;
99 mask = 1 << (nr & 0x1f);
103 "movli.l @%2, %0 ! test_and_clear_bit \n\t"
106 "movco.l %0, @%2 \n\t"
110 :
"=&z" (tmp),
"=&r" (retval)
111 :
"r" (a),
"r" (mask),
"r" (~mask)
121 volatile unsigned int *a =
addr;
125 mask = 1 << (nr & 0x1f);
129 "movli.l @%2, %0 ! test_and_change_bit \n\t"
132 "movco.l %0, @%2 \n\t"
136 :
"=&z" (tmp),
"=&r" (retval)
137 :
"r" (a),
"r" (mask)