Go to the source code of this file.
|
| AO_INLINE AO_t | AO_fetch_and_add_full (volatile AO_t *p, AO_t incr) |
| |
| AO_INLINE unsigned char | AO_char_fetch_and_add_full (volatile unsigned char *p, unsigned char incr) |
| |
| AO_INLINE unsigned short | AO_short_fetch_and_add_full (volatile unsigned short *p, unsigned short incr) |
| |
| AO_INLINE void | AO_and_full (volatile AO_t *p, AO_t value) |
| |
| AO_INLINE void | AO_or_full (volatile AO_t *p, AO_t value) |
| |
| AO_INLINE void | AO_xor_full (volatile AO_t *p, AO_t value) |
| |
| AO_INLINE void | AO_char_and_full (volatile unsigned char *p, unsigned char value) |
| |
| AO_INLINE void | AO_char_or_full (volatile unsigned char *p, unsigned char value) |
| |
| AO_INLINE void | AO_char_xor_full (volatile unsigned char *p, unsigned char value) |
| |
| AO_INLINE void | AO_short_and_full (volatile unsigned short *p, unsigned short value) |
| |
| AO_INLINE void | AO_short_or_full (volatile unsigned short *p, unsigned short value) |
| |
| AO_INLINE void | AO_short_xor_full (volatile unsigned short *p, unsigned short value) |
| |
| AO_INLINE AO_TS_VAL_t | AO_test_and_set_full (volatile AO_TS_t *addr) |
| |
| AO_INLINE int | AO_compare_and_swap_full (volatile AO_t *addr, AO_t old, AO_t new_val) |
| |
| AO_INLINE AO_t | AO_fetch_compare_and_swap_full (volatile AO_t *addr, AO_t old_val, AO_t new_val) |
| |
| AO_INLINE unsigned char | AO_char_fetch_compare_and_swap_full (volatile unsigned char *addr, unsigned char old_val, unsigned char new_val) |
| |
| AO_INLINE unsigned short | AO_short_fetch_compare_and_swap_full (volatile unsigned short *addr, unsigned short old_val, unsigned short new_val) |
| |
◆ AO_HAVE_and_full
◆ AO_HAVE_char_and_full
| #define AO_HAVE_char_and_full |
◆ AO_HAVE_char_fetch_and_add_full
| #define AO_HAVE_char_fetch_and_add_full |
◆ AO_HAVE_char_fetch_compare_and_swap_full
| #define AO_HAVE_char_fetch_compare_and_swap_full |
◆ AO_HAVE_char_or_full
| #define AO_HAVE_char_or_full |
◆ AO_HAVE_char_xor_full
| #define AO_HAVE_char_xor_full |
◆ AO_HAVE_compare_and_swap_full
| #define AO_HAVE_compare_and_swap_full |
◆ AO_HAVE_fetch_and_add_full
| #define AO_HAVE_fetch_and_add_full |
◆ AO_HAVE_fetch_compare_and_swap_full
| #define AO_HAVE_fetch_compare_and_swap_full |
◆ AO_HAVE_or_full
◆ AO_HAVE_short_and_full
| #define AO_HAVE_short_and_full |
◆ AO_HAVE_short_fetch_and_add_full
| #define AO_HAVE_short_fetch_and_add_full |
◆ AO_HAVE_short_fetch_compare_and_swap_full
| #define AO_HAVE_short_fetch_compare_and_swap_full |
◆ AO_HAVE_short_or_full
| #define AO_HAVE_short_or_full |
◆ AO_HAVE_short_xor_full
| #define AO_HAVE_short_xor_full |
◆ AO_HAVE_test_and_set_full
| #define AO_HAVE_test_and_set_full |
◆ AO_HAVE_xor_full
◆ AO_T_IS_INT
◆ AO_and_full()
Definition at line 165 of file gcc/x86.h.
166 {
167 __asm__ __volatile__ ("lock; and %1, %0"
168 : "+m" (*p)
169 : "r" (value)
170 : "memory");
171 }
◆ AO_char_and_full()
| AO_INLINE void AO_char_and_full |
( |
volatile unsigned char * |
p, |
|
|
unsigned char |
value |
|
) |
| |
Definition at line 199 of file gcc/x86.h.
200{
201 __asm__ __volatile__ ("lock; andb %1, %0"
202 : "+m" (*p)
203 : "r" (value)
204 : "memory");
205}
◆ AO_char_fetch_and_add_full()
| AO_INLINE unsigned char AO_char_fetch_and_add_full |
( |
volatile unsigned char * |
p, |
|
|
unsigned char |
incr |
|
) |
| |
Definition at line 138 of file gcc/x86.h.
139{
141
142 __asm__ __volatile__ ("lock; xaddb %0, %1"
143 :
"=q" (
result),
"+m" (*p)
144 : "0" (incr)
145 : "memory");
147}
◆ AO_char_fetch_compare_and_swap_full()
| AO_INLINE unsigned char AO_char_fetch_compare_and_swap_full |
( |
volatile unsigned char * |
addr, |
|
|
unsigned char |
old_val, |
|
|
unsigned char |
new_val |
|
) |
| |
Definition at line 323 of file gcc/x86.h.
326 {
327# ifdef AO_USE_SYNC_CAS_BUILTIN
328 return __sync_val_compare_and_swap(addr, old_val, new_val
329 );
330# else
331 unsigned char fetched_val;
332
333 __asm__ __volatile__ ("lock; cmpxchgb %3, %1"
334 : "=a" (fetched_val), "+m" (*addr)
335 : "a" (old_val), "q" (new_val)
336 : "memory");
337 return fetched_val;
338# endif
339 }
◆ AO_char_or_full()
| AO_INLINE void AO_char_or_full |
( |
volatile unsigned char * |
p, |
|
|
unsigned char |
value |
|
) |
| |
Definition at line 209 of file gcc/x86.h.
210{
211 __asm__ __volatile__ ("lock; orb %1, %0"
212 : "+m" (*p)
213 : "r" (value)
214 : "memory");
215}
◆ AO_char_xor_full()
| AO_INLINE void AO_char_xor_full |
( |
volatile unsigned char * |
p, |
|
|
unsigned char |
value |
|
) |
| |
Definition at line 219 of file gcc/x86.h.
220{
221 __asm__ __volatile__ ("lock; xorb %1, %0"
222 : "+m" (*p)
223 : "r" (value)
224 : "memory");
225}
◆ AO_compare_and_swap_full()
Definition at line 275 of file gcc/x86.h.
276 {
277# ifdef AO_USE_SYNC_CAS_BUILTIN
278 return (int)__sync_bool_compare_and_swap(addr, old, new_val
279 );
280
281
282
283# else
285# if defined(__GCC_ASM_FLAG_OUTPUTS__)
287
288 __asm__ __volatile__ ("lock; cmpxchg %3, %0"
290 : "r" (new_val), "a" (old)
291 : "memory");
292# else
293 __asm__ __volatile__ ("lock; cmpxchg %2, %0; setz %1"
294 :
"+m" (*addr),
"=a" (
result)
295 : "r" (new_val), "a" (old)
296 : "memory");
297# endif
299# endif
300 }
◆ AO_fetch_and_add_full()
Definition at line 124 of file gcc/x86.h.
125 {
127
128 __asm__ __volatile__ ("lock; xadd %0, %1"
129 :
"=r" (
result),
"+m" (*p)
130 : "0" (incr)
131 : "memory");
133 }
◆ AO_fetch_compare_and_swap_full()
Definition at line 305 of file gcc/x86.h.
307{
308# ifdef AO_USE_SYNC_CAS_BUILTIN
309 return __sync_val_compare_and_swap(addr, old_val, new_val
310 );
311# else
313 __asm__ __volatile__ ("lock; cmpxchg %3, %1"
314 : "=a" (fetched_val), "+m" (*addr)
315 : "a" (old_val), "r" (new_val)
316 : "memory");
317 return fetched_val;
318# endif
319}
◆ AO_or_full()
Definition at line 175 of file gcc/x86.h.
176 {
177 __asm__ __volatile__ ("lock; or %1, %0"
178 : "+m" (*p)
179 : "r" (value)
180 : "memory");
181 }
◆ AO_short_and_full()
| AO_INLINE void AO_short_and_full |
( |
volatile unsigned short * |
p, |
|
|
unsigned short |
value |
|
) |
| |
Definition at line 229 of file gcc/x86.h.
230{
231 __asm__ __volatile__ ("lock; andw %1, %0"
232 : "+m" (*p)
233 : "r" (value)
234 : "memory");
235}
◆ AO_short_fetch_and_add_full()
| AO_INLINE unsigned short AO_short_fetch_and_add_full |
( |
volatile unsigned short * |
p, |
|
|
unsigned short |
incr |
|
) |
| |
Definition at line 151 of file gcc/x86.h.
152{
154
155 __asm__ __volatile__ ("lock; xaddw %0, %1"
156 :
"=r" (
result),
"+m" (*p)
157 : "0" (incr)
158 : "memory");
160}
◆ AO_short_fetch_compare_and_swap_full()
| AO_INLINE unsigned short AO_short_fetch_compare_and_swap_full |
( |
volatile unsigned short * |
addr, |
|
|
unsigned short |
old_val, |
|
|
unsigned short |
new_val |
|
) |
| |
Definition at line 343 of file gcc/x86.h.
346 {
347# ifdef AO_USE_SYNC_CAS_BUILTIN
348 return __sync_val_compare_and_swap(addr, old_val, new_val
349 );
350# else
351 unsigned short fetched_val;
352
353 __asm__ __volatile__ ("lock; cmpxchgw %3, %1"
354 : "=a" (fetched_val), "+m" (*addr)
355 : "a" (old_val), "r" (new_val)
356 : "memory");
357 return fetched_val;
358# endif
359 }
◆ AO_short_or_full()
| AO_INLINE void AO_short_or_full |
( |
volatile unsigned short * |
p, |
|
|
unsigned short |
value |
|
) |
| |
Definition at line 239 of file gcc/x86.h.
240{
241 __asm__ __volatile__ ("lock; orw %1, %0"
242 : "+m" (*p)
243 : "r" (value)
244 : "memory");
245}
◆ AO_short_xor_full()
| AO_INLINE void AO_short_xor_full |
( |
volatile unsigned short * |
p, |
|
|
unsigned short |
value |
|
) |
| |
Definition at line 249 of file gcc/x86.h.
250{
251 __asm__ __volatile__ ("lock; xorw %1, %0"
252 : "+m" (*p)
253 : "r" (value)
254 : "memory");
255}
◆ AO_test_and_set_full()
Definition at line 260 of file gcc/x86.h.
261{
262 unsigned char oldval;
263
264 __asm__ __volatile__ ("xchgb %0, %1"
265 : "=q" (oldval), "+m" (*addr)
266 : "0" ((unsigned char)0xff)
267 : "memory");
269}
◆ AO_xor_full()
Definition at line 185 of file gcc/x86.h.
186 {
187 __asm__ __volatile__ ("lock; xor %1, %0"
188 : "+m" (*p)
189 : "r" (value)
190 : "memory");
191 }