24#if defined(AO_HAVE_char_fetch_compare_and_swap_full) \
25 && !defined(AO_HAVE_char_compare_and_swap_full)
27 AO_char_compare_and_swap_full(
volatile unsignedchar *addr,
unsignedchar old_val,
33# define AO_HAVE_char_compare_and_swap_full
36#if defined(AO_HAVE_char_fetch_compare_and_swap_acquire) \
37 && !defined(AO_HAVE_char_compare_and_swap_acquire)
39 AO_char_compare_and_swap_acquire(
volatile unsignedchar *addr,
unsignedchar old_val,
45# define AO_HAVE_char_compare_and_swap_acquire
48#if defined(AO_HAVE_char_fetch_compare_and_swap_release) \
49 && !defined(AO_HAVE_char_compare_and_swap_release)
51 AO_char_compare_and_swap_release(
volatile unsignedchar *addr,
unsignedchar old_val,
57# define AO_HAVE_char_compare_and_swap_release
60#if defined(AO_HAVE_char_fetch_compare_and_swap_write) \
61 && !defined(AO_HAVE_char_compare_and_swap_write)
63 AO_char_compare_and_swap_write(
volatile unsignedchar *addr,
unsignedchar old_val,
66 return AO_char_fetch_compare_and_swap_write(addr, old_val, new_val)
69# define AO_HAVE_char_compare_and_swap_write
72#if defined(AO_HAVE_char_fetch_compare_and_swap_read) \
73 && !defined(AO_HAVE_char_compare_and_swap_read)
75 AO_char_compare_and_swap_read(
volatile unsignedchar *addr,
unsignedchar old_val,
78 return AO_char_fetch_compare_and_swap_read(addr, old_val, new_val)
81# define AO_HAVE_char_compare_and_swap_read
84#if defined(AO_HAVE_char_fetch_compare_and_swap) \
85 && !defined(AO_HAVE_char_compare_and_swap)
87 AO_char_compare_and_swap(
volatile unsignedchar *addr,
unsignedchar old_val,
90 return AO_char_fetch_compare_and_swap(addr, old_val, new_val) == old_val;
92# define AO_HAVE_char_compare_and_swap
95#if defined(AO_HAVE_char_fetch_compare_and_swap_release_write) \
96 && !defined(AO_HAVE_char_compare_and_swap_release_write)
98 AO_char_compare_and_swap_release_write(
volatile unsignedchar *addr,
99 unsignedchar old_val,
unsignedchar new_val)
101 return AO_char_fetch_compare_and_swap_release_write(addr, old_val,
104# define AO_HAVE_char_compare_and_swap_release_write
107#if defined(AO_HAVE_char_fetch_compare_and_swap_acquire_read) \
108 && !defined(AO_HAVE_char_compare_and_swap_acquire_read)
110 AO_char_compare_and_swap_acquire_read(
volatile unsignedchar *addr,
111 unsignedchar old_val,
unsignedchar new_val)
113 return AO_char_fetch_compare_and_swap_acquire_read(addr, old_val,
116# define AO_HAVE_char_compare_and_swap_acquire_read
119#if defined(AO_HAVE_char_fetch_compare_and_swap_dd_acquire_read) \
120 && !defined(AO_HAVE_char_compare_and_swap_dd_acquire_read)
122 AO_char_compare_and_swap_dd_acquire_read(
volatile unsignedchar *addr,
123 unsignedchar old_val,
unsignedchar new_val)
125 return AO_char_fetch_compare_and_swap_dd_acquire_read(addr, old_val,
128# define AO_HAVE_char_compare_and_swap_dd_acquire_read
134#if defined(AO_HAVE_char_compare_and_swap_full) \
135 && !defined(AO_HAVE_char_fetch_and_add_full)
144 old = *(
unsignedchar *)addr;
150# define AO_HAVE_char_fetch_and_add_full
153#if defined(AO_HAVE_char_compare_and_swap_acquire) \
154 && !defined(AO_HAVE_char_fetch_and_add_acquire)
163 old = *(
unsignedchar *)addr;
169# define AO_HAVE_char_fetch_and_add_acquire
172#if defined(AO_HAVE_char_compare_and_swap_release) \
173 && !defined(AO_HAVE_char_fetch_and_add_release)
182 old = *(
unsignedchar *)addr;
188# define AO_HAVE_char_fetch_and_add_release
191#if defined(AO_HAVE_char_compare_and_swap) \
192 && !defined(AO_HAVE_char_fetch_and_add)
201 old = *(
unsignedchar *)addr;
207# define AO_HAVE_char_fetch_and_add
210#if defined(AO_HAVE_char_fetch_and_add_full)
211# if !defined(AO_HAVE_char_fetch_and_add_release)
212# define AO_char_fetch_and_add_release(addr, val) \
213 AO_char_fetch_and_add_full(addr, val)
214# define AO_HAVE_char_fetch_and_add_release
216# if !defined(AO_HAVE_char_fetch_and_add_acquire)
217# define AO_char_fetch_and_add_acquire(addr, val) \
218 AO_char_fetch_and_add_full(addr, val)
219# define AO_HAVE_char_fetch_and_add_acquire
221# if !defined(AO_HAVE_char_fetch_and_add_write)
222# define AO_char_fetch_and_add_write(addr, val) \
223 AO_char_fetch_and_add_full(addr, val)
224# define AO_HAVE_char_fetch_and_add_write
226# if !defined(AO_HAVE_char_fetch_and_add_read)
227# define AO_char_fetch_and_add_read(addr, val) \
228 AO_char_fetch_and_add_full(addr, val)
229# define AO_HAVE_char_fetch_and_add_read
233#if defined(AO_HAVE_char_fetch_and_add) && defined(AO_HAVE_nop_full) \
234 && !defined(AO_HAVE_char_fetch_and_add_acquire)
242# define AO_HAVE_char_fetch_and_add_acquire
244#if defined(AO_HAVE_char_fetch_and_add) && defined(AO_HAVE_nop_full) \
245 && !defined(AO_HAVE_char_fetch_and_add_release)
246# define AO_char_fetch_and_add_release(addr, incr) \
247 (AO_nop_full(), AO_char_fetch_and_add(addr, incr))
248# define AO_HAVE_char_fetch_and_add_release
251#if !defined(AO_HAVE_char_fetch_and_add) \
252 && defined(AO_HAVE_char_fetch_and_add_release)
253# define AO_char_fetch_and_add(addr, val) \
254 AO_char_fetch_and_add_release(addr, val)
255# define AO_HAVE_char_fetch_and_add
257#if !defined(AO_HAVE_char_fetch_and_add) \
258 && defined(AO_HAVE_char_fetch_and_add_acquire)
259# define AO_char_fetch_and_add(addr, val) \
260 AO_char_fetch_and_add_acquire(addr, val)
261# define AO_HAVE_char_fetch_and_add
263#if !defined(AO_HAVE_char_fetch_and_add) \
264 && defined(AO_HAVE_char_fetch_and_add_write)
265# define AO_char_fetch_and_add(addr, val) \
266 AO_char_fetch_and_add_write(addr, val)
267# define AO_HAVE_char_fetch_and_add
269#if !defined(AO_HAVE_char_fetch_and_add) \
270 && defined(AO_HAVE_char_fetch_and_add_read)
271# define AO_char_fetch_and_add(addr, val) \
272 AO_char_fetch_and_add_read(addr, val)
273# define AO_HAVE_char_fetch_and_add
276#if defined(AO_HAVE_char_fetch_and_add_acquire) \
277 && defined(AO_HAVE_nop_full) && !defined(AO_HAVE_char_fetch_and_add_full)
278# define AO_char_fetch_and_add_full(addr, val) \
279 (AO_nop_full(), AO_char_fetch_and_add_acquire(addr, val))
280# define AO_HAVE_char_fetch_and_add_full
283#if !defined(AO_HAVE_char_fetch_and_add_release_write) \
284 && defined(AO_HAVE_char_fetch_and_add_write)
285# define AO_char_fetch_and_add_release_write(addr, val) \
286 AO_char_fetch_and_add_write(addr, val)
287# define AO_HAVE_char_fetch_and_add_release_write
289#if !defined(AO_HAVE_char_fetch_and_add_release_write) \
290 && defined(AO_HAVE_char_fetch_and_add_release)
291# define AO_char_fetch_and_add_release_write(addr, val) \
292 AO_char_fetch_and_add_release(addr, val)
293# define AO_HAVE_char_fetch_and_add_release_write
296#if !defined(AO_HAVE_char_fetch_and_add_acquire_read) \
297 && defined(AO_HAVE_char_fetch_and_add_read)
298# define AO_char_fetch_and_add_acquire_read(addr, val) \
299 AO_char_fetch_and_add_read(addr, val)
300# define AO_HAVE_char_fetch_and_add_acquire_read
302#if !defined(AO_HAVE_char_fetch_and_add_acquire_read) \
303 && defined(AO_HAVE_char_fetch_and_add_acquire)
304# define AO_char_fetch_and_add_acquire_read(addr, val) \
305 AO_char_fetch_and_add_acquire(addr, val)
306# define AO_HAVE_char_fetch_and_add_acquire_read
309#ifdef AO_NO_DD_ORDERING
310# if defined(AO_HAVE_char_fetch_and_add_acquire_read)
311# define AO_char_fetch_and_add_dd_acquire_read(addr, val) \
312 AO_char_fetch_and_add_acquire_read(addr, val)
313# define AO_HAVE_char_fetch_and_add_dd_acquire_read
316# if defined(AO_HAVE_char_fetch_and_add)
317# define AO_char_fetch_and_add_dd_acquire_read(addr, val) \
318 AO_char_fetch_and_add(addr, val)
319# define AO_HAVE_char_fetch_and_add_dd_acquire_read
324#if defined(AO_HAVE_char_fetch_and_add_full) \
325 && !defined(AO_HAVE_char_fetch_and_add1_full)
326# define AO_char_fetch_and_add1_full(addr) \
327 AO_char_fetch_and_add_full(addr, 1)
328# define AO_HAVE_char_fetch_and_add1_full
330#if defined(AO_HAVE_char_fetch_and_add_release) \
331 && !defined(AO_HAVE_char_fetch_and_add1_release)
332# define AO_char_fetch_and_add1_release(addr) \
333 AO_char_fetch_and_add_release(addr, 1)
334# define AO_HAVE_char_fetch_and_add1_release
336#if defined(AO_HAVE_char_fetch_and_add_acquire) \
337 && !defined(AO_HAVE_char_fetch_and_add1_acquire)
338# define AO_char_fetch_and_add1_acquire(addr) \
339 AO_char_fetch_and_add_acquire(addr, 1)
340# define AO_HAVE_char_fetch_and_add1_acquire
342#if defined(AO_HAVE_char_fetch_and_add_write) \
343 && !defined(AO_HAVE_char_fetch_and_add1_write)
344# define AO_char_fetch_and_add1_write(addr) \
345 AO_char_fetch_and_add_write(addr, 1)
346# define AO_HAVE_char_fetch_and_add1_write
348#if defined(AO_HAVE_char_fetch_and_add_read) \
349 && !defined(AO_HAVE_char_fetch_and_add1_read)
350# define AO_char_fetch_and_add1_read(addr) \
351 AO_char_fetch_and_add_read(addr, 1)
352# define AO_HAVE_char_fetch_and_add1_read
354#if defined(AO_HAVE_char_fetch_and_add_release_write) \
355 && !defined(AO_HAVE_char_fetch_and_add1_release_write)
356# define AO_char_fetch_and_add1_release_write(addr) \
357 AO_char_fetch_and_add_release_write(addr, 1)
358# define AO_HAVE_char_fetch_and_add1_release_write
360#if defined(AO_HAVE_char_fetch_and_add_acquire_read) \
361 && !defined(AO_HAVE_char_fetch_and_add1_acquire_read)
362# define AO_char_fetch_and_add1_acquire_read(addr) \
363 AO_char_fetch_and_add_acquire_read(addr, 1)
364# define AO_HAVE_char_fetch_and_add1_acquire_read
366#if defined(AO_HAVE_char_fetch_and_add) \
367 && !defined(AO_HAVE_char_fetch_and_add1)
368# define AO_char_fetch_and_add1(addr) AO_char_fetch_and_add(addr, 1)
369# define AO_HAVE_char_fetch_and_add1
372#if defined(AO_HAVE_char_fetch_and_add1_full)
373# if !defined(AO_HAVE_char_fetch_and_add1_release)
374# define AO_char_fetch_and_add1_release(addr) \
375 AO_char_fetch_and_add1_full(addr)
376# define AO_HAVE_char_fetch_and_add1_release
378# if !defined(AO_HAVE_char_fetch_and_add1_acquire)
379# define AO_char_fetch_and_add1_acquire(addr) \
380 AO_char_fetch_and_add1_full(addr)
381# define AO_HAVE_char_fetch_and_add1_acquire
383# if !defined(AO_HAVE_char_fetch_and_add1_write)
384# define AO_char_fetch_and_add1_write(addr) \
385 AO_char_fetch_and_add1_full(addr)
386# define AO_HAVE_char_fetch_and_add1_write
388# if !defined(AO_HAVE_char_fetch_and_add1_read)
389# define AO_char_fetch_and_add1_read(addr) \
390 AO_char_fetch_and_add1_full(addr)
391# define AO_HAVE_char_fetch_and_add1_read
395#if !defined(AO_HAVE_char_fetch_and_add1) \
396 && defined(AO_HAVE_char_fetch_and_add1_release)
397# define AO_char_fetch_and_add1(addr) AO_char_fetch_and_add1_release(addr)
398# define AO_HAVE_char_fetch_and_add1
400#if !defined(AO_HAVE_char_fetch_and_add1) \
401 && defined(AO_HAVE_char_fetch_and_add1_acquire)
402# define AO_char_fetch_and_add1(addr) AO_char_fetch_and_add1_acquire(addr)
403# define AO_HAVE_char_fetch_and_add1
405#if !defined(AO_HAVE_char_fetch_and_add1) \
406 && defined(AO_HAVE_char_fetch_and_add1_write)
407# define AO_char_fetch_and_add1(addr) AO_char_fetch_and_add1_write(addr)
408# define AO_HAVE_char_fetch_and_add1
410#if !defined(AO_HAVE_char_fetch_and_add1) \
411 && defined(AO_HAVE_char_fetch_and_add1_read)
412# define AO_char_fetch_and_add1(addr) AO_char_fetch_and_add1_read(addr)
413# define AO_HAVE_char_fetch_and_add1
416#if defined(AO_HAVE_char_fetch_and_add1_acquire) \
417 && defined(AO_HAVE_nop_full) \
418 && !defined(AO_HAVE_char_fetch_and_add1_full)
419# define AO_char_fetch_and_add1_full(addr) \
420 (AO_nop_full(), AO_char_fetch_and_add1_acquire(addr))
421# define AO_HAVE_char_fetch_and_add1_full
424#if !defined(AO_HAVE_char_fetch_and_add1_release_write) \
425 && defined(AO_HAVE_char_fetch_and_add1_write)
426# define AO_char_fetch_and_add1_release_write(addr) \
427 AO_char_fetch_and_add1_write(addr)
428# define AO_HAVE_char_fetch_and_add1_release_write
430#if !defined(AO_HAVE_char_fetch_and_add1_release_write) \
431 && defined(AO_HAVE_char_fetch_and_add1_release)
432# define AO_char_fetch_and_add1_release_write(addr) \
433 AO_char_fetch_and_add1_release(addr)
434# define AO_HAVE_char_fetch_and_add1_release_write
436#if !defined(AO_HAVE_char_fetch_and_add1_acquire_read) \
437 && defined(AO_HAVE_char_fetch_and_add1_read)
438# define AO_char_fetch_and_add1_acquire_read(addr) \
439 AO_char_fetch_and_add1_read(addr)
440# define AO_HAVE_char_fetch_and_add1_acquire_read
442#if !defined(AO_HAVE_char_fetch_and_add1_acquire_read) \
443 && defined(AO_HAVE_char_fetch_and_add1_acquire)
444# define AO_char_fetch_and_add1_acquire_read(addr) \
445 AO_char_fetch_and_add1_acquire(addr)
446# define AO_HAVE_char_fetch_and_add1_acquire_read
449#ifdef AO_NO_DD_ORDERING
450# if defined(AO_HAVE_char_fetch_and_add1_acquire_read)
451# define AO_char_fetch_and_add1_dd_acquire_read(addr) \
452 AO_char_fetch_and_add1_acquire_read(addr)
453# define AO_HAVE_char_fetch_and_add1_dd_acquire_read
456# if defined(AO_HAVE_char_fetch_and_add1)
457# define AO_char_fetch_and_add1_dd_acquire_read(addr) \
458 AO_char_fetch_and_add1(addr)
459# define AO_HAVE_char_fetch_and_add1_dd_acquire_read
464#if defined(AO_HAVE_char_fetch_and_add_full) \
465 && !defined(AO_HAVE_char_fetch_and_sub1_full)
466# define AO_char_fetch_and_sub1_full(addr) \
467 AO_char_fetch_and_add_full(addr, (unsignedchar)(-1))
468# define AO_HAVE_char_fetch_and_sub1_full
470#if defined(AO_HAVE_char_fetch_and_add_release) \
471 && !defined(AO_HAVE_char_fetch_and_sub1_release)
472# define AO_char_fetch_and_sub1_release(addr) \
473 AO_char_fetch_and_add_release(addr, (unsignedchar)(-1))
474# define AO_HAVE_char_fetch_and_sub1_release
476#if defined(AO_HAVE_char_fetch_and_add_acquire) \
477 && !defined(AO_HAVE_char_fetch_and_sub1_acquire)
478# define AO_char_fetch_and_sub1_acquire(addr) \
479 AO_char_fetch_and_add_acquire(addr, (unsignedchar)(-1))
480# define AO_HAVE_char_fetch_and_sub1_acquire
482#if defined(AO_HAVE_char_fetch_and_add_write) \
483 && !defined(AO_HAVE_char_fetch_and_sub1_write)
484# define AO_char_fetch_and_sub1_write(addr) \
485 AO_char_fetch_and_add_write(addr, (unsignedchar)(-1))
486# define AO_HAVE_char_fetch_and_sub1_write
488#if defined(AO_HAVE_char_fetch_and_add_read) \
489 && !defined(AO_HAVE_char_fetch_and_sub1_read)
490# define AO_char_fetch_and_sub1_read(addr) \
491 AO_char_fetch_and_add_read(addr, (unsignedchar)(-1))
492# define AO_HAVE_char_fetch_and_sub1_read
494#if defined(AO_HAVE_char_fetch_and_add_release_write) \
495 && !defined(AO_HAVE_char_fetch_and_sub1_release_write)
496# define AO_char_fetch_and_sub1_release_write(addr) \
497 AO_char_fetch_and_add_release_write(addr, (unsignedchar)(-1))
498# define AO_HAVE_char_fetch_and_sub1_release_write
500#if defined(AO_HAVE_char_fetch_and_add_acquire_read) \
501 && !defined(AO_HAVE_char_fetch_and_sub1_acquire_read)
502# define AO_char_fetch_and_sub1_acquire_read(addr) \
503 AO_char_fetch_and_add_acquire_read(addr, (unsignedchar)(-1))
504# define AO_HAVE_char_fetch_and_sub1_acquire_read
506#if defined(AO_HAVE_char_fetch_and_add) \
507 && !defined(AO_HAVE_char_fetch_and_sub1)
508# define AO_char_fetch_and_sub1(addr) \
509 AO_char_fetch_and_add(addr, (unsignedchar)(-1))
510# define AO_HAVE_char_fetch_and_sub1
513#if defined(AO_HAVE_char_fetch_and_sub1_full)
514# if !defined(AO_HAVE_char_fetch_and_sub1_release)
515# define AO_char_fetch_and_sub1_release(addr) \
516 AO_char_fetch_and_sub1_full(addr)
517# define AO_HAVE_char_fetch_and_sub1_release
519# if !defined(AO_HAVE_char_fetch_and_sub1_acquire)
520# define AO_char_fetch_and_sub1_acquire(addr) \
521 AO_char_fetch_and_sub1_full(addr)
522# define AO_HAVE_char_fetch_and_sub1_acquire
524# if !defined(AO_HAVE_char_fetch_and_sub1_write)
525# define AO_char_fetch_and_sub1_write(addr) \
526 AO_char_fetch_and_sub1_full(addr)
527# define AO_HAVE_char_fetch_and_sub1_write
529# if !defined(AO_HAVE_char_fetch_and_sub1_read)
530# define AO_char_fetch_and_sub1_read(addr) \
531 AO_char_fetch_and_sub1_full(addr)
532# define AO_HAVE_char_fetch_and_sub1_read
536#if !defined(AO_HAVE_char_fetch_and_sub1) \
537 && defined(AO_HAVE_char_fetch_and_sub1_release)
538# define AO_char_fetch_and_sub1(addr) AO_char_fetch_and_sub1_release(addr)
539# define AO_HAVE_char_fetch_and_sub1
541#if !defined(AO_HAVE_char_fetch_and_sub1) \
542 && defined(AO_HAVE_char_fetch_and_sub1_acquire)
543# define AO_char_fetch_and_sub1(addr) AO_char_fetch_and_sub1_acquire(addr)
544# define AO_HAVE_char_fetch_and_sub1
546#if !defined(AO_HAVE_char_fetch_and_sub1) \
547 && defined(AO_HAVE_char_fetch_and_sub1_write)
548# define AO_char_fetch_and_sub1(addr) AO_char_fetch_and_sub1_write(addr)
549# define AO_HAVE_char_fetch_and_sub1
551#if !defined(AO_HAVE_char_fetch_and_sub1) \
552 && defined(AO_HAVE_char_fetch_and_sub1_read)
553# define AO_char_fetch_and_sub1(addr) AO_char_fetch_and_sub1_read(addr)
554# define AO_HAVE_char_fetch_and_sub1
557#if defined(AO_HAVE_char_fetch_and_sub1_acquire) \
558 && defined(AO_HAVE_nop_full) \
559 && !defined(AO_HAVE_char_fetch_and_sub1_full)
560# define AO_char_fetch_and_sub1_full(addr) \
561 (AO_nop_full(), AO_char_fetch_and_sub1_acquire(addr))
562# define AO_HAVE_char_fetch_and_sub1_full
565#if !defined(AO_HAVE_char_fetch_and_sub1_release_write) \
566 && defined(AO_HAVE_char_fetch_and_sub1_write)
567# define AO_char_fetch_and_sub1_release_write(addr) \
568 AO_char_fetch_and_sub1_write(addr)
569# define AO_HAVE_char_fetch_and_sub1_release_write
571#if !defined(AO_HAVE_char_fetch_and_sub1_release_write) \
572 && defined(AO_HAVE_char_fetch_and_sub1_release)
573# define AO_char_fetch_and_sub1_release_write(addr) \
574 AO_char_fetch_and_sub1_release(addr)
575# define AO_HAVE_char_fetch_and_sub1_release_write
577#if !defined(AO_HAVE_char_fetch_and_sub1_acquire_read) \
578 && defined(AO_HAVE_char_fetch_and_sub1_read)
579# define AO_char_fetch_and_sub1_acquire_read(addr) \
580 AO_char_fetch_and_sub1_read(addr)
581# define AO_HAVE_char_fetch_and_sub1_acquire_read
583#if !defined(AO_HAVE_char_fetch_and_sub1_acquire_read) \
584 && defined(AO_HAVE_char_fetch_and_sub1_acquire)
585# define AO_char_fetch_and_sub1_acquire_read(addr) \
586 AO_char_fetch_and_sub1_acquire(addr)
587# define AO_HAVE_char_fetch_and_sub1_acquire_read
590#ifdef AO_NO_DD_ORDERING
591# if defined(AO_HAVE_char_fetch_and_sub1_acquire_read)
592# define AO_char_fetch_and_sub1_dd_acquire_read(addr) \
593 AO_char_fetch_and_sub1_acquire_read(addr)
594# define AO_HAVE_char_fetch_and_sub1_dd_acquire_read
597# if defined(AO_HAVE_char_fetch_and_sub1)
598# define AO_char_fetch_and_sub1_dd_acquire_read(addr) \
599 AO_char_fetch_and_sub1(addr)
600# define AO_HAVE_char_fetch_and_sub1_dd_acquire_read
605#if defined(AO_HAVE_char_compare_and_swap_full) \
606 && !defined(AO_HAVE_char_and_full)
615 old = *(
unsignedchar *)addr;
620# define AO_HAVE_char_and_full
623#if defined(AO_HAVE_char_and_full)
624# if !defined(AO_HAVE_char_and_release)
625# define AO_char_and_release(addr, val) AO_char_and_full(addr, val)
626# define AO_HAVE_char_and_release
628# if !defined(AO_HAVE_char_and_acquire)
629# define AO_char_and_acquire(addr, val) AO_char_and_full(addr, val)
630# define AO_HAVE_char_and_acquire
632# if !defined(AO_HAVE_char_and_write)
633# define AO_char_and_write(addr, val) AO_char_and_full(addr, val)
634# define AO_HAVE_char_and_write
636# if !defined(AO_HAVE_char_and_read)
637# define AO_char_and_read(addr, val) AO_char_and_full(addr, val)
638# define AO_HAVE_char_and_read
642#if !defined(AO_HAVE_char_and) && defined(AO_HAVE_char_and_release)
643# define AO_char_and(addr, val) AO_char_and_release(addr, val)
644# define AO_HAVE_char_and
646#if !defined(AO_HAVE_char_and) && defined(AO_HAVE_char_and_acquire)
647# define AO_char_and(addr, val) AO_char_and_acquire(addr, val)
648# define AO_HAVE_char_and
650#if !defined(AO_HAVE_char_and) && defined(AO_HAVE_char_and_write)
651# define AO_char_and(addr, val) AO_char_and_write(addr, val)
652# define AO_HAVE_char_and
654#if !defined(AO_HAVE_char_and) && defined(AO_HAVE_char_and_read)
655# define AO_char_and(addr, val) AO_char_and_read(addr, val)
656# define AO_HAVE_char_and
659#if defined(AO_HAVE_char_and_acquire) && defined(AO_HAVE_nop_full) \
660 && !defined(AO_HAVE_char_and_full)
661# define AO_char_and_full(addr, val) \
662 (AO_nop_full(), AO_char_and_acquire(addr, val))
663# define AO_HAVE_char_and_full
666#if !defined(AO_HAVE_char_and_release_write) \
667 && defined(AO_HAVE_char_and_write)
668# define AO_char_and_release_write(addr, val) AO_char_and_write(addr, val)
669# define AO_HAVE_char_and_release_write
671#if !defined(AO_HAVE_char_and_release_write) \
672 && defined(AO_HAVE_char_and_release)
673# define AO_char_and_release_write(addr, val) AO_char_and_release(addr, val)
674# define AO_HAVE_char_and_release_write
676#if !defined(AO_HAVE_char_and_acquire_read) \
677 && defined(AO_HAVE_char_and_read)
678# define AO_char_and_acquire_read(addr, val) AO_char_and_read(addr, val)
679# define AO_HAVE_char_and_acquire_read
681#if !defined(AO_HAVE_char_and_acquire_read) \
682 && defined(AO_HAVE_char_and_acquire)
683# define AO_char_and_acquire_read(addr, val) AO_char_and_acquire(addr, val)
684# define AO_HAVE_char_and_acquire_read
688#if defined(AO_HAVE_char_compare_and_swap_full) \
689 && !defined(AO_HAVE_char_or_full)
698 old = *(
unsignedchar *)addr;
703# define AO_HAVE_char_or_full
706#if defined(AO_HAVE_char_or_full)
707# if !defined(AO_HAVE_char_or_release)
708# define AO_char_or_release(addr, val) AO_char_or_full(addr, val)
709# define AO_HAVE_char_or_release
711# if !defined(AO_HAVE_char_or_acquire)
712# define AO_char_or_acquire(addr, val) AO_char_or_full(addr, val)
713# define AO_HAVE_char_or_acquire
715# if !defined(AO_HAVE_char_or_write)
716# define AO_char_or_write(addr, val) AO_char_or_full(addr, val)
717# define AO_HAVE_char_or_write
719# if !defined(AO_HAVE_char_or_read)
720# define AO_char_or_read(addr, val) AO_char_or_full(addr, val)
721# define AO_HAVE_char_or_read
725#if !defined(AO_HAVE_char_or) && defined(AO_HAVE_char_or_release)
726# define AO_char_or(addr, val) AO_char_or_release(addr, val)
727# define AO_HAVE_char_or
729#if !defined(AO_HAVE_char_or) && defined(AO_HAVE_char_or_acquire)
730# define AO_char_or(addr, val) AO_char_or_acquire(addr, val)
731# define AO_HAVE_char_or
733#if !defined(AO_HAVE_char_or) && defined(AO_HAVE_char_or_write)
734# define AO_char_or(addr, val) AO_char_or_write(addr, val)
735# define AO_HAVE_char_or
737#if !defined(AO_HAVE_char_or) && defined(AO_HAVE_char_or_read)
738# define AO_char_or(addr, val) AO_char_or_read(addr, val)
739# define AO_HAVE_char_or
742#if defined(AO_HAVE_char_or_acquire) && defined(AO_HAVE_nop_full) \
743 && !defined(AO_HAVE_char_or_full)
744# define AO_char_or_full(addr, val) \
745 (AO_nop_full(), AO_char_or_acquire(addr, val))
746# define AO_HAVE_char_or_full
749#if !defined(AO_HAVE_char_or_release_write) \
750 && defined(AO_HAVE_char_or_write)
751# define AO_char_or_release_write(addr, val) AO_char_or_write(addr, val)
752# define AO_HAVE_char_or_release_write
754#if !defined(AO_HAVE_char_or_release_write) \
755 && defined(AO_HAVE_char_or_release)
756# define AO_char_or_release_write(addr, val) AO_char_or_release(addr, val)
757# define AO_HAVE_char_or_release_write
759#if !defined(AO_HAVE_char_or_acquire_read) && defined(AO_HAVE_char_or_read)
760# define AO_char_or_acquire_read(addr, val) AO_char_or_read(addr, val)
761# define AO_HAVE_char_or_acquire_read
763#if !defined(AO_HAVE_char_or_acquire_read) \
764 && defined(AO_HAVE_char_or_acquire)
765# define AO_char_or_acquire_read(addr, val) AO_char_or_acquire(addr, val)
766# define AO_HAVE_char_or_acquire_read
770#if defined(AO_HAVE_char_compare_and_swap_full) \
771 && !defined(AO_HAVE_char_xor_full)
780 old = *(
unsignedchar *)addr;
785# define AO_HAVE_char_xor_full
788#if defined(AO_HAVE_char_xor_full)
789# if !defined(AO_HAVE_char_xor_release)
790# define AO_char_xor_release(addr, val) AO_char_xor_full(addr, val)
791# define AO_HAVE_char_xor_release
793# if !defined(AO_HAVE_char_xor_acquire)
794# define AO_char_xor_acquire(addr, val) AO_char_xor_full(addr, val)
795# define AO_HAVE_char_xor_acquire
797# if !defined(AO_HAVE_char_xor_write)
798# define AO_char_xor_write(addr, val) AO_char_xor_full(addr, val)
799# define AO_HAVE_char_xor_write
801# if !defined(AO_HAVE_char_xor_read)
802# define AO_char_xor_read(addr, val) AO_char_xor_full(addr, val)
803# define AO_HAVE_char_xor_read
807#if !defined(AO_HAVE_char_xor) && defined(AO_HAVE_char_xor_release)
808# define AO_char_xor(addr, val) AO_char_xor_release(addr, val)
809# define AO_HAVE_char_xor
811#if !defined(AO_HAVE_char_xor) && defined(AO_HAVE_char_xor_acquire)
812# define AO_char_xor(addr, val) AO_char_xor_acquire(addr, val)
813# define AO_HAVE_char_xor
815#if !defined(AO_HAVE_char_xor) && defined(AO_HAVE_char_xor_write)
816# define AO_char_xor(addr, val) AO_char_xor_write(addr, val)
817# define AO_HAVE_char_xor
819#if !defined(AO_HAVE_char_xor) && defined(AO_HAVE_char_xor_read)
820# define AO_char_xor(addr, val) AO_char_xor_read(addr, val)
821# define AO_HAVE_char_xor
824#if defined(AO_HAVE_char_xor_acquire) && defined(AO_HAVE_nop_full) \
825 && !defined(AO_HAVE_char_xor_full)
826# define AO_char_xor_full(addr, val) \
827 (AO_nop_full(), AO_char_xor_acquire(addr, val))
828# define AO_HAVE_char_xor_full
831#if !defined(AO_HAVE_char_xor_release_write) \
832 && defined(AO_HAVE_char_xor_write)
833# define AO_char_xor_release_write(addr, val) AO_char_xor_write(addr, val)
834# define AO_HAVE_char_xor_release_write
836#if !defined(AO_HAVE_char_xor_release_write) \
837 && defined(AO_HAVE_char_xor_release)
838# define AO_char_xor_release_write(addr, val) AO_char_xor_release(addr, val)
839# define AO_HAVE_char_xor_release_write
841#if !defined(AO_HAVE_char_xor_acquire_read) \
842 && defined(AO_HAVE_char_xor_read)
843# define AO_char_xor_acquire_read(addr, val) AO_char_xor_read(addr, val)
844# define AO_HAVE_char_xor_acquire_read
846#if !defined(AO_HAVE_char_xor_acquire_read) \
847 && defined(AO_HAVE_char_xor_acquire)
848# define AO_char_xor_acquire_read(addr, val) AO_char_xor_acquire(addr, val)
849# define AO_HAVE_char_xor_acquire_read
876#if defined(AO_HAVE_short_fetch_compare_and_swap_full) \
877 && !defined(AO_HAVE_short_compare_and_swap_full)
879 AO_short_compare_and_swap_full(
volatile unsignedshort *addr,
unsignedshort old_val,
880 unsignedshort new_val)
885# define AO_HAVE_short_compare_and_swap_full
888#if defined(AO_HAVE_short_fetch_compare_and_swap_acquire) \
889 && !defined(AO_HAVE_short_compare_and_swap_acquire)
891 AO_short_compare_and_swap_acquire(
volatile unsignedshort *addr,
unsignedshort old_val,
892 unsignedshort new_val)
897# define AO_HAVE_short_compare_and_swap_acquire
900#if defined(AO_HAVE_short_fetch_compare_and_swap_release) \
901 && !defined(AO_HAVE_short_compare_and_swap_release)
903 AO_short_compare_and_swap_release(
volatile unsignedshort *addr,
unsignedshort old_val,
904 unsignedshort new_val)
909# define AO_HAVE_short_compare_and_swap_release
912#if defined(AO_HAVE_short_fetch_compare_and_swap_write) \
913 && !defined(AO_HAVE_short_compare_and_swap_write)
915 AO_short_compare_and_swap_write(
volatile unsignedshort *addr,
unsignedshort old_val,
916 unsignedshort new_val)
918 return AO_short_fetch_compare_and_swap_write(addr, old_val, new_val)
921# define AO_HAVE_short_compare_and_swap_write
924#if defined(AO_HAVE_short_fetch_compare_and_swap_read) \
925 && !defined(AO_HAVE_short_compare_and_swap_read)
927 AO_short_compare_and_swap_read(
volatile unsignedshort *addr,
unsignedshort old_val,
928 unsignedshort new_val)
930 return AO_short_fetch_compare_and_swap_read(addr, old_val, new_val)
933# define AO_HAVE_short_compare_and_swap_read
936#if defined(AO_HAVE_short_fetch_compare_and_swap) \
937 && !defined(AO_HAVE_short_compare_and_swap)
939 AO_short_compare_and_swap(
volatile unsignedshort *addr,
unsignedshort old_val,
940 unsignedshort new_val)
942 return AO_short_fetch_compare_and_swap(addr, old_val, new_val) == old_val;
944# define AO_HAVE_short_compare_and_swap
947#if defined(AO_HAVE_short_fetch_compare_and_swap_release_write) \
948 && !defined(AO_HAVE_short_compare_and_swap_release_write)
950 AO_short_compare_and_swap_release_write(
volatile unsignedshort *addr,
951 unsignedshort old_val,
unsignedshort new_val)
953 return AO_short_fetch_compare_and_swap_release_write(addr, old_val,
956# define AO_HAVE_short_compare_and_swap_release_write
959#if defined(AO_HAVE_short_fetch_compare_and_swap_acquire_read) \
960 && !defined(AO_HAVE_short_compare_and_swap_acquire_read)
962 AO_short_compare_and_swap_acquire_read(
volatile unsignedshort *addr,
963 unsignedshort old_val,
unsignedshort new_val)
965 return AO_short_fetch_compare_and_swap_acquire_read(addr, old_val,
968# define AO_HAVE_short_compare_and_swap_acquire_read
971#if defined(AO_HAVE_short_fetch_compare_and_swap_dd_acquire_read) \
972 && !defined(AO_HAVE_short_compare_and_swap_dd_acquire_read)
974 AO_short_compare_and_swap_dd_acquire_read(
volatile unsignedshort *addr,
975 unsignedshort old_val,
unsignedshort new_val)
977 return AO_short_fetch_compare_and_swap_dd_acquire_read(addr, old_val,
980# define AO_HAVE_short_compare_and_swap_dd_acquire_read
986#if defined(AO_HAVE_short_compare_and_swap_full) \
987 && !defined(AO_HAVE_short_fetch_and_add_full)
996 old = *(
unsignedshort *)addr;
1002# define AO_HAVE_short_fetch_and_add_full
1005#if defined(AO_HAVE_short_compare_and_swap_acquire) \
1006 && !defined(AO_HAVE_short_fetch_and_add_acquire)
1015 old = *(
unsignedshort *)addr;
1021# define AO_HAVE_short_fetch_and_add_acquire
1024#if defined(AO_HAVE_short_compare_and_swap_release) \
1025 && !defined(AO_HAVE_short_fetch_and_add_release)
1034 old = *(
unsignedshort *)addr;
1040# define AO_HAVE_short_fetch_and_add_release
1043#if defined(AO_HAVE_short_compare_and_swap) \
1044 && !defined(AO_HAVE_short_fetch_and_add)
1053 old = *(
unsignedshort *)addr;
1059# define AO_HAVE_short_fetch_and_add
1062#if defined(AO_HAVE_short_fetch_and_add_full)
1063# if !defined(AO_HAVE_short_fetch_and_add_release)
1064# define AO_short_fetch_and_add_release(addr, val) \
1065 AO_short_fetch_and_add_full(addr, val)
1066# define AO_HAVE_short_fetch_and_add_release
1068# if !defined(AO_HAVE_short_fetch_and_add_acquire)
1069# define AO_short_fetch_and_add_acquire(addr, val) \
1070 AO_short_fetch_and_add_full(addr, val)
1071# define AO_HAVE_short_fetch_and_add_acquire
1073# if !defined(AO_HAVE_short_fetch_and_add_write)
1074# define AO_short_fetch_and_add_write(addr, val) \
1075 AO_short_fetch_and_add_full(addr, val)
1076# define AO_HAVE_short_fetch_and_add_write
1078# if !defined(AO_HAVE_short_fetch_and_add_read)
1079# define AO_short_fetch_and_add_read(addr, val) \
1080 AO_short_fetch_and_add_full(addr, val)
1081# define AO_HAVE_short_fetch_and_add_read
1085#if defined(AO_HAVE_short_fetch_and_add) && defined(AO_HAVE_nop_full) \
1086 && !defined(AO_HAVE_short_fetch_and_add_acquire)
1094# define AO_HAVE_short_fetch_and_add_acquire
1096#if defined(AO_HAVE_short_fetch_and_add) && defined(AO_HAVE_nop_full) \
1097 && !defined(AO_HAVE_short_fetch_and_add_release)
1098# define AO_short_fetch_and_add_release(addr, incr) \
1099 (AO_nop_full(), AO_short_fetch_and_add(addr, incr))
1100# define AO_HAVE_short_fetch_and_add_release
1103#if !defined(AO_HAVE_short_fetch_and_add) \
1104 && defined(AO_HAVE_short_fetch_and_add_release)
1105# define AO_short_fetch_and_add(addr, val) \
1106 AO_short_fetch_and_add_release(addr, val)
1107# define AO_HAVE_short_fetch_and_add
1109#if !defined(AO_HAVE_short_fetch_and_add) \
1110 && defined(AO_HAVE_short_fetch_and_add_acquire)
1111# define AO_short_fetch_and_add(addr, val) \
1112 AO_short_fetch_and_add_acquire(addr, val)
1113# define AO_HAVE_short_fetch_and_add
1115#if !defined(AO_HAVE_short_fetch_and_add) \
1116 && defined(AO_HAVE_short_fetch_and_add_write)
1117# define AO_short_fetch_and_add(addr, val) \
1118 AO_short_fetch_and_add_write(addr, val)
1119# define AO_HAVE_short_fetch_and_add
1121#if !defined(AO_HAVE_short_fetch_and_add) \
1122 && defined(AO_HAVE_short_fetch_and_add_read)
1123# define AO_short_fetch_and_add(addr, val) \
1124 AO_short_fetch_and_add_read(addr, val)
1125# define AO_HAVE_short_fetch_and_add
1128#if defined(AO_HAVE_short_fetch_and_add_acquire) \
1129 && defined(AO_HAVE_nop_full) && !defined(AO_HAVE_short_fetch_and_add_full)
1130# define AO_short_fetch_and_add_full(addr, val) \
1131 (AO_nop_full(), AO_short_fetch_and_add_acquire(addr, val))
1132# define AO_HAVE_short_fetch_and_add_full
1135#if !defined(AO_HAVE_short_fetch_and_add_release_write) \
1136 && defined(AO_HAVE_short_fetch_and_add_write)
1137# define AO_short_fetch_and_add_release_write(addr, val) \
1138 AO_short_fetch_and_add_write(addr, val)
1139# define AO_HAVE_short_fetch_and_add_release_write
1141#if !defined(AO_HAVE_short_fetch_and_add_release_write) \
1142 && defined(AO_HAVE_short_fetch_and_add_release)
1143# define AO_short_fetch_and_add_release_write(addr, val) \
1144 AO_short_fetch_and_add_release(addr, val)
1145# define AO_HAVE_short_fetch_and_add_release_write
1148#if !defined(AO_HAVE_short_fetch_and_add_acquire_read) \
1149 && defined(AO_HAVE_short_fetch_and_add_read)
1150# define AO_short_fetch_and_add_acquire_read(addr, val) \
1151 AO_short_fetch_and_add_read(addr, val)
1152# define AO_HAVE_short_fetch_and_add_acquire_read
1154#if !defined(AO_HAVE_short_fetch_and_add_acquire_read) \
1155 && defined(AO_HAVE_short_fetch_and_add_acquire)
1156# define AO_short_fetch_and_add_acquire_read(addr, val) \
1157 AO_short_fetch_and_add_acquire(addr, val)
1158# define AO_HAVE_short_fetch_and_add_acquire_read
1161#ifdef AO_NO_DD_ORDERING
1162# if defined(AO_HAVE_short_fetch_and_add_acquire_read)
1163# define AO_short_fetch_and_add_dd_acquire_read(addr, val) \
1164 AO_short_fetch_and_add_acquire_read(addr, val)
1165# define AO_HAVE_short_fetch_and_add_dd_acquire_read
1168# if defined(AO_HAVE_short_fetch_and_add)
1169# define AO_short_fetch_and_add_dd_acquire_read(addr, val) \
1170 AO_short_fetch_and_add(addr, val)
1171# define AO_HAVE_short_fetch_and_add_dd_acquire_read
1176#if defined(AO_HAVE_short_fetch_and_add_full) \
1177 && !defined(AO_HAVE_short_fetch_and_add1_full)
1178# define AO_short_fetch_and_add1_full(addr) \
1179 AO_short_fetch_and_add_full(addr, 1)
1180# define AO_HAVE_short_fetch_and_add1_full
1182#if defined(AO_HAVE_short_fetch_and_add_release) \
1183 && !defined(AO_HAVE_short_fetch_and_add1_release)
1184# define AO_short_fetch_and_add1_release(addr) \
1185 AO_short_fetch_and_add_release(addr, 1)
1186# define AO_HAVE_short_fetch_and_add1_release
1188#if defined(AO_HAVE_short_fetch_and_add_acquire) \
1189 && !defined(AO_HAVE_short_fetch_and_add1_acquire)
1190# define AO_short_fetch_and_add1_acquire(addr) \
1191 AO_short_fetch_and_add_acquire(addr, 1)
1192# define AO_HAVE_short_fetch_and_add1_acquire
1194#if defined(AO_HAVE_short_fetch_and_add_write) \
1195 && !defined(AO_HAVE_short_fetch_and_add1_write)
1196# define AO_short_fetch_and_add1_write(addr) \
1197 AO_short_fetch_and_add_write(addr, 1)
1198# define AO_HAVE_short_fetch_and_add1_write
1200#if defined(AO_HAVE_short_fetch_and_add_read) \
1201 && !defined(AO_HAVE_short_fetch_and_add1_read)
1202# define AO_short_fetch_and_add1_read(addr) \
1203 AO_short_fetch_and_add_read(addr, 1)
1204# define AO_HAVE_short_fetch_and_add1_read
1206#if defined(AO_HAVE_short_fetch_and_add_release_write) \
1207 && !defined(AO_HAVE_short_fetch_and_add1_release_write)
1208# define AO_short_fetch_and_add1_release_write(addr) \
1209 AO_short_fetch_and_add_release_write(addr, 1)
1210# define AO_HAVE_short_fetch_and_add1_release_write
1212#if defined(AO_HAVE_short_fetch_and_add_acquire_read) \
1213 && !defined(AO_HAVE_short_fetch_and_add1_acquire_read)
1214# define AO_short_fetch_and_add1_acquire_read(addr) \
1215 AO_short_fetch_and_add_acquire_read(addr, 1)
1216# define AO_HAVE_short_fetch_and_add1_acquire_read
1218#if defined(AO_HAVE_short_fetch_and_add) \
1219 && !defined(AO_HAVE_short_fetch_and_add1)
1220# define AO_short_fetch_and_add1(addr) AO_short_fetch_and_add(addr, 1)
1221# define AO_HAVE_short_fetch_and_add1
1224#if defined(AO_HAVE_short_fetch_and_add1_full)
1225# if !defined(AO_HAVE_short_fetch_and_add1_release)
1226# define AO_short_fetch_and_add1_release(addr) \
1227 AO_short_fetch_and_add1_full(addr)
1228# define AO_HAVE_short_fetch_and_add1_release
1230# if !defined(AO_HAVE_short_fetch_and_add1_acquire)
1231# define AO_short_fetch_and_add1_acquire(addr) \
1232 AO_short_fetch_and_add1_full(addr)
1233# define AO_HAVE_short_fetch_and_add1_acquire
1235# if !defined(AO_HAVE_short_fetch_and_add1_write)
1236# define AO_short_fetch_and_add1_write(addr) \
1237 AO_short_fetch_and_add1_full(addr)
1238# define AO_HAVE_short_fetch_and_add1_write
1240# if !defined(AO_HAVE_short_fetch_and_add1_read)
1241# define AO_short_fetch_and_add1_read(addr) \
1242 AO_short_fetch_and_add1_full(addr)
1243# define AO_HAVE_short_fetch_and_add1_read
1247#if !defined(AO_HAVE_short_fetch_and_add1) \
1248 && defined(AO_HAVE_short_fetch_and_add1_release)
1249# define AO_short_fetch_and_add1(addr) AO_short_fetch_and_add1_release(addr)
1250# define AO_HAVE_short_fetch_and_add1
1252#if !defined(AO_HAVE_short_fetch_and_add1) \
1253 && defined(AO_HAVE_short_fetch_and_add1_acquire)
1254# define AO_short_fetch_and_add1(addr) AO_short_fetch_and_add1_acquire(addr)
1255# define AO_HAVE_short_fetch_and_add1
1257#if !defined(AO_HAVE_short_fetch_and_add1) \
1258 && defined(AO_HAVE_short_fetch_and_add1_write)
1259# define AO_short_fetch_and_add1(addr) AO_short_fetch_and_add1_write(addr)
1260# define AO_HAVE_short_fetch_and_add1
1262#if !defined(AO_HAVE_short_fetch_and_add1) \
1263 && defined(AO_HAVE_short_fetch_and_add1_read)
1264# define AO_short_fetch_and_add1(addr) AO_short_fetch_and_add1_read(addr)
1265# define AO_HAVE_short_fetch_and_add1
1268#if defined(AO_HAVE_short_fetch_and_add1_acquire) \
1269 && defined(AO_HAVE_nop_full) \
1270 && !defined(AO_HAVE_short_fetch_and_add1_full)
1271# define AO_short_fetch_and_add1_full(addr) \
1272 (AO_nop_full(), AO_short_fetch_and_add1_acquire(addr))
1273# define AO_HAVE_short_fetch_and_add1_full
1276#if !defined(AO_HAVE_short_fetch_and_add1_release_write) \
1277 && defined(AO_HAVE_short_fetch_and_add1_write)
1278# define AO_short_fetch_and_add1_release_write(addr) \
1279 AO_short_fetch_and_add1_write(addr)
1280# define AO_HAVE_short_fetch_and_add1_release_write
1282#if !defined(AO_HAVE_short_fetch_and_add1_release_write) \
1283 && defined(AO_HAVE_short_fetch_and_add1_release)
1284# define AO_short_fetch_and_add1_release_write(addr) \
1285 AO_short_fetch_and_add1_release(addr)
1286# define AO_HAVE_short_fetch_and_add1_release_write
1288#if !defined(AO_HAVE_short_fetch_and_add1_acquire_read) \
1289 && defined(AO_HAVE_short_fetch_and_add1_read)
1290# define AO_short_fetch_and_add1_acquire_read(addr) \
1291 AO_short_fetch_and_add1_read(addr)
1292# define AO_HAVE_short_fetch_and_add1_acquire_read
1294#if !defined(AO_HAVE_short_fetch_and_add1_acquire_read) \
1295 && defined(AO_HAVE_short_fetch_and_add1_acquire)
1296# define AO_short_fetch_and_add1_acquire_read(addr) \
1297 AO_short_fetch_and_add1_acquire(addr)
1298# define AO_HAVE_short_fetch_and_add1_acquire_read
1301#ifdef AO_NO_DD_ORDERING
1302# if defined(AO_HAVE_short_fetch_and_add1_acquire_read)
1303# define AO_short_fetch_and_add1_dd_acquire_read(addr) \
1304 AO_short_fetch_and_add1_acquire_read(addr)
1305# define AO_HAVE_short_fetch_and_add1_dd_acquire_read
1308# if defined(AO_HAVE_short_fetch_and_add1)
1309# define AO_short_fetch_and_add1_dd_acquire_read(addr) \
1310 AO_short_fetch_and_add1(addr)
1311# define AO_HAVE_short_fetch_and_add1_dd_acquire_read
1316#if defined(AO_HAVE_short_fetch_and_add_full) \
1317 && !defined(AO_HAVE_short_fetch_and_sub1_full)
1318# define AO_short_fetch_and_sub1_full(addr) \
1319 AO_short_fetch_and_add_full(addr, (unsignedshort)(-1))
1320# define AO_HAVE_short_fetch_and_sub1_full
1322#if defined(AO_HAVE_short_fetch_and_add_release) \
1323 && !defined(AO_HAVE_short_fetch_and_sub1_release)
1324# define AO_short_fetch_and_sub1_release(addr) \
1325 AO_short_fetch_and_add_release(addr, (unsignedshort)(-1))
1326# define AO_HAVE_short_fetch_and_sub1_release
1328#if defined(AO_HAVE_short_fetch_and_add_acquire) \
1329 && !defined(AO_HAVE_short_fetch_and_sub1_acquire)
1330# define AO_short_fetch_and_sub1_acquire(addr) \
1331 AO_short_fetch_and_add_acquire(addr, (unsignedshort)(-1))
1332# define AO_HAVE_short_fetch_and_sub1_acquire
1334#if defined(AO_HAVE_short_fetch_and_add_write) \
1335 && !defined(AO_HAVE_short_fetch_and_sub1_write)
1336# define AO_short_fetch_and_sub1_write(addr) \
1337 AO_short_fetch_and_add_write(addr, (unsignedshort)(-1))
1338# define AO_HAVE_short_fetch_and_sub1_write
1340#if defined(AO_HAVE_short_fetch_and_add_read) \
1341 && !defined(AO_HAVE_short_fetch_and_sub1_read)
1342# define AO_short_fetch_and_sub1_read(addr) \
1343 AO_short_fetch_and_add_read(addr, (unsignedshort)(-1))
1344# define AO_HAVE_short_fetch_and_sub1_read
1346#if defined(AO_HAVE_short_fetch_and_add_release_write) \
1347 && !defined(AO_HAVE_short_fetch_and_sub1_release_write)
1348# define AO_short_fetch_and_sub1_release_write(addr) \
1349 AO_short_fetch_and_add_release_write(addr, (unsignedshort)(-1))
1350# define AO_HAVE_short_fetch_and_sub1_release_write
1352#if defined(AO_HAVE_short_fetch_and_add_acquire_read) \
1353 && !defined(AO_HAVE_short_fetch_and_sub1_acquire_read)
1354# define AO_short_fetch_and_sub1_acquire_read(addr) \
1355 AO_short_fetch_and_add_acquire_read(addr, (unsignedshort)(-1))
1356# define AO_HAVE_short_fetch_and_sub1_acquire_read
1358#if defined(AO_HAVE_short_fetch_and_add) \
1359 && !defined(AO_HAVE_short_fetch_and_sub1)
1360# define AO_short_fetch_and_sub1(addr) \
1361 AO_short_fetch_and_add(addr, (unsignedshort)(-1))
1362# define AO_HAVE_short_fetch_and_sub1
1365#if defined(AO_HAVE_short_fetch_and_sub1_full)
1366# if !defined(AO_HAVE_short_fetch_and_sub1_release)
1367# define AO_short_fetch_and_sub1_release(addr) \
1368 AO_short_fetch_and_sub1_full(addr)
1369# define AO_HAVE_short_fetch_and_sub1_release
1371# if !defined(AO_HAVE_short_fetch_and_sub1_acquire)
1372# define AO_short_fetch_and_sub1_acquire(addr) \
1373 AO_short_fetch_and_sub1_full(addr)
1374# define AO_HAVE_short_fetch_and_sub1_acquire
1376# if !defined(AO_HAVE_short_fetch_and_sub1_write)
1377# define AO_short_fetch_and_sub1_write(addr) \
1378 AO_short_fetch_and_sub1_full(addr)
1379# define AO_HAVE_short_fetch_and_sub1_write
1381# if !defined(AO_HAVE_short_fetch_and_sub1_read)
1382# define AO_short_fetch_and_sub1_read(addr) \
1383 AO_short_fetch_and_sub1_full(addr)
1384# define AO_HAVE_short_fetch_and_sub1_read
1388#if !defined(AO_HAVE_short_fetch_and_sub1) \
1389 && defined(AO_HAVE_short_fetch_and_sub1_release)
1390# define AO_short_fetch_and_sub1(addr) AO_short_fetch_and_sub1_release(addr)
1391# define AO_HAVE_short_fetch_and_sub1
1393#if !defined(AO_HAVE_short_fetch_and_sub1) \
1394 && defined(AO_HAVE_short_fetch_and_sub1_acquire)
1395# define AO_short_fetch_and_sub1(addr) AO_short_fetch_and_sub1_acquire(addr)
1396# define AO_HAVE_short_fetch_and_sub1
1398#if !defined(AO_HAVE_short_fetch_and_sub1) \
1399 && defined(AO_HAVE_short_fetch_and_sub1_write)
1400# define AO_short_fetch_and_sub1(addr) AO_short_fetch_and_sub1_write(addr)
1401# define AO_HAVE_short_fetch_and_sub1
1403#if !defined(AO_HAVE_short_fetch_and_sub1) \
1404 && defined(AO_HAVE_short_fetch_and_sub1_read)
1405# define AO_short_fetch_and_sub1(addr) AO_short_fetch_and_sub1_read(addr)
1406# define AO_HAVE_short_fetch_and_sub1
1409#if defined(AO_HAVE_short_fetch_and_sub1_acquire) \
1410 && defined(AO_HAVE_nop_full) \
1411 && !defined(AO_HAVE_short_fetch_and_sub1_full)
1412# define AO_short_fetch_and_sub1_full(addr) \
1413 (AO_nop_full(), AO_short_fetch_and_sub1_acquire(addr))
1414# define AO_HAVE_short_fetch_and_sub1_full
1417#if !defined(AO_HAVE_short_fetch_and_sub1_release_write) \
1418 && defined(AO_HAVE_short_fetch_and_sub1_write)
1419# define AO_short_fetch_and_sub1_release_write(addr) \
1420 AO_short_fetch_and_sub1_write(addr)
1421# define AO_HAVE_short_fetch_and_sub1_release_write
1423#if !defined(AO_HAVE_short_fetch_and_sub1_release_write) \
1424 && defined(AO_HAVE_short_fetch_and_sub1_release)
1425# define AO_short_fetch_and_sub1_release_write(addr) \
1426 AO_short_fetch_and_sub1_release(addr)
1427# define AO_HAVE_short_fetch_and_sub1_release_write
1429#if !defined(AO_HAVE_short_fetch_and_sub1_acquire_read) \
1430 && defined(AO_HAVE_short_fetch_and_sub1_read)
1431# define AO_short_fetch_and_sub1_acquire_read(addr) \
1432 AO_short_fetch_and_sub1_read(addr)
1433# define AO_HAVE_short_fetch_and_sub1_acquire_read
1435#if !defined(AO_HAVE_short_fetch_and_sub1_acquire_read) \
1436 && defined(AO_HAVE_short_fetch_and_sub1_acquire)
1437# define AO_short_fetch_and_sub1_acquire_read(addr) \
1438 AO_short_fetch_and_sub1_acquire(addr)
1439# define AO_HAVE_short_fetch_and_sub1_acquire_read
1442#ifdef AO_NO_DD_ORDERING
1443# if defined(AO_HAVE_short_fetch_and_sub1_acquire_read)
1444# define AO_short_fetch_and_sub1_dd_acquire_read(addr) \
1445 AO_short_fetch_and_sub1_acquire_read(addr)
1446# define AO_HAVE_short_fetch_and_sub1_dd_acquire_read
1449# if defined(AO_HAVE_short_fetch_and_sub1)
1450# define AO_short_fetch_and_sub1_dd_acquire_read(addr) \
1451 AO_short_fetch_and_sub1(addr)
1452# define AO_HAVE_short_fetch_and_sub1_dd_acquire_read
1457#if defined(AO_HAVE_short_compare_and_swap_full) \
1458 && !defined(AO_HAVE_short_and_full)
1467 old = *(
unsignedshort *)addr;
1472# define AO_HAVE_short_and_full
1475#if defined(AO_HAVE_short_and_full)
1476# if !defined(AO_HAVE_short_and_release)
1477# define AO_short_and_release(addr, val) AO_short_and_full(addr, val)
1478# define AO_HAVE_short_and_release
1480# if !defined(AO_HAVE_short_and_acquire)
1481# define AO_short_and_acquire(addr, val) AO_short_and_full(addr, val)
1482# define AO_HAVE_short_and_acquire
1484# if !defined(AO_HAVE_short_and_write)
1485# define AO_short_and_write(addr, val) AO_short_and_full(addr, val)
1486# define AO_HAVE_short_and_write
1488# if !defined(AO_HAVE_short_and_read)
1489# define AO_short_and_read(addr, val) AO_short_and_full(addr, val)
1490# define AO_HAVE_short_and_read
1494#if !defined(AO_HAVE_short_and) && defined(AO_HAVE_short_and_release)
1495# define AO_short_and(addr, val) AO_short_and_release(addr, val)
1496# define AO_HAVE_short_and
1498#if !defined(AO_HAVE_short_and) && defined(AO_HAVE_short_and_acquire)
1499# define AO_short_and(addr, val) AO_short_and_acquire(addr, val)
1500# define AO_HAVE_short_and
1502#if !defined(AO_HAVE_short_and) && defined(AO_HAVE_short_and_write)
1503# define AO_short_and(addr, val) AO_short_and_write(addr, val)
1504# define AO_HAVE_short_and
1506#if !defined(AO_HAVE_short_and) && defined(AO_HAVE_short_and_read)
1507# define AO_short_and(addr, val) AO_short_and_read(addr, val)
1508# define AO_HAVE_short_and
1511#if defined(AO_HAVE_short_and_acquire) && defined(AO_HAVE_nop_full) \
1512 && !defined(AO_HAVE_short_and_full)
1513# define AO_short_and_full(addr, val) \
1514 (AO_nop_full(), AO_short_and_acquire(addr, val))
1515# define AO_HAVE_short_and_full
1518#if !defined(AO_HAVE_short_and_release_write) \
1519 && defined(AO_HAVE_short_and_write)
1520# define AO_short_and_release_write(addr, val) AO_short_and_write(addr, val)
1521# define AO_HAVE_short_and_release_write
1523#if !defined(AO_HAVE_short_and_release_write) \
1524 && defined(AO_HAVE_short_and_release)
1525# define AO_short_and_release_write(addr, val) AO_short_and_release(addr, val)
1526# define AO_HAVE_short_and_release_write
1528#if !defined(AO_HAVE_short_and_acquire_read) \
1529 && defined(AO_HAVE_short_and_read)
1530# define AO_short_and_acquire_read(addr, val) AO_short_and_read(addr, val)
1531# define AO_HAVE_short_and_acquire_read
1533#if !defined(AO_HAVE_short_and_acquire_read) \
1534 && defined(AO_HAVE_short_and_acquire)
1535# define AO_short_and_acquire_read(addr, val) AO_short_and_acquire(addr, val)
1536# define AO_HAVE_short_and_acquire_read
1540#if defined(AO_HAVE_short_compare_and_swap_full) \
1541 && !defined(AO_HAVE_short_or_full)
1550 old = *(
unsignedshort *)addr;
1555# define AO_HAVE_short_or_full
1558#if defined(AO_HAVE_short_or_full)
1559# if !defined(AO_HAVE_short_or_release)
1560# define AO_short_or_release(addr, val) AO_short_or_full(addr, val)
1561# define AO_HAVE_short_or_release
1563# if !defined(AO_HAVE_short_or_acquire)
1564# define AO_short_or_acquire(addr, val) AO_short_or_full(addr, val)
1565# define AO_HAVE_short_or_acquire
1567# if !defined(AO_HAVE_short_or_write)
1568# define AO_short_or_write(addr, val) AO_short_or_full(addr, val)
1569# define AO_HAVE_short_or_write
1571# if !defined(AO_HAVE_short_or_read)
1572# define AO_short_or_read(addr, val) AO_short_or_full(addr, val)
1573# define AO_HAVE_short_or_read
1577#if !defined(AO_HAVE_short_or) && defined(AO_HAVE_short_or_release)
1578# define AO_short_or(addr, val) AO_short_or_release(addr, val)
1579# define AO_HAVE_short_or
1581#if !defined(AO_HAVE_short_or) && defined(AO_HAVE_short_or_acquire)
1582# define AO_short_or(addr, val) AO_short_or_acquire(addr, val)
1583# define AO_HAVE_short_or
1585#if !defined(AO_HAVE_short_or) && defined(AO_HAVE_short_or_write)
1586# define AO_short_or(addr, val) AO_short_or_write(addr, val)
1587# define AO_HAVE_short_or
1589#if !defined(AO_HAVE_short_or) && defined(AO_HAVE_short_or_read)
1590# define AO_short_or(addr, val) AO_short_or_read(addr, val)
1591# define AO_HAVE_short_or
1594#if defined(AO_HAVE_short_or_acquire) && defined(AO_HAVE_nop_full) \
1595 && !defined(AO_HAVE_short_or_full)
1596# define AO_short_or_full(addr, val) \
1597 (AO_nop_full(), AO_short_or_acquire(addr, val))
1598# define AO_HAVE_short_or_full
1601#if !defined(AO_HAVE_short_or_release_write) \
1602 && defined(AO_HAVE_short_or_write)
1603# define AO_short_or_release_write(addr, val) AO_short_or_write(addr, val)
1604# define AO_HAVE_short_or_release_write
1606#if !defined(AO_HAVE_short_or_release_write) \
1607 && defined(AO_HAVE_short_or_release)
1608# define AO_short_or_release_write(addr, val) AO_short_or_release(addr, val)
1609# define AO_HAVE_short_or_release_write
1611#if !defined(AO_HAVE_short_or_acquire_read) && defined(AO_HAVE_short_or_read)
1612# define AO_short_or_acquire_read(addr, val) AO_short_or_read(addr, val)
1613# define AO_HAVE_short_or_acquire_read
1615#if !defined(AO_HAVE_short_or_acquire_read) \
1616 && defined(AO_HAVE_short_or_acquire)
1617# define AO_short_or_acquire_read(addr, val) AO_short_or_acquire(addr, val)
1618# define AO_HAVE_short_or_acquire_read
1622#if defined(AO_HAVE_short_compare_and_swap_full) \
1623 && !defined(AO_HAVE_short_xor_full)
1632 old = *(
unsignedshort *)addr;
1637# define AO_HAVE_short_xor_full
1640#if defined(AO_HAVE_short_xor_full)
1641# if !defined(AO_HAVE_short_xor_release)
1642# define AO_short_xor_release(addr, val) AO_short_xor_full(addr, val)
1643# define AO_HAVE_short_xor_release
1645# if !defined(AO_HAVE_short_xor_acquire)
1646# define AO_short_xor_acquire(addr, val) AO_short_xor_full(addr, val)
1647# define AO_HAVE_short_xor_acquire
1649# if !defined(AO_HAVE_short_xor_write)
1650# define AO_short_xor_write(addr, val) AO_short_xor_full(addr, val)
1651# define AO_HAVE_short_xor_write
1653# if !defined(AO_HAVE_short_xor_read)
1654# define AO_short_xor_read(addr, val) AO_short_xor_full(addr, val)
1655# define AO_HAVE_short_xor_read
1659#if !defined(AO_HAVE_short_xor) && defined(AO_HAVE_short_xor_release)
1660# define AO_short_xor(addr, val) AO_short_xor_release(addr, val)
1661# define AO_HAVE_short_xor
1663#if !defined(AO_HAVE_short_xor) && defined(AO_HAVE_short_xor_acquire)
1664# define AO_short_xor(addr, val) AO_short_xor_acquire(addr, val)
1665# define AO_HAVE_short_xor
1667#if !defined(AO_HAVE_short_xor) && defined(AO_HAVE_short_xor_write)
1668# define AO_short_xor(addr, val) AO_short_xor_write(addr, val)
1669# define AO_HAVE_short_xor
1671#if !defined(AO_HAVE_short_xor) && defined(AO_HAVE_short_xor_read)
1672# define AO_short_xor(addr, val) AO_short_xor_read(addr, val)
1673# define AO_HAVE_short_xor
1676#if defined(AO_HAVE_short_xor_acquire) && defined(AO_HAVE_nop_full) \
1677 && !defined(AO_HAVE_short_xor_full)
1678# define AO_short_xor_full(addr, val) \
1679 (AO_nop_full(), AO_short_xor_acquire(addr, val))
1680# define AO_HAVE_short_xor_full
1683#if !defined(AO_HAVE_short_xor_release_write) \
1684 && defined(AO_HAVE_short_xor_write)
1685# define AO_short_xor_release_write(addr, val) AO_short_xor_write(addr, val)
1686# define AO_HAVE_short_xor_release_write
1688#if !defined(AO_HAVE_short_xor_release_write) \
1689 && defined(AO_HAVE_short_xor_release)
1690# define AO_short_xor_release_write(addr, val) AO_short_xor_release(addr, val)
1691# define AO_HAVE_short_xor_release_write
1693#if !defined(AO_HAVE_short_xor_acquire_read) \
1694 && defined(AO_HAVE_short_xor_read)
1695# define AO_short_xor_acquire_read(addr, val) AO_short_xor_read(addr, val)
1696# define AO_HAVE_short_xor_acquire_read
1698#if !defined(AO_HAVE_short_xor_acquire_read) \
1699 && defined(AO_HAVE_short_xor_acquire)
1700# define AO_short_xor_acquire_read(addr, val) AO_short_xor_acquire(addr, val)
1701# define AO_HAVE_short_xor_acquire_read
1728#if defined(AO_HAVE_int_fetch_compare_and_swap_full) \
1729 && !defined(AO_HAVE_int_compare_and_swap_full)
1731 AO_int_compare_and_swap_full(
volatile unsigned *addr,
unsigned old_val,
1737# define AO_HAVE_int_compare_and_swap_full
1740#if defined(AO_HAVE_int_fetch_compare_and_swap_acquire) \
1741 && !defined(AO_HAVE_int_compare_and_swap_acquire)
1743 AO_int_compare_and_swap_acquire(
volatile unsigned *addr,
unsigned old_val,
1749# define AO_HAVE_int_compare_and_swap_acquire
1752#if defined(AO_HAVE_int_fetch_compare_and_swap_release) \
1753 && !defined(AO_HAVE_int_compare_and_swap_release)
1755 AO_int_compare_and_swap_release(
volatile unsigned *addr,
unsigned old_val,
1761# define AO_HAVE_int_compare_and_swap_release
1764#if defined(AO_HAVE_int_fetch_compare_and_swap_write) \
1765 && !defined(AO_HAVE_int_compare_and_swap_write)
1767 AO_int_compare_and_swap_write(
volatile unsigned *addr,
unsigned old_val,
1770 return AO_int_fetch_compare_and_swap_write(addr, old_val, new_val)
1773# define AO_HAVE_int_compare_and_swap_write
1776#if defined(AO_HAVE_int_fetch_compare_and_swap_read) \
1777 && !defined(AO_HAVE_int_compare_and_swap_read)
1779 AO_int_compare_and_swap_read(
volatile unsigned *addr,
unsigned old_val,
1782 return AO_int_fetch_compare_and_swap_read(addr, old_val, new_val)
1785# define AO_HAVE_int_compare_and_swap_read
1788#if defined(AO_HAVE_int_fetch_compare_and_swap) \
1789 && !defined(AO_HAVE_int_compare_and_swap)
1791 AO_int_compare_and_swap(
volatile unsigned *addr,
unsigned old_val,
1794 return AO_int_fetch_compare_and_swap(addr, old_val, new_val) == old_val;
1796# define AO_HAVE_int_compare_and_swap
1799#if defined(AO_HAVE_int_fetch_compare_and_swap_release_write) \
1800 && !defined(AO_HAVE_int_compare_and_swap_release_write)
1802 AO_int_compare_and_swap_release_write(
volatile unsigned *addr,
1803 unsigned old_val,
unsigned new_val)
1805 return AO_int_fetch_compare_and_swap_release_write(addr, old_val,
1806 new_val) == old_val;
1808# define AO_HAVE_int_compare_and_swap_release_write
1811#if defined(AO_HAVE_int_fetch_compare_and_swap_acquire_read) \
1812 && !defined(AO_HAVE_int_compare_and_swap_acquire_read)
1814 AO_int_compare_and_swap_acquire_read(
volatile unsigned *addr,
1815 unsigned old_val,
unsigned new_val)
1817 return AO_int_fetch_compare_and_swap_acquire_read(addr, old_val,
1818 new_val) == old_val;
1820# define AO_HAVE_int_compare_and_swap_acquire_read
1823#if defined(AO_HAVE_int_fetch_compare_and_swap_dd_acquire_read) \
1824 && !defined(AO_HAVE_int_compare_and_swap_dd_acquire_read)
1826 AO_int_compare_and_swap_dd_acquire_read(
volatile unsigned *addr,
1827 unsigned old_val,
unsigned new_val)
1829 return AO_int_fetch_compare_and_swap_dd_acquire_read(addr, old_val,
1830 new_val) == old_val;
1832# define AO_HAVE_int_compare_and_swap_dd_acquire_read
1838#if defined(AO_HAVE_int_compare_and_swap_full) \
1839 && !defined(AO_HAVE_int_fetch_and_add_full)
1848 old = *(
unsigned *)addr;
1854# define AO_HAVE_int_fetch_and_add_full
1857#if defined(AO_HAVE_int_compare_and_swap_acquire) \
1858 && !defined(AO_HAVE_int_fetch_and_add_acquire)
1867 old = *(
unsigned *)addr;
1873# define AO_HAVE_int_fetch_and_add_acquire
1876#if defined(AO_HAVE_int_compare_and_swap_release) \
1877 && !defined(AO_HAVE_int_fetch_and_add_release)
1886 old = *(
unsigned *)addr;
1892# define AO_HAVE_int_fetch_and_add_release
1895#if defined(AO_HAVE_int_compare_and_swap) \
1896 && !defined(AO_HAVE_int_fetch_and_add)
1905 old = *(
unsigned *)addr;
1911# define AO_HAVE_int_fetch_and_add
1914#if defined(AO_HAVE_int_fetch_and_add_full)
1915# if !defined(AO_HAVE_int_fetch_and_add_release)
1916# define AO_int_fetch_and_add_release(addr, val) \
1917 AO_int_fetch_and_add_full(addr, val)
1918# define AO_HAVE_int_fetch_and_add_release
1920# if !defined(AO_HAVE_int_fetch_and_add_acquire)
1921# define AO_int_fetch_and_add_acquire(addr, val) \
1922 AO_int_fetch_and_add_full(addr, val)
1923# define AO_HAVE_int_fetch_and_add_acquire
1925# if !defined(AO_HAVE_int_fetch_and_add_write)
1926# define AO_int_fetch_and_add_write(addr, val) \
1927 AO_int_fetch_and_add_full(addr, val)
1928# define AO_HAVE_int_fetch_and_add_write
1930# if !defined(AO_HAVE_int_fetch_and_add_read)
1931# define AO_int_fetch_and_add_read(addr, val) \
1932 AO_int_fetch_and_add_full(addr, val)
1933# define AO_HAVE_int_fetch_and_add_read
1937#if defined(AO_HAVE_int_fetch_and_add) && defined(AO_HAVE_nop_full) \
1938 && !defined(AO_HAVE_int_fetch_and_add_acquire)
1946# define AO_HAVE_int_fetch_and_add_acquire
1948#if defined(AO_HAVE_int_fetch_and_add) && defined(AO_HAVE_nop_full) \
1949 && !defined(AO_HAVE_int_fetch_and_add_release)
1950# define AO_int_fetch_and_add_release(addr, incr) \
1951 (AO_nop_full(), AO_int_fetch_and_add(addr, incr))
1952# define AO_HAVE_int_fetch_and_add_release
1955#if !defined(AO_HAVE_int_fetch_and_add) \
1956 && defined(AO_HAVE_int_fetch_and_add_release)
1957# define AO_int_fetch_and_add(addr, val) \
1958 AO_int_fetch_and_add_release(addr, val)
1959# define AO_HAVE_int_fetch_and_add
1961#if !defined(AO_HAVE_int_fetch_and_add) \
1962 && defined(AO_HAVE_int_fetch_and_add_acquire)
1963# define AO_int_fetch_and_add(addr, val) \
1964 AO_int_fetch_and_add_acquire(addr, val)
1965# define AO_HAVE_int_fetch_and_add
1967#if !defined(AO_HAVE_int_fetch_and_add) \
1968 && defined(AO_HAVE_int_fetch_and_add_write)
1969# define AO_int_fetch_and_add(addr, val) \
1970 AO_int_fetch_and_add_write(addr, val)
1971# define AO_HAVE_int_fetch_and_add
1973#if !defined(AO_HAVE_int_fetch_and_add) \
1974 && defined(AO_HAVE_int_fetch_and_add_read)
1975# define AO_int_fetch_and_add(addr, val) \
1976 AO_int_fetch_and_add_read(addr, val)
1977# define AO_HAVE_int_fetch_and_add
1980#if defined(AO_HAVE_int_fetch_and_add_acquire) \
1981 && defined(AO_HAVE_nop_full) && !defined(AO_HAVE_int_fetch_and_add_full)
1982# define AO_int_fetch_and_add_full(addr, val) \
1983 (AO_nop_full(), AO_int_fetch_and_add_acquire(addr, val))
1984# define AO_HAVE_int_fetch_and_add_full
1987#if !defined(AO_HAVE_int_fetch_and_add_release_write) \
1988 && defined(AO_HAVE_int_fetch_and_add_write)
1989# define AO_int_fetch_and_add_release_write(addr, val) \
1990 AO_int_fetch_and_add_write(addr, val)
1991# define AO_HAVE_int_fetch_and_add_release_write
1993#if !defined(AO_HAVE_int_fetch_and_add_release_write) \
1994 && defined(AO_HAVE_int_fetch_and_add_release)
1995# define AO_int_fetch_and_add_release_write(addr, val) \
1996 AO_int_fetch_and_add_release(addr, val)
1997# define AO_HAVE_int_fetch_and_add_release_write
2000#if !defined(AO_HAVE_int_fetch_and_add_acquire_read) \
2001 && defined(AO_HAVE_int_fetch_and_add_read)
2002# define AO_int_fetch_and_add_acquire_read(addr, val) \
2003 AO_int_fetch_and_add_read(addr, val)
2004# define AO_HAVE_int_fetch_and_add_acquire_read
2006#if !defined(AO_HAVE_int_fetch_and_add_acquire_read) \
2007 && defined(AO_HAVE_int_fetch_and_add_acquire)
2008# define AO_int_fetch_and_add_acquire_read(addr, val) \
2009 AO_int_fetch_and_add_acquire(addr, val)
2010# define AO_HAVE_int_fetch_and_add_acquire_read
2013#ifdef AO_NO_DD_ORDERING
2014# if defined(AO_HAVE_int_fetch_and_add_acquire_read)
2015# define AO_int_fetch_and_add_dd_acquire_read(addr, val) \
2016 AO_int_fetch_and_add_acquire_read(addr, val)
2017# define AO_HAVE_int_fetch_and_add_dd_acquire_read
2020# if defined(AO_HAVE_int_fetch_and_add)
2021# define AO_int_fetch_and_add_dd_acquire_read(addr, val) \
2022 AO_int_fetch_and_add(addr, val)
2023# define AO_HAVE_int_fetch_and_add_dd_acquire_read
2028#if defined(AO_HAVE_int_fetch_and_add_full) \
2029 && !defined(AO_HAVE_int_fetch_and_add1_full)
2030# define AO_int_fetch_and_add1_full(addr) \
2031 AO_int_fetch_and_add_full(addr, 1)
2032# define AO_HAVE_int_fetch_and_add1_full
2034#if defined(AO_HAVE_int_fetch_and_add_release) \
2035 && !defined(AO_HAVE_int_fetch_and_add1_release)
2036# define AO_int_fetch_and_add1_release(addr) \
2037 AO_int_fetch_and_add_release(addr, 1)
2038# define AO_HAVE_int_fetch_and_add1_release
2040#if defined(AO_HAVE_int_fetch_and_add_acquire) \
2041 && !defined(AO_HAVE_int_fetch_and_add1_acquire)
2042# define AO_int_fetch_and_add1_acquire(addr) \
2043 AO_int_fetch_and_add_acquire(addr, 1)
2044# define AO_HAVE_int_fetch_and_add1_acquire
2046#if defined(AO_HAVE_int_fetch_and_add_write) \
2047 && !defined(AO_HAVE_int_fetch_and_add1_write)
2048# define AO_int_fetch_and_add1_write(addr) \
2049 AO_int_fetch_and_add_write(addr, 1)
2050# define AO_HAVE_int_fetch_and_add1_write
2052#if defined(AO_HAVE_int_fetch_and_add_read) \
2053 && !defined(AO_HAVE_int_fetch_and_add1_read)
2054# define AO_int_fetch_and_add1_read(addr) \
2055 AO_int_fetch_and_add_read(addr, 1)
2056# define AO_HAVE_int_fetch_and_add1_read
2058#if defined(AO_HAVE_int_fetch_and_add_release_write) \
2059 && !defined(AO_HAVE_int_fetch_and_add1_release_write)
2060# define AO_int_fetch_and_add1_release_write(addr) \
2061 AO_int_fetch_and_add_release_write(addr, 1)
2062# define AO_HAVE_int_fetch_and_add1_release_write
2064#if defined(AO_HAVE_int_fetch_and_add_acquire_read) \
2065 && !defined(AO_HAVE_int_fetch_and_add1_acquire_read)
2066# define AO_int_fetch_and_add1_acquire_read(addr) \
2067 AO_int_fetch_and_add_acquire_read(addr, 1)
2068# define AO_HAVE_int_fetch_and_add1_acquire_read
2070#if defined(AO_HAVE_int_fetch_and_add) \
2071 && !defined(AO_HAVE_int_fetch_and_add1)
2072# define AO_int_fetch_and_add1(addr) AO_int_fetch_and_add(addr, 1)
2073# define AO_HAVE_int_fetch_and_add1
2076#if defined(AO_HAVE_int_fetch_and_add1_full)
2077# if !defined(AO_HAVE_int_fetch_and_add1_release)
2078# define AO_int_fetch_and_add1_release(addr) \
2079 AO_int_fetch_and_add1_full(addr)
2080# define AO_HAVE_int_fetch_and_add1_release
2082# if !defined(AO_HAVE_int_fetch_and_add1_acquire)
2083# define AO_int_fetch_and_add1_acquire(addr) \
2084 AO_int_fetch_and_add1_full(addr)
2085# define AO_HAVE_int_fetch_and_add1_acquire
2087# if !defined(AO_HAVE_int_fetch_and_add1_write)
2088# define AO_int_fetch_and_add1_write(addr) \
2089 AO_int_fetch_and_add1_full(addr)
2090# define AO_HAVE_int_fetch_and_add1_write
2092# if !defined(AO_HAVE_int_fetch_and_add1_read)
2093# define AO_int_fetch_and_add1_read(addr) \
2094 AO_int_fetch_and_add1_full(addr)
2095# define AO_HAVE_int_fetch_and_add1_read
2099#if !defined(AO_HAVE_int_fetch_and_add1) \
2100 && defined(AO_HAVE_int_fetch_and_add1_release)
2101# define AO_int_fetch_and_add1(addr) AO_int_fetch_and_add1_release(addr)
2102# define AO_HAVE_int_fetch_and_add1
2104#if !defined(AO_HAVE_int_fetch_and_add1) \
2105 && defined(AO_HAVE_int_fetch_and_add1_acquire)
2106# define AO_int_fetch_and_add1(addr) AO_int_fetch_and_add1_acquire(addr)
2107# define AO_HAVE_int_fetch_and_add1
2109#if !defined(AO_HAVE_int_fetch_and_add1) \
2110 && defined(AO_HAVE_int_fetch_and_add1_write)
2111# define AO_int_fetch_and_add1(addr) AO_int_fetch_and_add1_write(addr)
2112# define AO_HAVE_int_fetch_and_add1
2114#if !defined(AO_HAVE_int_fetch_and_add1) \
2115 && defined(AO_HAVE_int_fetch_and_add1_read)
2116# define AO_int_fetch_and_add1(addr) AO_int_fetch_and_add1_read(addr)
2117# define AO_HAVE_int_fetch_and_add1
2120#if defined(AO_HAVE_int_fetch_and_add1_acquire) \
2121 && defined(AO_HAVE_nop_full) \
2122 && !defined(AO_HAVE_int_fetch_and_add1_full)
2123# define AO_int_fetch_and_add1_full(addr) \
2124 (AO_nop_full(), AO_int_fetch_and_add1_acquire(addr))
2125# define AO_HAVE_int_fetch_and_add1_full
2128#if !defined(AO_HAVE_int_fetch_and_add1_release_write) \
2129 && defined(AO_HAVE_int_fetch_and_add1_write)
2130# define AO_int_fetch_and_add1_release_write(addr) \
2131 AO_int_fetch_and_add1_write(addr)
2132# define AO_HAVE_int_fetch_and_add1_release_write
2134#if !defined(AO_HAVE_int_fetch_and_add1_release_write) \
2135 && defined(AO_HAVE_int_fetch_and_add1_release)
2136# define AO_int_fetch_and_add1_release_write(addr) \
2137 AO_int_fetch_and_add1_release(addr)
2138# define AO_HAVE_int_fetch_and_add1_release_write
2140#if !defined(AO_HAVE_int_fetch_and_add1_acquire_read) \
2141 && defined(AO_HAVE_int_fetch_and_add1_read)
2142# define AO_int_fetch_and_add1_acquire_read(addr) \
2143 AO_int_fetch_and_add1_read(addr)
2144# define AO_HAVE_int_fetch_and_add1_acquire_read
2146#if !defined(AO_HAVE_int_fetch_and_add1_acquire_read) \
2147 && defined(AO_HAVE_int_fetch_and_add1_acquire)
2148# define AO_int_fetch_and_add1_acquire_read(addr) \
2149 AO_int_fetch_and_add1_acquire(addr)
2150# define AO_HAVE_int_fetch_and_add1_acquire_read
2153#ifdef AO_NO_DD_ORDERING
2154# if defined(AO_HAVE_int_fetch_and_add1_acquire_read)
2155# define AO_int_fetch_and_add1_dd_acquire_read(addr) \
2156 AO_int_fetch_and_add1_acquire_read(addr)
2157# define AO_HAVE_int_fetch_and_add1_dd_acquire_read
2160# if defined(AO_HAVE_int_fetch_and_add1)
2161# define AO_int_fetch_and_add1_dd_acquire_read(addr) \
2162 AO_int_fetch_and_add1(addr)
2163# define AO_HAVE_int_fetch_and_add1_dd_acquire_read
2168#if defined(AO_HAVE_int_fetch_and_add_full) \
2169 && !defined(AO_HAVE_int_fetch_and_sub1_full)
2170# define AO_int_fetch_and_sub1_full(addr) \
2171 AO_int_fetch_and_add_full(addr, (unsigned)(-1))
2172# define AO_HAVE_int_fetch_and_sub1_full
2174#if defined(AO_HAVE_int_fetch_and_add_release) \
2175 && !defined(AO_HAVE_int_fetch_and_sub1_release)
2176# define AO_int_fetch_and_sub1_release(addr) \
2177 AO_int_fetch_and_add_release(addr, (unsigned)(-1))
2178# define AO_HAVE_int_fetch_and_sub1_release
2180#if defined(AO_HAVE_int_fetch_and_add_acquire) \
2181 && !defined(AO_HAVE_int_fetch_and_sub1_acquire)
2182# define AO_int_fetch_and_sub1_acquire(addr) \
2183 AO_int_fetch_and_add_acquire(addr, (unsigned)(-1))
2184# define AO_HAVE_int_fetch_and_sub1_acquire
2186#if defined(AO_HAVE_int_fetch_and_add_write) \
2187 && !defined(AO_HAVE_int_fetch_and_sub1_write)
2188# define AO_int_fetch_and_sub1_write(addr) \
2189 AO_int_fetch_and_add_write(addr, (unsigned)(-1))
2190# define AO_HAVE_int_fetch_and_sub1_write
2192#if defined(AO_HAVE_int_fetch_and_add_read) \
2193 && !defined(AO_HAVE_int_fetch_and_sub1_read)
2194# define AO_int_fetch_and_sub1_read(addr) \
2195 AO_int_fetch_and_add_read(addr, (unsigned)(-1))
2196# define AO_HAVE_int_fetch_and_sub1_read
2198#if defined(AO_HAVE_int_fetch_and_add_release_write) \
2199 && !defined(AO_HAVE_int_fetch_and_sub1_release_write)
2200# define AO_int_fetch_and_sub1_release_write(addr) \
2201 AO_int_fetch_and_add_release_write(addr, (unsigned)(-1))
2202# define AO_HAVE_int_fetch_and_sub1_release_write
2204#if defined(AO_HAVE_int_fetch_and_add_acquire_read) \
2205 && !defined(AO_HAVE_int_fetch_and_sub1_acquire_read)
2206# define AO_int_fetch_and_sub1_acquire_read(addr) \
2207 AO_int_fetch_and_add_acquire_read(addr, (unsigned)(-1))
2208# define AO_HAVE_int_fetch_and_sub1_acquire_read
2210#if defined(AO_HAVE_int_fetch_and_add) \
2211 && !defined(AO_HAVE_int_fetch_and_sub1)
2212# define AO_int_fetch_and_sub1(addr) \
2213 AO_int_fetch_and_add(addr, (unsigned)(-1))
2214# define AO_HAVE_int_fetch_and_sub1
2217#if defined(AO_HAVE_int_fetch_and_sub1_full)
2218# if !defined(AO_HAVE_int_fetch_and_sub1_release)
2219# define AO_int_fetch_and_sub1_release(addr) \
2220 AO_int_fetch_and_sub1_full(addr)
2221# define AO_HAVE_int_fetch_and_sub1_release
2223# if !defined(AO_HAVE_int_fetch_and_sub1_acquire)
2224# define AO_int_fetch_and_sub1_acquire(addr) \
2225 AO_int_fetch_and_sub1_full(addr)
2226# define AO_HAVE_int_fetch_and_sub1_acquire
2228# if !defined(AO_HAVE_int_fetch_and_sub1_write)
2229# define AO_int_fetch_and_sub1_write(addr) \
2230 AO_int_fetch_and_sub1_full(addr)
2231# define AO_HAVE_int_fetch_and_sub1_write
2233# if !defined(AO_HAVE_int_fetch_and_sub1_read)
2234# define AO_int_fetch_and_sub1_read(addr) \
2235 AO_int_fetch_and_sub1_full(addr)
2236# define AO_HAVE_int_fetch_and_sub1_read
2240#if !defined(AO_HAVE_int_fetch_and_sub1) \
2241 && defined(AO_HAVE_int_fetch_and_sub1_release)
2242# define AO_int_fetch_and_sub1(addr) AO_int_fetch_and_sub1_release(addr)
2243# define AO_HAVE_int_fetch_and_sub1
2245#if !defined(AO_HAVE_int_fetch_and_sub1) \
2246 && defined(AO_HAVE_int_fetch_and_sub1_acquire)
2247# define AO_int_fetch_and_sub1(addr) AO_int_fetch_and_sub1_acquire(addr)
2248# define AO_HAVE_int_fetch_and_sub1
2250#if !defined(AO_HAVE_int_fetch_and_sub1) \
2251 && defined(AO_HAVE_int_fetch_and_sub1_write)
2252# define AO_int_fetch_and_sub1(addr) AO_int_fetch_and_sub1_write(addr)
2253# define AO_HAVE_int_fetch_and_sub1
2255#if !defined(AO_HAVE_int_fetch_and_sub1) \
2256 && defined(AO_HAVE_int_fetch_and_sub1_read)
2257# define AO_int_fetch_and_sub1(addr) AO_int_fetch_and_sub1_read(addr)
2258# define AO_HAVE_int_fetch_and_sub1
2261#if defined(AO_HAVE_int_fetch_and_sub1_acquire) \
2262 && defined(AO_HAVE_nop_full) \
2263 && !defined(AO_HAVE_int_fetch_and_sub1_full)
2264# define AO_int_fetch_and_sub1_full(addr) \
2265 (AO_nop_full(), AO_int_fetch_and_sub1_acquire(addr))
2266# define AO_HAVE_int_fetch_and_sub1_full
2269#if !defined(AO_HAVE_int_fetch_and_sub1_release_write) \
2270 && defined(AO_HAVE_int_fetch_and_sub1_write)
2271# define AO_int_fetch_and_sub1_release_write(addr) \
2272 AO_int_fetch_and_sub1_write(addr)
2273# define AO_HAVE_int_fetch_and_sub1_release_write
2275#if !defined(AO_HAVE_int_fetch_and_sub1_release_write) \
2276 && defined(AO_HAVE_int_fetch_and_sub1_release)
2277# define AO_int_fetch_and_sub1_release_write(addr) \
2278 AO_int_fetch_and_sub1_release(addr)
2279# define AO_HAVE_int_fetch_and_sub1_release_write
2281#if !defined(AO_HAVE_int_fetch_and_sub1_acquire_read) \
2282 && defined(AO_HAVE_int_fetch_and_sub1_read)
2283# define AO_int_fetch_and_sub1_acquire_read(addr) \
2284 AO_int_fetch_and_sub1_read(addr)
2285# define AO_HAVE_int_fetch_and_sub1_acquire_read
2287#if !defined(AO_HAVE_int_fetch_and_sub1_acquire_read) \
2288 && defined(AO_HAVE_int_fetch_and_sub1_acquire)
2289# define AO_int_fetch_and_sub1_acquire_read(addr) \
2290 AO_int_fetch_and_sub1_acquire(addr)
2291# define AO_HAVE_int_fetch_and_sub1_acquire_read
2294#ifdef AO_NO_DD_ORDERING
2295# if defined(AO_HAVE_int_fetch_and_sub1_acquire_read)
2296# define AO_int_fetch_and_sub1_dd_acquire_read(addr) \
2297 AO_int_fetch_and_sub1_acquire_read(addr)
2298# define AO_HAVE_int_fetch_and_sub1_dd_acquire_read
2301# if defined(AO_HAVE_int_fetch_and_sub1)
2302# define AO_int_fetch_and_sub1_dd_acquire_read(addr) \
2303 AO_int_fetch_and_sub1(addr)
2304# define AO_HAVE_int_fetch_and_sub1_dd_acquire_read
2309#if defined(AO_HAVE_int_compare_and_swap_full) \
2310 && !defined(AO_HAVE_int_and_full)
2319 old = *(
unsigned *)addr;
2324# define AO_HAVE_int_and_full
2327#if defined(AO_HAVE_int_and_full)
2328# if !defined(AO_HAVE_int_and_release)
2329# define AO_int_and_release(addr, val) AO_int_and_full(addr, val)
2330# define AO_HAVE_int_and_release
2332# if !defined(AO_HAVE_int_and_acquire)
2333# define AO_int_and_acquire(addr, val) AO_int_and_full(addr, val)
2334# define AO_HAVE_int_and_acquire
2336# if !defined(AO_HAVE_int_and_write)
2337# define AO_int_and_write(addr, val) AO_int_and_full(addr, val)
2338# define AO_HAVE_int_and_write
2340# if !defined(AO_HAVE_int_and_read)
2341# define AO_int_and_read(addr, val) AO_int_and_full(addr, val)
2342# define AO_HAVE_int_and_read
2346#if !defined(AO_HAVE_int_and) && defined(AO_HAVE_int_and_release)
2347# define AO_int_and(addr, val) AO_int_and_release(addr, val)
2348# define AO_HAVE_int_and
2350#if !defined(AO_HAVE_int_and) && defined(AO_HAVE_int_and_acquire)
2351# define AO_int_and(addr, val) AO_int_and_acquire(addr, val)
2352# define AO_HAVE_int_and
2354#if !defined(AO_HAVE_int_and) && defined(AO_HAVE_int_and_write)
2355# define AO_int_and(addr, val) AO_int_and_write(addr, val)
2356# define AO_HAVE_int_and
2358#if !defined(AO_HAVE_int_and) && defined(AO_HAVE_int_and_read)
2359# define AO_int_and(addr, val) AO_int_and_read(addr, val)
2360# define AO_HAVE_int_and
2363#if defined(AO_HAVE_int_and_acquire) && defined(AO_HAVE_nop_full) \
2364 && !defined(AO_HAVE_int_and_full)
2365# define AO_int_and_full(addr, val) \
2366 (AO_nop_full(), AO_int_and_acquire(addr, val))
2367# define AO_HAVE_int_and_full
2370#if !defined(AO_HAVE_int_and_release_write) \
2371 && defined(AO_HAVE_int_and_write)
2372# define AO_int_and_release_write(addr, val) AO_int_and_write(addr, val)
2373# define AO_HAVE_int_and_release_write
2375#if !defined(AO_HAVE_int_and_release_write) \
2376 && defined(AO_HAVE_int_and_release)
2377# define AO_int_and_release_write(addr, val) AO_int_and_release(addr, val)
2378# define AO_HAVE_int_and_release_write
2380#if !defined(AO_HAVE_int_and_acquire_read) \
2381 && defined(AO_HAVE_int_and_read)
2382# define AO_int_and_acquire_read(addr, val) AO_int_and_read(addr, val)
2383# define AO_HAVE_int_and_acquire_read
2385#if !defined(AO_HAVE_int_and_acquire_read) \
2386 && defined(AO_HAVE_int_and_acquire)
2387# define AO_int_and_acquire_read(addr, val) AO_int_and_acquire(addr, val)
2388# define AO_HAVE_int_and_acquire_read
2392#if defined(AO_HAVE_int_compare_and_swap_full) \
2393 && !defined(AO_HAVE_int_or_full)
2402 old = *(
unsigned *)addr;
2407# define AO_HAVE_int_or_full
2410#if defined(AO_HAVE_int_or_full)
2411# if !defined(AO_HAVE_int_or_release)
2412# define AO_int_or_release(addr, val) AO_int_or_full(addr, val)
2413# define AO_HAVE_int_or_release
2415# if !defined(AO_HAVE_int_or_acquire)
2416# define AO_int_or_acquire(addr, val) AO_int_or_full(addr, val)
2417# define AO_HAVE_int_or_acquire
2419# if !defined(AO_HAVE_int_or_write)
2420# define AO_int_or_write(addr, val) AO_int_or_full(addr, val)
2421# define AO_HAVE_int_or_write
2423# if !defined(AO_HAVE_int_or_read)
2424# define AO_int_or_read(addr, val) AO_int_or_full(addr, val)
2425# define AO_HAVE_int_or_read
2429#if !defined(AO_HAVE_int_or) && defined(AO_HAVE_int_or_release)
2430# define AO_int_or(addr, val) AO_int_or_release(addr, val)
2431# define AO_HAVE_int_or
2433#if !defined(AO_HAVE_int_or) && defined(AO_HAVE_int_or_acquire)
2434# define AO_int_or(addr, val) AO_int_or_acquire(addr, val)
2435# define AO_HAVE_int_or
2437#if !defined(AO_HAVE_int_or) && defined(AO_HAVE_int_or_write)
2438# define AO_int_or(addr, val) AO_int_or_write(addr, val)
2439# define AO_HAVE_int_or
2441#if !defined(AO_HAVE_int_or) && defined(AO_HAVE_int_or_read)
2442# define AO_int_or(addr, val) AO_int_or_read(addr, val)
2443# define AO_HAVE_int_or
2446#if defined(AO_HAVE_int_or_acquire) && defined(AO_HAVE_nop_full) \
2447 && !defined(AO_HAVE_int_or_full)
2448# define AO_int_or_full(addr, val) \
2449 (AO_nop_full(), AO_int_or_acquire(addr, val))
2450# define AO_HAVE_int_or_full
2453#if !defined(AO_HAVE_int_or_release_write) \
2454 && defined(AO_HAVE_int_or_write)
2455# define AO_int_or_release_write(addr, val) AO_int_or_write(addr, val)
2456# define AO_HAVE_int_or_release_write
2458#if !defined(AO_HAVE_int_or_release_write) \
2459 && defined(AO_HAVE_int_or_release)
2460# define AO_int_or_release_write(addr, val) AO_int_or_release(addr, val)
2461# define AO_HAVE_int_or_release_write
2463#if !defined(AO_HAVE_int_or_acquire_read) && defined(AO_HAVE_int_or_read)
2464# define AO_int_or_acquire_read(addr, val) AO_int_or_read(addr, val)
2465# define AO_HAVE_int_or_acquire_read
2467#if !defined(AO_HAVE_int_or_acquire_read) \
2468 && defined(AO_HAVE_int_or_acquire)
2469# define AO_int_or_acquire_read(addr, val) AO_int_or_acquire(addr, val)
2470# define AO_HAVE_int_or_acquire_read
2474#if defined(AO_HAVE_int_compare_and_swap_full) \
2475 && !defined(AO_HAVE_int_xor_full)
2484 old = *(
unsigned *)addr;
2489# define AO_HAVE_int_xor_full
2492#if defined(AO_HAVE_int_xor_full)
2493# if !defined(AO_HAVE_int_xor_release)
2494# define AO_int_xor_release(addr, val) AO_int_xor_full(addr, val)
2495# define AO_HAVE_int_xor_release
2497# if !defined(AO_HAVE_int_xor_acquire)
2498# define AO_int_xor_acquire(addr, val) AO_int_xor_full(addr, val)
2499# define AO_HAVE_int_xor_acquire
2501# if !defined(AO_HAVE_int_xor_write)
2502# define AO_int_xor_write(addr, val) AO_int_xor_full(addr, val)
2503# define AO_HAVE_int_xor_write
2505# if !defined(AO_HAVE_int_xor_read)
2506# define AO_int_xor_read(addr, val) AO_int_xor_full(addr, val)
2507# define AO_HAVE_int_xor_read
2511#if !defined(AO_HAVE_int_xor) && defined(AO_HAVE_int_xor_release)
2512# define AO_int_xor(addr, val) AO_int_xor_release(addr, val)
2513# define AO_HAVE_int_xor
2515#if !defined(AO_HAVE_int_xor) && defined(AO_HAVE_int_xor_acquire)
2516# define AO_int_xor(addr, val) AO_int_xor_acquire(addr, val)
2517# define AO_HAVE_int_xor
2519#if !defined(AO_HAVE_int_xor) && defined(AO_HAVE_int_xor_write)
2520# define AO_int_xor(addr, val) AO_int_xor_write(addr, val)
2521# define AO_HAVE_int_xor
2523#if !defined(AO_HAVE_int_xor) && defined(AO_HAVE_int_xor_read)
2524# define AO_int_xor(addr, val) AO_int_xor_read(addr, val)
2525# define AO_HAVE_int_xor
2528#if defined(AO_HAVE_int_xor_acquire) && defined(AO_HAVE_nop_full) \
2529 && !defined(AO_HAVE_int_xor_full)
2530# define AO_int_xor_full(addr, val) \
2531 (AO_nop_full(), AO_int_xor_acquire(addr, val))
2532# define AO_HAVE_int_xor_full
2535#if !defined(AO_HAVE_int_xor_release_write) \
2536 && defined(AO_HAVE_int_xor_write)
2537# define AO_int_xor_release_write(addr, val) AO_int_xor_write(addr, val)
2538# define AO_HAVE_int_xor_release_write
2540#if !defined(AO_HAVE_int_xor_release_write) \
2541 && defined(AO_HAVE_int_xor_release)
2542# define AO_int_xor_release_write(addr, val) AO_int_xor_release(addr, val)
2543# define AO_HAVE_int_xor_release_write
2545#if !defined(AO_HAVE_int_xor_acquire_read) \
2546 && defined(AO_HAVE_int_xor_read)
2547# define AO_int_xor_acquire_read(addr, val) AO_int_xor_read(addr, val)
2548# define AO_HAVE_int_xor_acquire_read
2550#if !defined(AO_HAVE_int_xor_acquire_read) \
2551 && defined(AO_HAVE_int_xor_acquire)
2552# define AO_int_xor_acquire_read(addr, val) AO_int_xor_acquire(addr, val)
2553# define AO_HAVE_int_xor_acquire_read
2580#if defined(AO_HAVE_fetch_compare_and_swap_full) \
2581 && !defined(AO_HAVE_compare_and_swap_full)
2589# define AO_HAVE_compare_and_swap_full
2592#if defined(AO_HAVE_fetch_compare_and_swap_acquire) \
2593 && !defined(AO_HAVE_compare_and_swap_acquire)
2601# define AO_HAVE_compare_and_swap_acquire
2604#if defined(AO_HAVE_fetch_compare_and_swap_release) \
2605 && !defined(AO_HAVE_compare_and_swap_release)
2613# define AO_HAVE_compare_and_swap_release
2616#if defined(AO_HAVE_fetch_compare_and_swap_write) \
2617 && !defined(AO_HAVE_compare_and_swap_write)
2619 AO_compare_and_swap_write(
volatile AO_t *addr,
AO_t old_val,
2622 return AO_fetch_compare_and_swap_write(addr, old_val, new_val)
2625# define AO_HAVE_compare_and_swap_write
2628#if defined(AO_HAVE_fetch_compare_and_swap_read) \
2629 && !defined(AO_HAVE_compare_and_swap_read)
2631 AO_compare_and_swap_read(
volatile AO_t *addr,
AO_t old_val,
2634 return AO_fetch_compare_and_swap_read(addr, old_val, new_val)
2637# define AO_HAVE_compare_and_swap_read
2640#if defined(AO_HAVE_fetch_compare_and_swap) \
2641 && !defined(AO_HAVE_compare_and_swap)
2648# define AO_HAVE_compare_and_swap
2651#if defined(AO_HAVE_fetch_compare_and_swap_release_write) \
2652 && !defined(AO_HAVE_compare_and_swap_release_write)
2654 AO_compare_and_swap_release_write(
volatile AO_t *addr,
2657 return AO_fetch_compare_and_swap_release_write(addr, old_val,
2658 new_val) == old_val;
2660# define AO_HAVE_compare_and_swap_release_write
2663#if defined(AO_HAVE_fetch_compare_and_swap_acquire_read) \
2664 && !defined(AO_HAVE_compare_and_swap_acquire_read)
2666 AO_compare_and_swap_acquire_read(
volatile AO_t *addr,
2669 return AO_fetch_compare_and_swap_acquire_read(addr, old_val,
2670 new_val) == old_val;
2672# define AO_HAVE_compare_and_swap_acquire_read
2675#if defined(AO_HAVE_fetch_compare_and_swap_dd_acquire_read) \
2676 && !defined(AO_HAVE_compare_and_swap_dd_acquire_read)
2678 AO_compare_and_swap_dd_acquire_read(
volatile AO_t *addr,
2681 return AO_fetch_compare_and_swap_dd_acquire_read(addr, old_val,
2682 new_val) == old_val;
2684# define AO_HAVE_compare_and_swap_dd_acquire_read
2690#if defined(AO_HAVE_compare_and_swap_full) \
2691 && !defined(AO_HAVE_fetch_and_add_full)
2700 old = *(
AO_t *)addr;
2706# define AO_HAVE_fetch_and_add_full
2709#if defined(AO_HAVE_compare_and_swap_acquire) \
2710 && !defined(AO_HAVE_fetch_and_add_acquire)
2719 old = *(
AO_t *)addr;
2725# define AO_HAVE_fetch_and_add_acquire
2728#if defined(AO_HAVE_compare_and_swap_release) \
2729 && !defined(AO_HAVE_fetch_and_add_release)
2738 old = *(
AO_t *)addr;
2744# define AO_HAVE_fetch_and_add_release
2747#if defined(AO_HAVE_compare_and_swap) \
2748 && !defined(AO_HAVE_fetch_and_add)
2757 old = *(
AO_t *)addr;
2763# define AO_HAVE_fetch_and_add
2766#if defined(AO_HAVE_fetch_and_add_full)
2767# if !defined(AO_HAVE_fetch_and_add_release)
2768# define AO_fetch_and_add_release(addr, val) \
2769 AO_fetch_and_add_full(addr, val)
2770# define AO_HAVE_fetch_and_add_release
2772# if !defined(AO_HAVE_fetch_and_add_acquire)
2773# define AO_fetch_and_add_acquire(addr, val) \
2774 AO_fetch_and_add_full(addr, val)
2775# define AO_HAVE_fetch_and_add_acquire
2777# if !defined(AO_HAVE_fetch_and_add_write)
2778# define AO_fetch_and_add_write(addr, val) \
2779 AO_fetch_and_add_full(addr, val)
2780# define AO_HAVE_fetch_and_add_write
2782# if !defined(AO_HAVE_fetch_and_add_read)
2783# define AO_fetch_and_add_read(addr, val) \
2784 AO_fetch_and_add_full(addr, val)
2785# define AO_HAVE_fetch_and_add_read
2789#if defined(AO_HAVE_fetch_and_add) && defined(AO_HAVE_nop_full) \
2790 && !defined(AO_HAVE_fetch_and_add_acquire)
2798# define AO_HAVE_fetch_and_add_acquire
2800#if defined(AO_HAVE_fetch_and_add) && defined(AO_HAVE_nop_full) \
2801 && !defined(AO_HAVE_fetch_and_add_release)
2802# define AO_fetch_and_add_release(addr, incr) \
2803 (AO_nop_full(), AO_fetch_and_add(addr, incr))
2804# define AO_HAVE_fetch_and_add_release
2807#if !defined(AO_HAVE_fetch_and_add) \
2808 && defined(AO_HAVE_fetch_and_add_release)
2809# define AO_fetch_and_add(addr, val) \
2810 AO_fetch_and_add_release(addr, val)
2811# define AO_HAVE_fetch_and_add
2813#if !defined(AO_HAVE_fetch_and_add) \
2814 && defined(AO_HAVE_fetch_and_add_acquire)
2815# define AO_fetch_and_add(addr, val) \
2816 AO_fetch_and_add_acquire(addr, val)
2817# define AO_HAVE_fetch_and_add
2819#if !defined(AO_HAVE_fetch_and_add) \
2820 && defined(AO_HAVE_fetch_and_add_write)
2821# define AO_fetch_and_add(addr, val) \
2822 AO_fetch_and_add_write(addr, val)
2823# define AO_HAVE_fetch_and_add
2825#if !defined(AO_HAVE_fetch_and_add) \
2826 && defined(AO_HAVE_fetch_and_add_read)
2827# define AO_fetch_and_add(addr, val) \
2828 AO_fetch_and_add_read(addr, val)
2829# define AO_HAVE_fetch_and_add
2832#if defined(AO_HAVE_fetch_and_add_acquire) \
2833 && defined(AO_HAVE_nop_full) && !defined(AO_HAVE_fetch_and_add_full)
2834# define AO_fetch_and_add_full(addr, val) \
2835 (AO_nop_full(), AO_fetch_and_add_acquire(addr, val))
2836# define AO_HAVE_fetch_and_add_full
2839#if !defined(AO_HAVE_fetch_and_add_release_write) \
2840 && defined(AO_HAVE_fetch_and_add_write)
2841# define AO_fetch_and_add_release_write(addr, val) \
2842 AO_fetch_and_add_write(addr, val)
2843# define AO_HAVE_fetch_and_add_release_write
2845#if !defined(AO_HAVE_fetch_and_add_release_write) \
2846 && defined(AO_HAVE_fetch_and_add_release)
2847# define AO_fetch_and_add_release_write(addr, val) \
2848 AO_fetch_and_add_release(addr, val)
2849# define AO_HAVE_fetch_and_add_release_write
2852#if !defined(AO_HAVE_fetch_and_add_acquire_read) \
2853 && defined(AO_HAVE_fetch_and_add_read)
2854# define AO_fetch_and_add_acquire_read(addr, val) \
2855 AO_fetch_and_add_read(addr, val)
2856# define AO_HAVE_fetch_and_add_acquire_read
2858#if !defined(AO_HAVE_fetch_and_add_acquire_read) \
2859 && defined(AO_HAVE_fetch_and_add_acquire)
2860# define AO_fetch_and_add_acquire_read(addr, val) \
2861 AO_fetch_and_add_acquire(addr, val)
2862# define AO_HAVE_fetch_and_add_acquire_read
2865#ifdef AO_NO_DD_ORDERING
2866# if defined(AO_HAVE_fetch_and_add_acquire_read)
2867# define AO_fetch_and_add_dd_acquire_read(addr, val) \
2868 AO_fetch_and_add_acquire_read(addr, val)
2869# define AO_HAVE_fetch_and_add_dd_acquire_read
2872# if defined(AO_HAVE_fetch_and_add)
2873# define AO_fetch_and_add_dd_acquire_read(addr, val) \
2874 AO_fetch_and_add(addr, val)
2875# define AO_HAVE_fetch_and_add_dd_acquire_read
2880#if defined(AO_HAVE_fetch_and_add_full) \
2881 && !defined(AO_HAVE_fetch_and_add1_full)
2882# define AO_fetch_and_add1_full(addr) \
2883 AO_fetch_and_add_full(addr, 1)
2884# define AO_HAVE_fetch_and_add1_full
2886#if defined(AO_HAVE_fetch_and_add_release) \
2887 && !defined(AO_HAVE_fetch_and_add1_release)
2888# define AO_fetch_and_add1_release(addr) \
2889 AO_fetch_and_add_release(addr, 1)
2890# define AO_HAVE_fetch_and_add1_release
2892#if defined(AO_HAVE_fetch_and_add_acquire) \
2893 && !defined(AO_HAVE_fetch_and_add1_acquire)
2894# define AO_fetch_and_add1_acquire(addr) \
2895 AO_fetch_and_add_acquire(addr, 1)
2896# define AO_HAVE_fetch_and_add1_acquire
2898#if defined(AO_HAVE_fetch_and_add_write) \
2899 && !defined(AO_HAVE_fetch_and_add1_write)
2900# define AO_fetch_and_add1_write(addr) \
2901 AO_fetch_and_add_write(addr, 1)
2902# define AO_HAVE_fetch_and_add1_write
2904#if defined(AO_HAVE_fetch_and_add_read) \
2905 && !defined(AO_HAVE_fetch_and_add1_read)
2906# define AO_fetch_and_add1_read(addr) \
2907 AO_fetch_and_add_read(addr, 1)
2908# define AO_HAVE_fetch_and_add1_read
2910#if defined(AO_HAVE_fetch_and_add_release_write) \
2911 && !defined(AO_HAVE_fetch_and_add1_release_write)
2912# define AO_fetch_and_add1_release_write(addr) \
2913 AO_fetch_and_add_release_write(addr, 1)
2914# define AO_HAVE_fetch_and_add1_release_write
2916#if defined(AO_HAVE_fetch_and_add_acquire_read) \
2917 && !defined(AO_HAVE_fetch_and_add1_acquire_read)
2918# define AO_fetch_and_add1_acquire_read(addr) \
2919 AO_fetch_and_add_acquire_read(addr, 1)
2920# define AO_HAVE_fetch_and_add1_acquire_read
2922#if defined(AO_HAVE_fetch_and_add) \
2923 && !defined(AO_HAVE_fetch_and_add1)
2924# define AO_fetch_and_add1(addr) AO_fetch_and_add(addr, 1)
2925# define AO_HAVE_fetch_and_add1
2928#if defined(AO_HAVE_fetch_and_add1_full)
2929# if !defined(AO_HAVE_fetch_and_add1_release)
2930# define AO_fetch_and_add1_release(addr) \
2931 AO_fetch_and_add1_full(addr)
2932# define AO_HAVE_fetch_and_add1_release
2934# if !defined(AO_HAVE_fetch_and_add1_acquire)
2935# define AO_fetch_and_add1_acquire(addr) \
2936 AO_fetch_and_add1_full(addr)
2937# define AO_HAVE_fetch_and_add1_acquire
2939# if !defined(AO_HAVE_fetch_and_add1_write)
2940# define AO_fetch_and_add1_write(addr) \
2941 AO_fetch_and_add1_full(addr)
2942# define AO_HAVE_fetch_and_add1_write
2944# if !defined(AO_HAVE_fetch_and_add1_read)
2945# define AO_fetch_and_add1_read(addr) \
2946 AO_fetch_and_add1_full(addr)
2947# define AO_HAVE_fetch_and_add1_read
2951#if !defined(AO_HAVE_fetch_and_add1) \
2952 && defined(AO_HAVE_fetch_and_add1_release)
2953# define AO_fetch_and_add1(addr) AO_fetch_and_add1_release(addr)
2954# define AO_HAVE_fetch_and_add1
2956#if !defined(AO_HAVE_fetch_and_add1) \
2957 && defined(AO_HAVE_fetch_and_add1_acquire)
2958# define AO_fetch_and_add1(addr) AO_fetch_and_add1_acquire(addr)
2959# define AO_HAVE_fetch_and_add1
2961#if !defined(AO_HAVE_fetch_and_add1) \
2962 && defined(AO_HAVE_fetch_and_add1_write)
2963# define AO_fetch_and_add1(addr) AO_fetch_and_add1_write(addr)
2964# define AO_HAVE_fetch_and_add1
2966#if !defined(AO_HAVE_fetch_and_add1) \
2967 && defined(AO_HAVE_fetch_and_add1_read)
2968# define AO_fetch_and_add1(addr) AO_fetch_and_add1_read(addr)
2969# define AO_HAVE_fetch_and_add1
2972#if defined(AO_HAVE_fetch_and_add1_acquire) \
2973 && defined(AO_HAVE_nop_full) \
2974 && !defined(AO_HAVE_fetch_and_add1_full)
2975# define AO_fetch_and_add1_full(addr) \
2976 (AO_nop_full(), AO_fetch_and_add1_acquire(addr))
2977# define AO_HAVE_fetch_and_add1_full
2980#if !defined(AO_HAVE_fetch_and_add1_release_write) \
2981 && defined(AO_HAVE_fetch_and_add1_write)
2982# define AO_fetch_and_add1_release_write(addr) \
2983 AO_fetch_and_add1_write(addr)
2984# define AO_HAVE_fetch_and_add1_release_write
2986#if !defined(AO_HAVE_fetch_and_add1_release_write) \
2987 && defined(AO_HAVE_fetch_and_add1_release)
2988# define AO_fetch_and_add1_release_write(addr) \
2989 AO_fetch_and_add1_release(addr)
2990# define AO_HAVE_fetch_and_add1_release_write
2992#if !defined(AO_HAVE_fetch_and_add1_acquire_read) \
2993 && defined(AO_HAVE_fetch_and_add1_read)
2994# define AO_fetch_and_add1_acquire_read(addr) \
2995 AO_fetch_and_add1_read(addr)
2996# define AO_HAVE_fetch_and_add1_acquire_read
2998#if !defined(AO_HAVE_fetch_and_add1_acquire_read) \
2999 && defined(AO_HAVE_fetch_and_add1_acquire)
3000# define AO_fetch_and_add1_acquire_read(addr) \
3001 AO_fetch_and_add1_acquire(addr)
3002# define AO_HAVE_fetch_and_add1_acquire_read
3005#ifdef AO_NO_DD_ORDERING
3006# if defined(AO_HAVE_fetch_and_add1_acquire_read)
3007# define AO_fetch_and_add1_dd_acquire_read(addr) \
3008 AO_fetch_and_add1_acquire_read(addr)
3009# define AO_HAVE_fetch_and_add1_dd_acquire_read
3012# if defined(AO_HAVE_fetch_and_add1)
3013# define AO_fetch_and_add1_dd_acquire_read(addr) \
3014 AO_fetch_and_add1(addr)
3015# define AO_HAVE_fetch_and_add1_dd_acquire_read
3020#if defined(AO_HAVE_fetch_and_add_full) \
3021 && !defined(AO_HAVE_fetch_and_sub1_full)
3022# define AO_fetch_and_sub1_full(addr) \
3023 AO_fetch_and_add_full(addr, (AO_t)(-1))
3024# define AO_HAVE_fetch_and_sub1_full
3026#if defined(AO_HAVE_fetch_and_add_release) \
3027 && !defined(AO_HAVE_fetch_and_sub1_release)
3028# define AO_fetch_and_sub1_release(addr) \
3029 AO_fetch_and_add_release(addr, (AO_t)(-1))
3030# define AO_HAVE_fetch_and_sub1_release
3032#if defined(AO_HAVE_fetch_and_add_acquire) \
3033 && !defined(AO_HAVE_fetch_and_sub1_acquire)
3034# define AO_fetch_and_sub1_acquire(addr) \
3035 AO_fetch_and_add_acquire(addr, (AO_t)(-1))
3036# define AO_HAVE_fetch_and_sub1_acquire
3038#if defined(AO_HAVE_fetch_and_add_write) \
3039 && !defined(AO_HAVE_fetch_and_sub1_write)
3040# define AO_fetch_and_sub1_write(addr) \
3041 AO_fetch_and_add_write(addr, (AO_t)(-1))
3042# define AO_HAVE_fetch_and_sub1_write
3044#if defined(AO_HAVE_fetch_and_add_read) \
3045 && !defined(AO_HAVE_fetch_and_sub1_read)
3046# define AO_fetch_and_sub1_read(addr) \
3047 AO_fetch_and_add_read(addr, (AO_t)(-1))
3048# define AO_HAVE_fetch_and_sub1_read
3050#if defined(AO_HAVE_fetch_and_add_release_write) \
3051 && !defined(AO_HAVE_fetch_and_sub1_release_write)
3052# define AO_fetch_and_sub1_release_write(addr) \
3053 AO_fetch_and_add_release_write(addr, (AO_t)(-1))
3054# define AO_HAVE_fetch_and_sub1_release_write
3056#if defined(AO_HAVE_fetch_and_add_acquire_read) \
3057 && !defined(AO_HAVE_fetch_and_sub1_acquire_read)
3058# define AO_fetch_and_sub1_acquire_read(addr) \
3059 AO_fetch_and_add_acquire_read(addr, (AO_t)(-1))
3060# define AO_HAVE_fetch_and_sub1_acquire_read
3062#if defined(AO_HAVE_fetch_and_add) \
3063 && !defined(AO_HAVE_fetch_and_sub1)
3064# define AO_fetch_and_sub1(addr) \
3065 AO_fetch_and_add(addr, (AO_t)(-1))
3066# define AO_HAVE_fetch_and_sub1
3069#if defined(AO_HAVE_fetch_and_sub1_full)
3070# if !defined(AO_HAVE_fetch_and_sub1_release)
3071# define AO_fetch_and_sub1_release(addr) \
3072 AO_fetch_and_sub1_full(addr)
3073# define AO_HAVE_fetch_and_sub1_release
3075# if !defined(AO_HAVE_fetch_and_sub1_acquire)
3076# define AO_fetch_and_sub1_acquire(addr) \
3077 AO_fetch_and_sub1_full(addr)
3078# define AO_HAVE_fetch_and_sub1_acquire
3080# if !defined(AO_HAVE_fetch_and_sub1_write)
3081# define AO_fetch_and_sub1_write(addr) \
3082 AO_fetch_and_sub1_full(addr)
3083# define AO_HAVE_fetch_and_sub1_write
3085# if !defined(AO_HAVE_fetch_and_sub1_read)
3086# define AO_fetch_and_sub1_read(addr) \
3087 AO_fetch_and_sub1_full(addr)
3088# define AO_HAVE_fetch_and_sub1_read
3092#if !defined(AO_HAVE_fetch_and_sub1) \
3093 && defined(AO_HAVE_fetch_and_sub1_release)
3094# define AO_fetch_and_sub1(addr) AO_fetch_and_sub1_release(addr)
3095# define AO_HAVE_fetch_and_sub1
3097#if !defined(AO_HAVE_fetch_and_sub1) \
3098 && defined(AO_HAVE_fetch_and_sub1_acquire)
3099# define AO_fetch_and_sub1(addr) AO_fetch_and_sub1_acquire(addr)
3100# define AO_HAVE_fetch_and_sub1
3102#if !defined(AO_HAVE_fetch_and_sub1) \
3103 && defined(AO_HAVE_fetch_and_sub1_write)
3104# define AO_fetch_and_sub1(addr) AO_fetch_and_sub1_write(addr)
3105# define AO_HAVE_fetch_and_sub1
3107#if !defined(AO_HAVE_fetch_and_sub1) \
3108 && defined(AO_HAVE_fetch_and_sub1_read)
3109# define AO_fetch_and_sub1(addr) AO_fetch_and_sub1_read(addr)
3110# define AO_HAVE_fetch_and_sub1
3113#if defined(AO_HAVE_fetch_and_sub1_acquire) \
3114 && defined(AO_HAVE_nop_full) \
3115 && !defined(AO_HAVE_fetch_and_sub1_full)
3116# define AO_fetch_and_sub1_full(addr) \
3117 (AO_nop_full(), AO_fetch_and_sub1_acquire(addr))
3118# define AO_HAVE_fetch_and_sub1_full
3121#if !defined(AO_HAVE_fetch_and_sub1_release_write) \
3122 && defined(AO_HAVE_fetch_and_sub1_write)
3123# define AO_fetch_and_sub1_release_write(addr) \
3124 AO_fetch_and_sub1_write(addr)
3125# define AO_HAVE_fetch_and_sub1_release_write
3127#if !defined(AO_HAVE_fetch_and_sub1_release_write) \
3128 && defined(AO_HAVE_fetch_and_sub1_release)
3129# define AO_fetch_and_sub1_release_write(addr) \
3130 AO_fetch_and_sub1_release(addr)
3131# define AO_HAVE_fetch_and_sub1_release_write
3133#if !defined(AO_HAVE_fetch_and_sub1_acquire_read) \
3134 && defined(AO_HAVE_fetch_and_sub1_read)
3135# define AO_fetch_and_sub1_acquire_read(addr) \
3136 AO_fetch_and_sub1_read(addr)
3137# define AO_HAVE_fetch_and_sub1_acquire_read
3139#if !defined(AO_HAVE_fetch_and_sub1_acquire_read) \
3140 && defined(AO_HAVE_fetch_and_sub1_acquire)
3141# define AO_fetch_and_sub1_acquire_read(addr) \
3142 AO_fetch_and_sub1_acquire(addr)
3143# define AO_HAVE_fetch_and_sub1_acquire_read
3146#ifdef AO_NO_DD_ORDERING
3147# if defined(AO_HAVE_fetch_and_sub1_acquire_read)
3148# define AO_fetch_and_sub1_dd_acquire_read(addr) \
3149 AO_fetch_and_sub1_acquire_read(addr)
3150# define AO_HAVE_fetch_and_sub1_dd_acquire_read
3153# if defined(AO_HAVE_fetch_and_sub1)
3154# define AO_fetch_and_sub1_dd_acquire_read(addr) \
3155 AO_fetch_and_sub1(addr)
3156# define AO_HAVE_fetch_and_sub1_dd_acquire_read
3161#if defined(AO_HAVE_compare_and_swap_full) \
3162 && !defined(AO_HAVE_and_full)
3171 old = *(
AO_t *)addr;
3176# define AO_HAVE_and_full
3179#if defined(AO_HAVE_and_full)
3180# if !defined(AO_HAVE_and_release)
3181# define AO_and_release(addr, val) AO_and_full(addr, val)
3182# define AO_HAVE_and_release
3184# if !defined(AO_HAVE_and_acquire)
3185# define AO_and_acquire(addr, val) AO_and_full(addr, val)
3186# define AO_HAVE_and_acquire
3188# if !defined(AO_HAVE_and_write)
3189# define AO_and_write(addr, val) AO_and_full(addr, val)
3190# define AO_HAVE_and_write
3192# if !defined(AO_HAVE_and_read)
3193# define AO_and_read(addr, val) AO_and_full(addr, val)
3194# define AO_HAVE_and_read
3198#if !defined(AO_HAVE_and) && defined(AO_HAVE_and_release)
3199# define AO_and(addr, val) AO_and_release(addr, val)
3202#if !defined(AO_HAVE_and) && defined(AO_HAVE_and_acquire)
3203# define AO_and(addr, val) AO_and_acquire(addr, val)
3206#if !defined(AO_HAVE_and) && defined(AO_HAVE_and_write)
3207# define AO_and(addr, val) AO_and_write(addr, val)
3210#if !defined(AO_HAVE_and) && defined(AO_HAVE_and_read)
3211# define AO_and(addr, val) AO_and_read(addr, val)
3215#if defined(AO_HAVE_and_acquire) && defined(AO_HAVE_nop_full) \
3216 && !defined(AO_HAVE_and_full)
3217# define AO_and_full(addr, val) \
3218 (AO_nop_full(), AO_and_acquire(addr, val))
3219# define AO_HAVE_and_full
3222#if !defined(AO_HAVE_and_release_write) \
3223 && defined(AO_HAVE_and_write)
3224# define AO_and_release_write(addr, val) AO_and_write(addr, val)
3225# define AO_HAVE_and_release_write
3227#if !defined(AO_HAVE_and_release_write) \
3228 && defined(AO_HAVE_and_release)
3229# define AO_and_release_write(addr, val) AO_and_release(addr, val)
3230# define AO_HAVE_and_release_write
3232#if !defined(AO_HAVE_and_acquire_read) \
3233 && defined(AO_HAVE_and_read)
3234# define AO_and_acquire_read(addr, val) AO_and_read(addr, val)
3235# define AO_HAVE_and_acquire_read
3237#if !defined(AO_HAVE_and_acquire_read) \
3238 && defined(AO_HAVE_and_acquire)
3239# define AO_and_acquire_read(addr, val) AO_and_acquire(addr, val)
3240# define AO_HAVE_and_acquire_read
3244#if defined(AO_HAVE_compare_and_swap_full) \
3245 && !defined(AO_HAVE_or_full)
3254 old = *(
AO_t *)addr;
3259# define AO_HAVE_or_full
3262#if defined(AO_HAVE_or_full)
3263# if !defined(AO_HAVE_or_release)
3264# define AO_or_release(addr, val) AO_or_full(addr, val)
3265# define AO_HAVE_or_release
3267# if !defined(AO_HAVE_or_acquire)
3268# define AO_or_acquire(addr, val) AO_or_full(addr, val)
3269# define AO_HAVE_or_acquire
3271# if !defined(AO_HAVE_or_write)
3272# define AO_or_write(addr, val) AO_or_full(addr, val)
3273# define AO_HAVE_or_write
3275# if !defined(AO_HAVE_or_read)
3276# define AO_or_read(addr, val) AO_or_full(addr, val)
3277# define AO_HAVE_or_read
3281#if !defined(AO_HAVE_or) && defined(AO_HAVE_or_release)
3282# define AO_or(addr, val) AO_or_release(addr, val)
3285#if !defined(AO_HAVE_or) && defined(AO_HAVE_or_acquire)
3286# define AO_or(addr, val) AO_or_acquire(addr, val)
3289#if !defined(AO_HAVE_or) && defined(AO_HAVE_or_write)
3290# define AO_or(addr, val) AO_or_write(addr, val)
3293#if !defined(AO_HAVE_or) && defined(AO_HAVE_or_read)
3294# define AO_or(addr, val) AO_or_read(addr, val)
3298#if defined(AO_HAVE_or_acquire) && defined(AO_HAVE_nop_full) \
3299 && !defined(AO_HAVE_or_full)
3300# define AO_or_full(addr, val) \
3301 (AO_nop_full(), AO_or_acquire(addr, val))
3302# define AO_HAVE_or_full
3305#if !defined(AO_HAVE_or_release_write) \
3306 && defined(AO_HAVE_or_write)
3307# define AO_or_release_write(addr, val) AO_or_write(addr, val)
3308# define AO_HAVE_or_release_write
3310#if !defined(AO_HAVE_or_release_write) \
3311 && defined(AO_HAVE_or_release)
3312# define AO_or_release_write(addr, val) AO_or_release(addr, val)
3313# define AO_HAVE_or_release_write
3315#if !defined(AO_HAVE_or_acquire_read) && defined(AO_HAVE_or_read)
3316# define AO_or_acquire_read(addr, val) AO_or_read(addr, val)
3317# define AO_HAVE_or_acquire_read
3319#if !defined(AO_HAVE_or_acquire_read) \
3320 && defined(AO_HAVE_or_acquire)
3321# define AO_or_acquire_read(addr, val) AO_or_acquire(addr, val)
3322# define AO_HAVE_or_acquire_read
3326#if defined(AO_HAVE_compare_and_swap_full) \
3327 && !defined(AO_HAVE_xor_full)
3336 old = *(
AO_t *)addr;
3341# define AO_HAVE_xor_full
3344#if defined(AO_HAVE_xor_full)
3345# if !defined(AO_HAVE_xor_release)
3346# define AO_xor_release(addr, val) AO_xor_full(addr, val)
3347# define AO_HAVE_xor_release
3349# if !defined(AO_HAVE_xor_acquire)
3350# define AO_xor_acquire(addr, val) AO_xor_full(addr, val)
3351# define AO_HAVE_xor_acquire
3353# if !defined(AO_HAVE_xor_write)
3354# define AO_xor_write(addr, val) AO_xor_full(addr, val)
3355# define AO_HAVE_xor_write
3357# if !defined(AO_HAVE_xor_read)
3358# define AO_xor_read(addr, val) AO_xor_full(addr, val)
3359# define AO_HAVE_xor_read
3363#if !defined(AO_HAVE_xor) && defined(AO_HAVE_xor_release)
3364# define AO_xor(addr, val) AO_xor_release(addr, val)
3367#if !defined(AO_HAVE_xor) && defined(AO_HAVE_xor_acquire)
3368# define AO_xor(addr, val) AO_xor_acquire(addr, val)
3371#if !defined(AO_HAVE_xor) && defined(AO_HAVE_xor_write)
3372# define AO_xor(addr, val) AO_xor_write(addr, val)
3375#if !defined(AO_HAVE_xor) && defined(AO_HAVE_xor_read)
3376# define AO_xor(addr, val) AO_xor_read(addr, val)
3380#if defined(AO_HAVE_xor_acquire) && defined(AO_HAVE_nop_full) \
3381 && !defined(AO_HAVE_xor_full)
3382# define AO_xor_full(addr, val) \
3383 (AO_nop_full(), AO_xor_acquire(addr, val))
3384# define AO_HAVE_xor_full
3387#if !defined(AO_HAVE_xor_release_write) \
3388 && defined(AO_HAVE_xor_write)
3389# define AO_xor_release_write(addr, val) AO_xor_write(addr, val)
3390# define AO_HAVE_xor_release_write
3392#if !defined(AO_HAVE_xor_release_write) \
3393 && defined(AO_HAVE_xor_release)
3394# define AO_xor_release_write(addr, val) AO_xor_release(addr, val)
3395# define AO_HAVE_xor_release_write
3397#if !defined(AO_HAVE_xor_acquire_read) \
3398 && defined(AO_HAVE_xor_read)
3399# define AO_xor_acquire_read(addr, val) AO_xor_read(addr, val)
3400# define AO_HAVE_xor_acquire_read
3402#if !defined(AO_HAVE_xor_acquire_read) \
3403 && defined(AO_HAVE_xor_acquire)
3404# define AO_xor_acquire_read(addr, val) AO_xor_acquire(addr, val)
3405# define AO_HAVE_xor_acquire_read
AO_INLINE int AO_compare_and_swap(volatile AO_t *addr, AO_t old, AO_t new_val)
AO_INLINE void AO_nop_full(void)
#define AO_ATTR_NO_SANITIZE_THREAD
#define AO_EXPECT_FALSE(expr)
AO_INLINE int AO_compare_and_swap_full(volatile AO_t *addr, AO_t old, AO_t new_val)
#define AO_fetch_compare_and_swap_full(addr, old, newval)
AO_INLINE unsigned short AO_short_fetch_and_add(volatile unsigned short *p, unsigned short incr)
AO_INLINE unsigned char AO_char_fetch_and_add(volatile unsigned char *p, unsigned char incr)
AO_INLINE AO_t AO_fetch_and_add(volatile AO_t *p, AO_t incr)
AO_INLINE AO_t AO_fetch_compare_and_swap(volatile AO_t *addr, AO_t old_val, AO_t new_val)
AO_INLINE unsigned short AO_short_fetch_compare_and_swap_acquire(volatile unsigned short *addr, unsigned short old, unsigned short new_val)
AO_INLINE unsigned char AO_char_fetch_compare_and_swap_acquire(volatile unsigned char *addr, unsigned char old, unsigned char new_val)
AO_INLINE unsigned int AO_int_fetch_compare_and_swap_acquire(volatile unsigned int *addr, unsigned int old, unsigned int new_val)
AO_INLINE unsigned int AO_int_fetch_compare_and_swap_release(volatile unsigned int *addr, unsigned int old, unsigned int new_val)
AO_INLINE AO_t AO_fetch_compare_and_swap_release(volatile AO_t *addr, AO_t old, AO_t new_val)
AO_INLINE unsigned short AO_short_fetch_compare_and_swap_release(volatile unsigned short *addr, unsigned short old, unsigned short new_val)
AO_INLINE unsigned char AO_char_fetch_compare_and_swap_release(volatile unsigned char *addr, unsigned char old, unsigned char new_val)
AO_INLINE AO_t AO_fetch_compare_and_swap_acquire(volatile AO_t *addr, AO_t old, AO_t new_val)
AO_INLINE int AO_compare_and_swap_acquire(volatile AO_t *addr, AO_t old, AO_t new_val)
AO_INLINE int AO_compare_and_swap_release(volatile AO_t *addr, AO_t old, AO_t 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_INLINE unsigned char AO_char_fetch_compare_and_swap_full(volatile unsigned char *addr, unsigned char old_val, unsigned char new_val)
AO_INLINE AO_t AO_fetch_and_add_release(volatile AO_t *addr, AO_t incr)
AO_INLINE unsigned AO_int_fetch_and_add_full(volatile unsigned *addr, unsigned incr)
AO_INLINE unsigned char AO_char_fetch_and_add_full(volatile unsignedchar *addr, unsignedchar incr)
AO_INLINE void AO_short_xor_full(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE unsigned char AO_char_fetch_and_add_release(volatile unsignedchar *addr, unsignedchar incr)
AO_INLINE AO_t AO_fetch_and_add_acquire(volatile AO_t *addr, AO_t incr)
AO_INLINE void AO_char_and_full(volatile unsignedchar *addr, unsignedchar value)
AO_INLINE unsigned short AO_short_fetch_and_add_full(volatile unsignedshort *addr, unsignedshort incr)
AO_INLINE unsigned short AO_short_fetch_and_add_release(volatile unsignedshort *addr, unsignedshort incr)
AO_INLINE void AO_char_or_full(volatile unsignedchar *addr, unsignedchar value)
AO_INLINE void AO_short_and_full(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE void AO_char_xor_full(volatile unsignedchar *addr, unsignedchar value)
AO_INLINE void AO_short_or_full(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE unsigned short AO_short_fetch_and_add_acquire(volatile unsignedshort *addr, unsignedshort incr)
AO_INLINE void AO_int_and_full(volatile unsigned *addr, unsigned value)
AO_INLINE AO_t AO_fetch_and_add_full(volatile AO_t *addr, AO_t incr)
AO_INLINE void AO_or_full(volatile AO_t *addr, AO_t value)
AO_INLINE void AO_and_full(volatile AO_t *addr, AO_t value)
AO_INLINE void AO_int_xor_full(volatile unsigned *addr, unsigned value)
AO_INLINE void AO_int_or_full(volatile unsigned *addr, unsigned value)
AO_INLINE unsigned AO_int_fetch_and_add(volatile unsigned *addr, unsigned incr)
AO_INLINE void AO_xor_full(volatile AO_t *addr, AO_t value)
AO_INLINE unsigned AO_int_fetch_and_add_acquire(volatile unsigned *addr, unsigned incr)
AO_INLINE unsigned char AO_char_fetch_and_add_acquire(volatile unsignedchar *addr, unsignedchar incr)
AO_INLINE unsigned AO_int_fetch_and_add_release(volatile unsigned *addr, unsigned incr)
AO_INLINE unsigned AO_int_fetch_compare_and_swap_full(volatile unsigned *addr, unsigned old_val, unsigned new_val)