2
#if defined(AO_HAVE_char_load_acquire) && !defined(AO_HAVE_char_load)
3
# define AO_char_load(addr) AO_char_load_acquire(addr)
4
# define AO_HAVE_char_load
7
#if defined(AO_HAVE_char_load_full) && !defined(AO_HAVE_char_load_acquire)
8
# define AO_char_load_acquire(addr) AO_char_load_full(addr)
9
# define AO_HAVE_char_load_acquire
12
#if defined(AO_HAVE_char_load_full) && !defined(AO_HAVE_char_load_read)
13
# define AO_char_load_read(addr) AO_char_load_full(addr)
14
# define AO_HAVE_char_load_read
17
#if !defined(AO_HAVE_char_load_acquire_read) && defined(AO_HAVE_char_load_acquire)
18
# define AO_char_load_acquire_read(addr) AO_char_load_acquire(addr)
19
# define AO_HAVE_char_load_acquire_read
22
#if defined(AO_HAVE_char_load) && defined(AO_HAVE_nop_full) && \
23
!defined(AO_HAVE_char_load_acquire)
24
AO_INLINE unsigned char
25
AO_char_load_acquire(volatile unsigned char *addr)
27
unsigned char result = AO_char_load(addr);
28
/* Acquire barrier would be useless, since the load could be delayed */
33
# define AO_HAVE_char_load_acquire
36
#if defined(AO_HAVE_char_load) && defined(AO_HAVE_nop_read) && \
37
!defined(AO_HAVE_char_load_read)
38
AO_INLINE unsigned char
39
AO_char_load_read(volatile unsigned char *addr)
41
unsigned char result = AO_char_load(addr);
42
/* Acquire barrier would be useless, since the load could be delayed */
47
# define AO_HAVE_char_load_read
50
#if defined(AO_HAVE_char_load_acquire) && defined(AO_HAVE_nop_full) && \
51
!defined(AO_HAVE_char_load_full)
52
# define AO_char_load_full(addr) (AO_nop_full(), AO_char_load_acquire(addr))
53
# define AO_HAVE_char_load_full
56
#if !defined(AO_HAVE_char_load_acquire_read) && defined(AO_HAVE_char_load_read)
57
# define AO_char_load_acquire_read(addr) AO_char_load_read(addr)
58
# define AO_HAVE_char_load_acquire_read
61
#if defined(AO_HAVE_char_load_acquire_read) && !defined(AO_HAVE_char_load)
62
# define AO_char_load(addr) AO_char_load_acquire_read(addr)
63
# define AO_HAVE_char_load
66
#ifdef AO_NO_DD_ORDERING
67
# if defined(AO_HAVE_char_load_acquire_read)
68
# define AO_char_load_dd_acquire_read(addr) \
69
AO_char_load_acquire_read(addr)
70
# define AO_HAVE_char_load_dd_acquire_read
73
# if defined(AO_HAVE_char_load)
74
# define AO_char_load_dd_acquire_read(addr) \
76
# define AO_HAVE_char_load_dd_acquire_read
83
#if defined(AO_HAVE_char_store_release) && !defined(AO_HAVE_char_store)
84
# define AO_char_store(addr, val) AO_char_store_release(addr,val)
85
# define AO_HAVE_char_store
88
#if defined(AO_HAVE_char_store_full) && !defined(AO_HAVE_char_store_release)
89
# define AO_char_store_release(addr,val) AO_char_store_full(addr,val)
90
# define AO_HAVE_char_store_release
93
#if defined(AO_HAVE_char_store_full) && !defined(AO_HAVE_char_store_write)
94
# define AO_char_store_write(addr,val) AO_char_store_full(addr,val)
95
# define AO_HAVE_char_store_write
98
#if defined(AO_HAVE_char_store_release) && \
99
!defined(AO_HAVE_char_store_release_write)
100
# define AO_char_store_release_write(addr, val) \
101
AO_char_store_release(addr,val)
102
# define AO_HAVE_char_store_release_write
105
#if defined(AO_HAVE_char_store_write) && !defined(AO_HAVE_char_store)
106
# define AO_char_store(addr, val) AO_char_store_write(addr,val)
107
# define AO_HAVE_char_store
110
#if defined(AO_HAVE_char_store) && defined(AO_HAVE_nop_full) && \
111
!defined(AO_HAVE_char_store_release)
112
# define AO_char_store_release(addr,val) \
113
(AO_nop_full(), AO_char_store(addr,val))
114
# define AO_HAVE_char_store_release
117
#if defined(AO_HAVE_nop_write) && defined(AO_HAVE_char_store) && \
118
!defined(AO_HAVE_char_store_write)
119
# define AO_char_store_write(addr, val) \
120
(AO_nop_write(), AO_char_store(addr,val))
121
# define AO_HAVE_char_store_write
124
#if defined(AO_HAVE_char_store_write) && \
125
!defined(AO_HAVE_char_store_release_write)
126
# define AO_char_store_release_write(addr, val) AO_char_store_write(addr,val)
127
# define AO_HAVE_char_store_release_write
130
#if defined(AO_HAVE_char_store_release) && defined(AO_HAVE_nop_full) && \
131
!defined(AO_HAVE_char_store_full)
132
# define AO_char_store_full(addr, val) \
133
(AO_char_store_release(addr, val), AO_nop_full())
134
# define AO_HAVE_char_store_full
138
/* char_fetch_and_add */
139
#if defined(AO_HAVE_char_compare_and_swap_full) && \
140
!defined(AO_HAVE_char_fetch_and_add_full)
142
AO_char_fetch_and_add_full(volatile unsigned char *addr,
150
while (!AO_char_compare_and_swap_full(addr, old, old+incr));
153
# define AO_HAVE_char_fetch_and_add_full
156
#if defined(AO_HAVE_char_compare_and_swap_acquire) && \
157
!defined(AO_HAVE_char_fetch_and_add_acquire)
159
AO_char_fetch_and_add_acquire(volatile unsigned char *addr,
167
while (!AO_char_compare_and_swap_acquire(addr, old, old+incr));
170
# define AO_HAVE_char_fetch_and_add_acquire
173
#if defined(AO_HAVE_char_compare_and_swap_release) && \
174
!defined(AO_HAVE_char_fetch_and_add_release)
176
AO_char_fetch_and_add_release(volatile unsigned char *addr,
184
while (!AO_char_compare_and_swap_release(addr, old, old+incr));
187
# define AO_HAVE_char_fetch_and_add_release
190
#if defined(AO_HAVE_char_fetch_and_add_full)
191
# if !defined(AO_HAVE_char_fetch_and_add_release)
192
# define AO_char_fetch_and_add_release(addr, val) \
193
AO_char_fetch_and_add_full(addr, val)
194
# define AO_HAVE_char_fetch_and_add_release
196
# if !defined(AO_HAVE_char_fetch_and_add_acquire)
197
# define AO_char_fetch_and_add_acquire(addr, val) \
198
AO_char_fetch_and_add_full(addr, val)
199
# define AO_HAVE_char_fetch_and_add_acquire
201
# if !defined(AO_HAVE_char_fetch_and_add_write)
202
# define AO_char_fetch_and_add_write(addr, val) \
203
AO_char_fetch_and_add_full(addr, val)
204
# define AO_HAVE_char_fetch_and_add_write
206
# if !defined(AO_HAVE_char_fetch_and_add_read)
207
# define AO_char_fetch_and_add_read(addr, val) \
208
AO_char_fetch_and_add_full(addr, val)
209
# define AO_HAVE_char_fetch_and_add_read
211
#endif /* AO_HAVE_char_fetch_and_add_full */
213
#if !defined(AO_HAVE_char_fetch_and_add) && \
214
defined(AO_HAVE_char_fetch_and_add_release)
215
# define AO_char_fetch_and_add(addr, val) \
216
AO_char_fetch_and_add_release(addr, val)
217
# define AO_HAVE_char_fetch_and_add
219
#if !defined(AO_HAVE_char_fetch_and_add) && \
220
defined(AO_HAVE_char_fetch_and_add_acquire)
221
# define AO_char_fetch_and_add(addr, val) \
222
AO_char_fetch_and_add_acquire(addr, val)
223
# define AO_HAVE_char_fetch_and_add
225
#if !defined(AO_HAVE_char_fetch_and_add) && \
226
defined(AO_HAVE_char_fetch_and_add_write)
227
# define AO_char_fetch_and_add(addr, val) \
228
AO_char_fetch_and_add_write(addr, val)
229
# define AO_HAVE_char_fetch_and_add
231
#if !defined(AO_HAVE_char_fetch_and_add) && \
232
defined(AO_HAVE_char_fetch_and_add_read)
233
# define AO_char_fetch_and_add(addr, val) \
234
AO_char_fetch_and_add_read(addr, val)
235
# define AO_HAVE_char_fetch_and_add
238
#if defined(AO_HAVE_char_fetch_and_add_acquire) &&\
239
defined(AO_HAVE_nop_full) && \
240
!defined(AO_HAVE_char_fetch_and_add_full)
241
# define AO_char_fetch_and_add_full(addr, val) \
242
(AO_nop_full(), AO_char_fetch_and_add_acquire(addr, val))
245
#if !defined(AO_HAVE_char_fetch_and_add_release_write) && \
246
defined(AO_HAVE_char_fetch_and_add_write)
247
# define AO_char_fetch_and_add_release_write(addr, val) \
248
AO_char_fetch_and_add_write(addr, val)
249
# define AO_HAVE_char_fetch_and_add_release_write
251
#if !defined(AO_HAVE_char_fetch_and_add_release_write) && \
252
defined(AO_HAVE_char_fetch_and_add_release)
253
# define AO_char_fetch_and_add_release_write(addr, val) \
254
AO_char_fetch_and_add_release(addr, val)
255
# define AO_HAVE_char_fetch_and_add_release_write
257
#if !defined(AO_HAVE_char_fetch_and_add_acquire_read) && \
258
defined(AO_HAVE_char_fetch_and_add_read)
259
# define AO_char_fetch_and_add_acquire_read(addr, val) \
260
AO_char_fetch_and_add_read(addr, val)
261
# define AO_HAVE_char_fetch_and_add_acquire_read
263
#if !defined(AO_HAVE_char_fetch_and_add_acquire_read) && \
264
defined(AO_HAVE_char_fetch_and_add_acquire)
265
# define AO_char_fetch_and_add_acquire_read(addr, val) \
266
AO_char_fetch_and_add_acquire(addr, val)
267
# define AO_HAVE_char_fetch_and_add_acquire_read
270
#ifdef AO_NO_DD_ORDERING
271
# if defined(AO_HAVE_char_fetch_and_add_acquire_read)
272
# define AO_char_fetch_and_add_dd_acquire_read(addr, val) \
273
AO_char_fetch_and_add_acquire_read(addr, val)
274
# define AO_HAVE_char_fetch_and_add_dd_acquire_read
277
# if defined(AO_HAVE_char_fetch_and_add)
278
# define AO_char_fetch_and_add_dd_acquire_read(addr, val) \
279
AO_char_fetch_and_add(addr, val)
280
# define AO_HAVE_char_fetch_and_add_dd_acquire_read
284
/* char_fetch_and_add1 */
286
#if defined(AO_HAVE_char_fetch_and_add_full) &&\
287
!defined(AO_HAVE_char_fetch_and_add1_full)
288
# define AO_char_fetch_and_add1_full(addr) \
289
AO_char_fetch_and_add_full(addr,1)
290
# define AO_HAVE_char_fetch_and_add1_full
292
#if defined(AO_HAVE_char_fetch_and_add_release) &&\
293
!defined(AO_HAVE_char_fetch_and_add1_release)
294
# define AO_char_fetch_and_add1_release(addr) \
295
AO_char_fetch_and_add_release(addr,1)
296
# define AO_HAVE_char_fetch_and_add1_release
298
#if defined(AO_HAVE_char_fetch_and_add_acquire) &&\
299
!defined(AO_HAVE_char_fetch_and_add1_acquire)
300
# define AO_char_fetch_and_add1_acquire(addr) \
301
AO_char_fetch_and_add_acquire(addr,1)
302
# define AO_HAVE_char_fetch_and_add1_acquire
304
#if defined(AO_HAVE_char_fetch_and_add_write) &&\
305
!defined(AO_HAVE_char_fetch_and_add1_write)
306
# define AO_char_fetch_and_add1_write(addr) \
307
AO_char_fetch_and_add_write(addr,1)
308
# define AO_HAVE_char_fetch_and_add1_write
310
#if defined(AO_HAVE_char_fetch_and_add_read) &&\
311
!defined(AO_HAVE_char_fetch_and_add1_read)
312
# define AO_char_fetch_and_add1_read(addr) \
313
AO_char_fetch_and_add_read(addr,1)
314
# define AO_HAVE_char_fetch_and_add1_read
316
#if defined(AO_HAVE_char_fetch_and_add_release_write) &&\
317
!defined(AO_HAVE_char_fetch_and_add1_release_write)
318
# define AO_char_fetch_and_add1_release_write(addr) \
319
AO_char_fetch_and_add_release_write(addr,1)
320
# define AO_HAVE_char_fetch_and_add1_release_write
322
#if defined(AO_HAVE_char_fetch_and_add_acquire_read) &&\
323
!defined(AO_HAVE_char_fetch_and_add1_acquire_read)
324
# define AO_char_fetch_and_add1_acquire_read(addr) \
325
AO_char_fetch_and_add_acquire_read(addr,1)
326
# define AO_HAVE_char_fetch_and_add1_acquire_read
328
#if defined(AO_HAVE_char_fetch_and_add) &&\
329
!defined(AO_HAVE_char_fetch_and_add1)
330
# define AO_char_fetch_and_add1(addr) \
331
AO_char_fetch_and_add(addr,1)
332
# define AO_HAVE_char_fetch_and_add1
335
#if defined(AO_HAVE_char_fetch_and_add1_full)
336
# if !defined(AO_HAVE_char_fetch_and_add1_release)
337
# define AO_char_fetch_and_add1_release(addr) \
338
AO_char_fetch_and_add1_full(addr)
339
# define AO_HAVE_char_fetch_and_add1_release
341
# if !defined(AO_HAVE_char_fetch_and_add1_acquire)
342
# define AO_char_fetch_and_add1_acquire(addr) \
343
AO_char_fetch_and_add1_full(addr)
344
# define AO_HAVE_char_fetch_and_add1_acquire
346
# if !defined(AO_HAVE_char_fetch_and_add1_write)
347
# define AO_char_fetch_and_add1_write(addr) \
348
AO_char_fetch_and_add1_full(addr)
349
# define AO_HAVE_char_fetch_and_add1_write
351
# if !defined(AO_HAVE_char_fetch_and_add1_read)
352
# define AO_char_fetch_and_add1_read(addr) \
353
AO_char_fetch_and_add1_full(addr)
354
# define AO_HAVE_char_fetch_and_add1_read
356
#endif /* AO_HAVE_char_fetch_and_add1_full */
358
#if !defined(AO_HAVE_char_fetch_and_add1) && \
359
defined(AO_HAVE_char_fetch_and_add1_release)
360
# define AO_char_fetch_and_add1(addr) \
361
AO_char_fetch_and_add1_release(addr)
362
# define AO_HAVE_char_fetch_and_add1
364
#if !defined(AO_HAVE_char_fetch_and_add1) && \
365
defined(AO_HAVE_char_fetch_and_add1_acquire)
366
# define AO_char_fetch_and_add1(addr) \
367
AO_char_fetch_and_add1_acquire(addr)
368
# define AO_HAVE_char_fetch_and_add1
370
#if !defined(AO_HAVE_char_fetch_and_add1) && \
371
defined(AO_HAVE_char_fetch_and_add1_write)
372
# define AO_char_fetch_and_add1(addr) \
373
AO_char_fetch_and_add1_write(addr)
374
# define AO_HAVE_char_fetch_and_add1
376
#if !defined(AO_HAVE_char_fetch_and_add1) && \
377
defined(AO_HAVE_char_fetch_and_add1_read)
378
# define AO_char_fetch_and_add1(addr) \
379
AO_char_fetch_and_add1_read(addr)
380
# define AO_HAVE_char_fetch_and_add1
383
#if defined(AO_HAVE_char_fetch_and_add1_acquire) &&\
384
defined(AO_HAVE_nop_full) && \
385
!defined(AO_HAVE_char_fetch_and_add1_full)
386
# define AO_char_fetch_and_add1_full(addr) \
387
(AO_nop_full(), AO_char_fetch_and_add1_acquire(addr))
388
# define AO_HAVE_char_fetch_and_add1_full
391
#if !defined(AO_HAVE_char_fetch_and_add1_release_write) && \
392
defined(AO_HAVE_char_fetch_and_add1_write)
393
# define AO_char_fetch_and_add1_release_write(addr) \
394
AO_char_fetch_and_add1_write(addr)
395
# define AO_HAVE_char_fetch_and_add1_release_write
397
#if !defined(AO_HAVE_char_fetch_and_add1_release_write) && \
398
defined(AO_HAVE_char_fetch_and_add1_release)
399
# define AO_char_fetch_and_add1_release_write(addr) \
400
AO_char_fetch_and_add1_release(addr)
401
# define AO_HAVE_char_fetch_and_add1_release_write
403
#if !defined(AO_HAVE_char_fetch_and_add1_acquire_read) && \
404
defined(AO_HAVE_char_fetch_and_add1_read)
405
# define AO_char_fetch_and_add1_acquire_read(addr) \
406
AO_char_fetch_and_add1_read(addr)
407
# define AO_HAVE_char_fetch_and_add1_acquire_read
409
#if !defined(AO_HAVE_char_fetch_and_add1_acquire_read) && \
410
defined(AO_HAVE_char_fetch_and_add1_acquire)
411
# define AO_char_fetch_and_add1_acquire_read(addr) \
412
AO_char_fetch_and_add1_acquire(addr)
413
# define AO_HAVE_char_fetch_and_add1_acquire_read
416
#ifdef AO_NO_DD_ORDERING
417
# if defined(AO_HAVE_char_fetch_and_add1_acquire_read)
418
# define AO_char_fetch_and_add1_dd_acquire_read(addr) \
419
AO_char_fetch_and_add1_acquire_read(addr)
420
# define AO_HAVE_char_fetch_and_add1_dd_acquire_read
423
# if defined(AO_HAVE_char_fetch_and_add1)
424
# define AO_char_fetch_and_add1_dd_acquire_read(addr) \
425
AO_char_fetch_and_add1(addr)
426
# define AO_HAVE_char_fetch_and_add1_dd_acquire_read
430
/* char_fetch_and_sub1 */
432
#if defined(AO_HAVE_char_fetch_and_add_full) &&\
433
!defined(AO_HAVE_char_fetch_and_sub1_full)
434
# define AO_char_fetch_and_sub1_full(addr) \
435
AO_char_fetch_and_add_full(addr,(unsigned char)(-1))
436
# define AO_HAVE_char_fetch_and_sub1_full
438
#if defined(AO_HAVE_char_fetch_and_add_release) &&\
439
!defined(AO_HAVE_char_fetch_and_sub1_release)
440
# define AO_char_fetch_and_sub1_release(addr) \
441
AO_char_fetch_and_add_release(addr,(unsigned char)(-1))
442
# define AO_HAVE_char_fetch_and_sub1_release
444
#if defined(AO_HAVE_char_fetch_and_add_acquire) &&\
445
!defined(AO_HAVE_char_fetch_and_sub1_acquire)
446
# define AO_char_fetch_and_sub1_acquire(addr) \
447
AO_char_fetch_and_add_acquire(addr,(unsigned char)(-1))
448
# define AO_HAVE_char_fetch_and_sub1_acquire
450
#if defined(AO_HAVE_char_fetch_and_add_write) &&\
451
!defined(AO_HAVE_char_fetch_and_sub1_write)
452
# define AO_char_fetch_and_sub1_write(addr) \
453
AO_char_fetch_and_add_write(addr,(unsigned char)(-1))
454
# define AO_HAVE_char_fetch_and_sub1_write
456
#if defined(AO_HAVE_char_fetch_and_add_read) &&\
457
!defined(AO_HAVE_char_fetch_and_sub1_read)
458
# define AO_char_fetch_and_sub1_read(addr) \
459
AO_char_fetch_and_add_read(addr,(unsigned char)(-1))
460
# define AO_HAVE_char_fetch_and_sub1_read
462
#if defined(AO_HAVE_char_fetch_and_add_release_write) &&\
463
!defined(AO_HAVE_char_fetch_and_sub1_release_write)
464
# define AO_char_fetch_and_sub1_release_write(addr) \
465
AO_char_fetch_and_add_release_write(addr,(unsigned char)(-1))
466
# define AO_HAVE_char_fetch_and_sub1_release_write
468
#if defined(AO_HAVE_char_fetch_and_add_acquire_read) &&\
469
!defined(AO_HAVE_char_fetch_and_sub1_acquire_read)
470
# define AO_char_fetch_and_sub1_acquire_read(addr) \
471
AO_char_fetch_and_add_acquire_read(addr,(unsigned char)(-1))
472
# define AO_HAVE_char_fetch_and_sub1_acquire_read
474
#if defined(AO_HAVE_char_fetch_and_add) &&\
475
!defined(AO_HAVE_char_fetch_and_sub1)
476
# define AO_char_fetch_and_sub1(addr) \
477
AO_char_fetch_and_add(addr,(unsigned char)(-1))
478
# define AO_HAVE_char_fetch_and_sub1
481
#if defined(AO_HAVE_char_fetch_and_sub1_full)
482
# if !defined(AO_HAVE_char_fetch_and_sub1_release)
483
# define AO_char_fetch_and_sub1_release(addr) \
484
AO_char_fetch_and_sub1_full(addr)
485
# define AO_HAVE_char_fetch_and_sub1_release
487
# if !defined(AO_HAVE_char_fetch_and_sub1_acquire)
488
# define AO_char_fetch_and_sub1_acquire(addr) \
489
AO_char_fetch_and_sub1_full(addr)
490
# define AO_HAVE_char_fetch_and_sub1_acquire
492
# if !defined(AO_HAVE_char_fetch_and_sub1_write)
493
# define AO_char_fetch_and_sub1_write(addr) \
494
AO_char_fetch_and_sub1_full(addr)
495
# define AO_HAVE_char_fetch_and_sub1_write
497
# if !defined(AO_HAVE_char_fetch_and_sub1_read)
498
# define AO_char_fetch_and_sub1_read(addr) \
499
AO_char_fetch_and_sub1_full(addr)
500
# define AO_HAVE_char_fetch_and_sub1_read
502
#endif /* AO_HAVE_char_fetch_and_sub1_full */
504
#if !defined(AO_HAVE_char_fetch_and_sub1) && \
505
defined(AO_HAVE_char_fetch_and_sub1_release)
506
# define AO_char_fetch_and_sub1(addr) \
507
AO_char_fetch_and_sub1_release(addr)
508
# define AO_HAVE_char_fetch_and_sub1
510
#if !defined(AO_HAVE_char_fetch_and_sub1) && \
511
defined(AO_HAVE_char_fetch_and_sub1_acquire)
512
# define AO_char_fetch_and_sub1(addr) \
513
AO_char_fetch_and_sub1_acquire(addr)
514
# define AO_HAVE_char_fetch_and_sub1
516
#if !defined(AO_HAVE_char_fetch_and_sub1) && \
517
defined(AO_HAVE_char_fetch_and_sub1_write)
518
# define AO_char_fetch_and_sub1(addr) \
519
AO_char_fetch_and_sub1_write(addr)
520
# define AO_HAVE_char_fetch_and_sub1
522
#if !defined(AO_HAVE_char_fetch_and_sub1) && \
523
defined(AO_HAVE_char_fetch_and_sub1_read)
524
# define AO_char_fetch_and_sub1(addr) \
525
AO_char_fetch_and_sub1_read(addr)
526
# define AO_HAVE_char_fetch_and_sub1
529
#if defined(AO_HAVE_char_fetch_and_sub1_acquire) &&\
530
defined(AO_HAVE_nop_full) && \
531
!defined(AO_HAVE_char_fetch_and_sub1_full)
532
# define AO_char_fetch_and_sub1_full(addr) \
533
(AO_nop_full(), AO_char_fetch_and_sub1_acquire(addr))
534
# define AO_HAVE_char_fetch_and_sub1_full
537
#if !defined(AO_HAVE_char_fetch_and_sub1_release_write) && \
538
defined(AO_HAVE_char_fetch_and_sub1_write)
539
# define AO_char_fetch_and_sub1_release_write(addr) \
540
AO_char_fetch_and_sub1_write(addr)
541
# define AO_HAVE_char_fetch_and_sub1_release_write
543
#if !defined(AO_HAVE_char_fetch_and_sub1_release_write) && \
544
defined(AO_HAVE_char_fetch_and_sub1_release)
545
# define AO_char_fetch_and_sub1_release_write(addr) \
546
AO_char_fetch_and_sub1_release(addr)
547
# define AO_HAVE_char_fetch_and_sub1_release_write
549
#if !defined(AO_HAVE_char_fetch_and_sub1_acquire_read) && \
550
defined(AO_HAVE_char_fetch_and_sub1_read)
551
# define AO_char_fetch_and_sub1_acquire_read(addr) \
552
AO_char_fetch_and_sub1_read(addr)
553
# define AO_HAVE_char_fetch_and_sub1_acquire_read
555
#if !defined(AO_HAVE_char_fetch_and_sub1_acquire_read) && \
556
defined(AO_HAVE_char_fetch_and_sub1_acquire)
557
# define AO_char_fetch_and_sub1_acquire_read(addr) \
558
AO_char_fetch_and_sub1_acquire(addr)
559
# define AO_HAVE_char_fetch_and_sub1_acquire_read
562
#ifdef AO_NO_DD_ORDERING
563
# if defined(AO_HAVE_char_fetch_and_sub1_acquire_read)
564
# define AO_char_fetch_and_sub1_dd_acquire_read(addr) \
565
AO_char_fetch_and_sub1_acquire_read(addr)
566
# define AO_HAVE_char_fetch_and_sub1_dd_acquire_read
569
# if defined(AO_HAVE_char_fetch_and_sub1)
570
# define AO_char_fetch_and_sub1_dd_acquire_read(addr) \
571
AO_char_fetch_and_sub1(addr)
572
# define AO_HAVE_char_fetch_and_sub1_dd_acquire_read
577
#if defined(AO_HAVE_short_load_acquire) && !defined(AO_HAVE_short_load)
578
# define AO_short_load(addr) AO_short_load_acquire(addr)
579
# define AO_HAVE_short_load
582
#if defined(AO_HAVE_short_load_full) && !defined(AO_HAVE_short_load_acquire)
583
# define AO_short_load_acquire(addr) AO_short_load_full(addr)
584
# define AO_HAVE_short_load_acquire
587
#if defined(AO_HAVE_short_load_full) && !defined(AO_HAVE_short_load_read)
588
# define AO_short_load_read(addr) AO_short_load_full(addr)
589
# define AO_HAVE_short_load_read
592
#if !defined(AO_HAVE_short_load_acquire_read) && defined(AO_HAVE_short_load_acquire)
593
# define AO_short_load_acquire_read(addr) AO_short_load_acquire(addr)
594
# define AO_HAVE_short_load_acquire_read
597
#if defined(AO_HAVE_short_load) && defined(AO_HAVE_nop_full) && \
598
!defined(AO_HAVE_short_load_acquire)
599
AO_INLINE unsigned short
600
AO_short_load_acquire(volatile unsigned short *addr)
602
unsigned short result = AO_short_load(addr);
603
/* Acquire barrier would be useless, since the load could be delayed */
608
# define AO_HAVE_short_load_acquire
611
#if defined(AO_HAVE_short_load) && defined(AO_HAVE_nop_read) && \
612
!defined(AO_HAVE_short_load_read)
613
AO_INLINE unsigned short
614
AO_short_load_read(volatile unsigned short *addr)
616
unsigned short result = AO_short_load(addr);
617
/* Acquire barrier would be useless, since the load could be delayed */
622
# define AO_HAVE_short_load_read
625
#if defined(AO_HAVE_short_load_acquire) && defined(AO_HAVE_nop_full) && \
626
!defined(AO_HAVE_short_load_full)
627
# define AO_short_load_full(addr) (AO_nop_full(), AO_short_load_acquire(addr))
628
# define AO_HAVE_short_load_full
631
#if !defined(AO_HAVE_short_load_acquire_read) && defined(AO_HAVE_short_load_read)
632
# define AO_short_load_acquire_read(addr) AO_short_load_read(addr)
633
# define AO_HAVE_short_load_acquire_read
636
#if defined(AO_HAVE_short_load_acquire_read) && !defined(AO_HAVE_short_load)
637
# define AO_short_load(addr) AO_short_load_acquire_read(addr)
638
# define AO_HAVE_short_load
641
#ifdef AO_NO_DD_ORDERING
642
# if defined(AO_HAVE_short_load_acquire_read)
643
# define AO_short_load_dd_acquire_read(addr) \
644
AO_short_load_acquire_read(addr)
645
# define AO_HAVE_short_load_dd_acquire_read
648
# if defined(AO_HAVE_short_load)
649
# define AO_short_load_dd_acquire_read(addr) \
651
# define AO_HAVE_short_load_dd_acquire_read
658
#if defined(AO_HAVE_short_store_release) && !defined(AO_HAVE_short_store)
659
# define AO_short_store(addr, val) AO_short_store_release(addr,val)
660
# define AO_HAVE_short_store
663
#if defined(AO_HAVE_short_store_full) && !defined(AO_HAVE_short_store_release)
664
# define AO_short_store_release(addr,val) AO_short_store_full(addr,val)
665
# define AO_HAVE_short_store_release
668
#if defined(AO_HAVE_short_store_full) && !defined(AO_HAVE_short_store_write)
669
# define AO_short_store_write(addr,val) AO_short_store_full(addr,val)
670
# define AO_HAVE_short_store_write
673
#if defined(AO_HAVE_short_store_release) && \
674
!defined(AO_HAVE_short_store_release_write)
675
# define AO_short_store_release_write(addr, val) \
676
AO_short_store_release(addr,val)
677
# define AO_HAVE_short_store_release_write
680
#if defined(AO_HAVE_short_store_write) && !defined(AO_HAVE_short_store)
681
# define AO_short_store(addr, val) AO_short_store_write(addr,val)
682
# define AO_HAVE_short_store
685
#if defined(AO_HAVE_short_store) && defined(AO_HAVE_nop_full) && \
686
!defined(AO_HAVE_short_store_release)
687
# define AO_short_store_release(addr,val) \
688
(AO_nop_full(), AO_short_store(addr,val))
689
# define AO_HAVE_short_store_release
692
#if defined(AO_HAVE_nop_write) && defined(AO_HAVE_short_store) && \
693
!defined(AO_HAVE_short_store_write)
694
# define AO_short_store_write(addr, val) \
695
(AO_nop_write(), AO_short_store(addr,val))
696
# define AO_HAVE_short_store_write
699
#if defined(AO_HAVE_short_store_write) && \
700
!defined(AO_HAVE_short_store_release_write)
701
# define AO_short_store_release_write(addr, val) AO_short_store_write(addr,val)
702
# define AO_HAVE_short_store_release_write
705
#if defined(AO_HAVE_short_store_release) && defined(AO_HAVE_nop_full) && \
706
!defined(AO_HAVE_short_store_full)
707
# define AO_short_store_full(addr, val) \
708
(AO_short_store_release(addr, val), AO_nop_full())
709
# define AO_HAVE_short_store_full
713
/* short_fetch_and_add */
714
#if defined(AO_HAVE_short_compare_and_swap_full) && \
715
!defined(AO_HAVE_short_fetch_and_add_full)
717
AO_short_fetch_and_add_full(volatile unsigned short *addr,
725
while (!AO_short_compare_and_swap_full(addr, old, old+incr));
728
# define AO_HAVE_short_fetch_and_add_full
731
#if defined(AO_HAVE_short_compare_and_swap_acquire) && \
732
!defined(AO_HAVE_short_fetch_and_add_acquire)
734
AO_short_fetch_and_add_acquire(volatile unsigned short *addr,
742
while (!AO_short_compare_and_swap_acquire(addr, old, old+incr));
745
# define AO_HAVE_short_fetch_and_add_acquire
748
#if defined(AO_HAVE_short_compare_and_swap_release) && \
749
!defined(AO_HAVE_short_fetch_and_add_release)
751
AO_short_fetch_and_add_release(volatile unsigned short *addr,
759
while (!AO_short_compare_and_swap_release(addr, old, old+incr));
762
# define AO_HAVE_short_fetch_and_add_release
765
#if defined(AO_HAVE_short_fetch_and_add_full)
766
# if !defined(AO_HAVE_short_fetch_and_add_release)
767
# define AO_short_fetch_and_add_release(addr, val) \
768
AO_short_fetch_and_add_full(addr, val)
769
# define AO_HAVE_short_fetch_and_add_release
771
# if !defined(AO_HAVE_short_fetch_and_add_acquire)
772
# define AO_short_fetch_and_add_acquire(addr, val) \
773
AO_short_fetch_and_add_full(addr, val)
774
# define AO_HAVE_short_fetch_and_add_acquire
776
# if !defined(AO_HAVE_short_fetch_and_add_write)
777
# define AO_short_fetch_and_add_write(addr, val) \
778
AO_short_fetch_and_add_full(addr, val)
779
# define AO_HAVE_short_fetch_and_add_write
781
# if !defined(AO_HAVE_short_fetch_and_add_read)
782
# define AO_short_fetch_and_add_read(addr, val) \
783
AO_short_fetch_and_add_full(addr, val)
784
# define AO_HAVE_short_fetch_and_add_read
786
#endif /* AO_HAVE_short_fetch_and_add_full */
788
#if !defined(AO_HAVE_short_fetch_and_add) && \
789
defined(AO_HAVE_short_fetch_and_add_release)
790
# define AO_short_fetch_and_add(addr, val) \
791
AO_short_fetch_and_add_release(addr, val)
792
# define AO_HAVE_short_fetch_and_add
794
#if !defined(AO_HAVE_short_fetch_and_add) && \
795
defined(AO_HAVE_short_fetch_and_add_acquire)
796
# define AO_short_fetch_and_add(addr, val) \
797
AO_short_fetch_and_add_acquire(addr, val)
798
# define AO_HAVE_short_fetch_and_add
800
#if !defined(AO_HAVE_short_fetch_and_add) && \
801
defined(AO_HAVE_short_fetch_and_add_write)
802
# define AO_short_fetch_and_add(addr, val) \
803
AO_short_fetch_and_add_write(addr, val)
804
# define AO_HAVE_short_fetch_and_add
806
#if !defined(AO_HAVE_short_fetch_and_add) && \
807
defined(AO_HAVE_short_fetch_and_add_read)
808
# define AO_short_fetch_and_add(addr, val) \
809
AO_short_fetch_and_add_read(addr, val)
810
# define AO_HAVE_short_fetch_and_add
813
#if defined(AO_HAVE_short_fetch_and_add_acquire) &&\
814
defined(AO_HAVE_nop_full) && \
815
!defined(AO_HAVE_short_fetch_and_add_full)
816
# define AO_short_fetch_and_add_full(addr, val) \
817
(AO_nop_full(), AO_short_fetch_and_add_acquire(addr, val))
820
#if !defined(AO_HAVE_short_fetch_and_add_release_write) && \
821
defined(AO_HAVE_short_fetch_and_add_write)
822
# define AO_short_fetch_and_add_release_write(addr, val) \
823
AO_short_fetch_and_add_write(addr, val)
824
# define AO_HAVE_short_fetch_and_add_release_write
826
#if !defined(AO_HAVE_short_fetch_and_add_release_write) && \
827
defined(AO_HAVE_short_fetch_and_add_release)
828
# define AO_short_fetch_and_add_release_write(addr, val) \
829
AO_short_fetch_and_add_release(addr, val)
830
# define AO_HAVE_short_fetch_and_add_release_write
832
#if !defined(AO_HAVE_short_fetch_and_add_acquire_read) && \
833
defined(AO_HAVE_short_fetch_and_add_read)
834
# define AO_short_fetch_and_add_acquire_read(addr, val) \
835
AO_short_fetch_and_add_read(addr, val)
836
# define AO_HAVE_short_fetch_and_add_acquire_read
838
#if !defined(AO_HAVE_short_fetch_and_add_acquire_read) && \
839
defined(AO_HAVE_short_fetch_and_add_acquire)
840
# define AO_short_fetch_and_add_acquire_read(addr, val) \
841
AO_short_fetch_and_add_acquire(addr, val)
842
# define AO_HAVE_short_fetch_and_add_acquire_read
845
#ifdef AO_NO_DD_ORDERING
846
# if defined(AO_HAVE_short_fetch_and_add_acquire_read)
847
# define AO_short_fetch_and_add_dd_acquire_read(addr, val) \
848
AO_short_fetch_and_add_acquire_read(addr, val)
849
# define AO_HAVE_short_fetch_and_add_dd_acquire_read
852
# if defined(AO_HAVE_short_fetch_and_add)
853
# define AO_short_fetch_and_add_dd_acquire_read(addr, val) \
854
AO_short_fetch_and_add(addr, val)
855
# define AO_HAVE_short_fetch_and_add_dd_acquire_read
859
/* short_fetch_and_add1 */
861
#if defined(AO_HAVE_short_fetch_and_add_full) &&\
862
!defined(AO_HAVE_short_fetch_and_add1_full)
863
# define AO_short_fetch_and_add1_full(addr) \
864
AO_short_fetch_and_add_full(addr,1)
865
# define AO_HAVE_short_fetch_and_add1_full
867
#if defined(AO_HAVE_short_fetch_and_add_release) &&\
868
!defined(AO_HAVE_short_fetch_and_add1_release)
869
# define AO_short_fetch_and_add1_release(addr) \
870
AO_short_fetch_and_add_release(addr,1)
871
# define AO_HAVE_short_fetch_and_add1_release
873
#if defined(AO_HAVE_short_fetch_and_add_acquire) &&\
874
!defined(AO_HAVE_short_fetch_and_add1_acquire)
875
# define AO_short_fetch_and_add1_acquire(addr) \
876
AO_short_fetch_and_add_acquire(addr,1)
877
# define AO_HAVE_short_fetch_and_add1_acquire
879
#if defined(AO_HAVE_short_fetch_and_add_write) &&\
880
!defined(AO_HAVE_short_fetch_and_add1_write)
881
# define AO_short_fetch_and_add1_write(addr) \
882
AO_short_fetch_and_add_write(addr,1)
883
# define AO_HAVE_short_fetch_and_add1_write
885
#if defined(AO_HAVE_short_fetch_and_add_read) &&\
886
!defined(AO_HAVE_short_fetch_and_add1_read)
887
# define AO_short_fetch_and_add1_read(addr) \
888
AO_short_fetch_and_add_read(addr,1)
889
# define AO_HAVE_short_fetch_and_add1_read
891
#if defined(AO_HAVE_short_fetch_and_add_release_write) &&\
892
!defined(AO_HAVE_short_fetch_and_add1_release_write)
893
# define AO_short_fetch_and_add1_release_write(addr) \
894
AO_short_fetch_and_add_release_write(addr,1)
895
# define AO_HAVE_short_fetch_and_add1_release_write
897
#if defined(AO_HAVE_short_fetch_and_add_acquire_read) &&\
898
!defined(AO_HAVE_short_fetch_and_add1_acquire_read)
899
# define AO_short_fetch_and_add1_acquire_read(addr) \
900
AO_short_fetch_and_add_acquire_read(addr,1)
901
# define AO_HAVE_short_fetch_and_add1_acquire_read
903
#if defined(AO_HAVE_short_fetch_and_add) &&\
904
!defined(AO_HAVE_short_fetch_and_add1)
905
# define AO_short_fetch_and_add1(addr) \
906
AO_short_fetch_and_add(addr,1)
907
# define AO_HAVE_short_fetch_and_add1
910
#if defined(AO_HAVE_short_fetch_and_add1_full)
911
# if !defined(AO_HAVE_short_fetch_and_add1_release)
912
# define AO_short_fetch_and_add1_release(addr) \
913
AO_short_fetch_and_add1_full(addr)
914
# define AO_HAVE_short_fetch_and_add1_release
916
# if !defined(AO_HAVE_short_fetch_and_add1_acquire)
917
# define AO_short_fetch_and_add1_acquire(addr) \
918
AO_short_fetch_and_add1_full(addr)
919
# define AO_HAVE_short_fetch_and_add1_acquire
921
# if !defined(AO_HAVE_short_fetch_and_add1_write)
922
# define AO_short_fetch_and_add1_write(addr) \
923
AO_short_fetch_and_add1_full(addr)
924
# define AO_HAVE_short_fetch_and_add1_write
926
# if !defined(AO_HAVE_short_fetch_and_add1_read)
927
# define AO_short_fetch_and_add1_read(addr) \
928
AO_short_fetch_and_add1_full(addr)
929
# define AO_HAVE_short_fetch_and_add1_read
931
#endif /* AO_HAVE_short_fetch_and_add1_full */
933
#if !defined(AO_HAVE_short_fetch_and_add1) && \
934
defined(AO_HAVE_short_fetch_and_add1_release)
935
# define AO_short_fetch_and_add1(addr) \
936
AO_short_fetch_and_add1_release(addr)
937
# define AO_HAVE_short_fetch_and_add1
939
#if !defined(AO_HAVE_short_fetch_and_add1) && \
940
defined(AO_HAVE_short_fetch_and_add1_acquire)
941
# define AO_short_fetch_and_add1(addr) \
942
AO_short_fetch_and_add1_acquire(addr)
943
# define AO_HAVE_short_fetch_and_add1
945
#if !defined(AO_HAVE_short_fetch_and_add1) && \
946
defined(AO_HAVE_short_fetch_and_add1_write)
947
# define AO_short_fetch_and_add1(addr) \
948
AO_short_fetch_and_add1_write(addr)
949
# define AO_HAVE_short_fetch_and_add1
951
#if !defined(AO_HAVE_short_fetch_and_add1) && \
952
defined(AO_HAVE_short_fetch_and_add1_read)
953
# define AO_short_fetch_and_add1(addr) \
954
AO_short_fetch_and_add1_read(addr)
955
# define AO_HAVE_short_fetch_and_add1
958
#if defined(AO_HAVE_short_fetch_and_add1_acquire) &&\
959
defined(AO_HAVE_nop_full) && \
960
!defined(AO_HAVE_short_fetch_and_add1_full)
961
# define AO_short_fetch_and_add1_full(addr) \
962
(AO_nop_full(), AO_short_fetch_and_add1_acquire(addr))
963
# define AO_HAVE_short_fetch_and_add1_full
966
#if !defined(AO_HAVE_short_fetch_and_add1_release_write) && \
967
defined(AO_HAVE_short_fetch_and_add1_write)
968
# define AO_short_fetch_and_add1_release_write(addr) \
969
AO_short_fetch_and_add1_write(addr)
970
# define AO_HAVE_short_fetch_and_add1_release_write
972
#if !defined(AO_HAVE_short_fetch_and_add1_release_write) && \
973
defined(AO_HAVE_short_fetch_and_add1_release)
974
# define AO_short_fetch_and_add1_release_write(addr) \
975
AO_short_fetch_and_add1_release(addr)
976
# define AO_HAVE_short_fetch_and_add1_release_write
978
#if !defined(AO_HAVE_short_fetch_and_add1_acquire_read) && \
979
defined(AO_HAVE_short_fetch_and_add1_read)
980
# define AO_short_fetch_and_add1_acquire_read(addr) \
981
AO_short_fetch_and_add1_read(addr)
982
# define AO_HAVE_short_fetch_and_add1_acquire_read
984
#if !defined(AO_HAVE_short_fetch_and_add1_acquire_read) && \
985
defined(AO_HAVE_short_fetch_and_add1_acquire)
986
# define AO_short_fetch_and_add1_acquire_read(addr) \
987
AO_short_fetch_and_add1_acquire(addr)
988
# define AO_HAVE_short_fetch_and_add1_acquire_read
991
#ifdef AO_NO_DD_ORDERING
992
# if defined(AO_HAVE_short_fetch_and_add1_acquire_read)
993
# define AO_short_fetch_and_add1_dd_acquire_read(addr) \
994
AO_short_fetch_and_add1_acquire_read(addr)
995
# define AO_HAVE_short_fetch_and_add1_dd_acquire_read
998
# if defined(AO_HAVE_short_fetch_and_add1)
999
# define AO_short_fetch_and_add1_dd_acquire_read(addr) \
1000
AO_short_fetch_and_add1(addr)
1001
# define AO_HAVE_short_fetch_and_add1_dd_acquire_read
1005
/* short_fetch_and_sub1 */
1007
#if defined(AO_HAVE_short_fetch_and_add_full) &&\
1008
!defined(AO_HAVE_short_fetch_and_sub1_full)
1009
# define AO_short_fetch_and_sub1_full(addr) \
1010
AO_short_fetch_and_add_full(addr,(unsigned short)(-1))
1011
# define AO_HAVE_short_fetch_and_sub1_full
1013
#if defined(AO_HAVE_short_fetch_and_add_release) &&\
1014
!defined(AO_HAVE_short_fetch_and_sub1_release)
1015
# define AO_short_fetch_and_sub1_release(addr) \
1016
AO_short_fetch_and_add_release(addr,(unsigned short)(-1))
1017
# define AO_HAVE_short_fetch_and_sub1_release
1019
#if defined(AO_HAVE_short_fetch_and_add_acquire) &&\
1020
!defined(AO_HAVE_short_fetch_and_sub1_acquire)
1021
# define AO_short_fetch_and_sub1_acquire(addr) \
1022
AO_short_fetch_and_add_acquire(addr,(unsigned short)(-1))
1023
# define AO_HAVE_short_fetch_and_sub1_acquire
1025
#if defined(AO_HAVE_short_fetch_and_add_write) &&\
1026
!defined(AO_HAVE_short_fetch_and_sub1_write)
1027
# define AO_short_fetch_and_sub1_write(addr) \
1028
AO_short_fetch_and_add_write(addr,(unsigned short)(-1))
1029
# define AO_HAVE_short_fetch_and_sub1_write
1031
#if defined(AO_HAVE_short_fetch_and_add_read) &&\
1032
!defined(AO_HAVE_short_fetch_and_sub1_read)
1033
# define AO_short_fetch_and_sub1_read(addr) \
1034
AO_short_fetch_and_add_read(addr,(unsigned short)(-1))
1035
# define AO_HAVE_short_fetch_and_sub1_read
1037
#if defined(AO_HAVE_short_fetch_and_add_release_write) &&\
1038
!defined(AO_HAVE_short_fetch_and_sub1_release_write)
1039
# define AO_short_fetch_and_sub1_release_write(addr) \
1040
AO_short_fetch_and_add_release_write(addr,(unsigned short)(-1))
1041
# define AO_HAVE_short_fetch_and_sub1_release_write
1043
#if defined(AO_HAVE_short_fetch_and_add_acquire_read) &&\
1044
!defined(AO_HAVE_short_fetch_and_sub1_acquire_read)
1045
# define AO_short_fetch_and_sub1_acquire_read(addr) \
1046
AO_short_fetch_and_add_acquire_read(addr,(unsigned short)(-1))
1047
# define AO_HAVE_short_fetch_and_sub1_acquire_read
1049
#if defined(AO_HAVE_short_fetch_and_add) &&\
1050
!defined(AO_HAVE_short_fetch_and_sub1)
1051
# define AO_short_fetch_and_sub1(addr) \
1052
AO_short_fetch_and_add(addr,(unsigned short)(-1))
1053
# define AO_HAVE_short_fetch_and_sub1
1056
#if defined(AO_HAVE_short_fetch_and_sub1_full)
1057
# if !defined(AO_HAVE_short_fetch_and_sub1_release)
1058
# define AO_short_fetch_and_sub1_release(addr) \
1059
AO_short_fetch_and_sub1_full(addr)
1060
# define AO_HAVE_short_fetch_and_sub1_release
1062
# if !defined(AO_HAVE_short_fetch_and_sub1_acquire)
1063
# define AO_short_fetch_and_sub1_acquire(addr) \
1064
AO_short_fetch_and_sub1_full(addr)
1065
# define AO_HAVE_short_fetch_and_sub1_acquire
1067
# if !defined(AO_HAVE_short_fetch_and_sub1_write)
1068
# define AO_short_fetch_and_sub1_write(addr) \
1069
AO_short_fetch_and_sub1_full(addr)
1070
# define AO_HAVE_short_fetch_and_sub1_write
1072
# if !defined(AO_HAVE_short_fetch_and_sub1_read)
1073
# define AO_short_fetch_and_sub1_read(addr) \
1074
AO_short_fetch_and_sub1_full(addr)
1075
# define AO_HAVE_short_fetch_and_sub1_read
1077
#endif /* AO_HAVE_short_fetch_and_sub1_full */
1079
#if !defined(AO_HAVE_short_fetch_and_sub1) && \
1080
defined(AO_HAVE_short_fetch_and_sub1_release)
1081
# define AO_short_fetch_and_sub1(addr) \
1082
AO_short_fetch_and_sub1_release(addr)
1083
# define AO_HAVE_short_fetch_and_sub1
1085
#if !defined(AO_HAVE_short_fetch_and_sub1) && \
1086
defined(AO_HAVE_short_fetch_and_sub1_acquire)
1087
# define AO_short_fetch_and_sub1(addr) \
1088
AO_short_fetch_and_sub1_acquire(addr)
1089
# define AO_HAVE_short_fetch_and_sub1
1091
#if !defined(AO_HAVE_short_fetch_and_sub1) && \
1092
defined(AO_HAVE_short_fetch_and_sub1_write)
1093
# define AO_short_fetch_and_sub1(addr) \
1094
AO_short_fetch_and_sub1_write(addr)
1095
# define AO_HAVE_short_fetch_and_sub1
1097
#if !defined(AO_HAVE_short_fetch_and_sub1) && \
1098
defined(AO_HAVE_short_fetch_and_sub1_read)
1099
# define AO_short_fetch_and_sub1(addr) \
1100
AO_short_fetch_and_sub1_read(addr)
1101
# define AO_HAVE_short_fetch_and_sub1
1104
#if defined(AO_HAVE_short_fetch_and_sub1_acquire) &&\
1105
defined(AO_HAVE_nop_full) && \
1106
!defined(AO_HAVE_short_fetch_and_sub1_full)
1107
# define AO_short_fetch_and_sub1_full(addr) \
1108
(AO_nop_full(), AO_short_fetch_and_sub1_acquire(addr))
1109
# define AO_HAVE_short_fetch_and_sub1_full
1112
#if !defined(AO_HAVE_short_fetch_and_sub1_release_write) && \
1113
defined(AO_HAVE_short_fetch_and_sub1_write)
1114
# define AO_short_fetch_and_sub1_release_write(addr) \
1115
AO_short_fetch_and_sub1_write(addr)
1116
# define AO_HAVE_short_fetch_and_sub1_release_write
1118
#if !defined(AO_HAVE_short_fetch_and_sub1_release_write) && \
1119
defined(AO_HAVE_short_fetch_and_sub1_release)
1120
# define AO_short_fetch_and_sub1_release_write(addr) \
1121
AO_short_fetch_and_sub1_release(addr)
1122
# define AO_HAVE_short_fetch_and_sub1_release_write
1124
#if !defined(AO_HAVE_short_fetch_and_sub1_acquire_read) && \
1125
defined(AO_HAVE_short_fetch_and_sub1_read)
1126
# define AO_short_fetch_and_sub1_acquire_read(addr) \
1127
AO_short_fetch_and_sub1_read(addr)
1128
# define AO_HAVE_short_fetch_and_sub1_acquire_read
1130
#if !defined(AO_HAVE_short_fetch_and_sub1_acquire_read) && \
1131
defined(AO_HAVE_short_fetch_and_sub1_acquire)
1132
# define AO_short_fetch_and_sub1_acquire_read(addr) \
1133
AO_short_fetch_and_sub1_acquire(addr)
1134
# define AO_HAVE_short_fetch_and_sub1_acquire_read
1137
#ifdef AO_NO_DD_ORDERING
1138
# if defined(AO_HAVE_short_fetch_and_sub1_acquire_read)
1139
# define AO_short_fetch_and_sub1_dd_acquire_read(addr) \
1140
AO_short_fetch_and_sub1_acquire_read(addr)
1141
# define AO_HAVE_short_fetch_and_sub1_dd_acquire_read
1144
# if defined(AO_HAVE_short_fetch_and_sub1)
1145
# define AO_short_fetch_and_sub1_dd_acquire_read(addr) \
1146
AO_short_fetch_and_sub1(addr)
1147
# define AO_HAVE_short_fetch_and_sub1_dd_acquire_read
1152
#if defined(AO_HAVE_int_load_acquire) && !defined(AO_HAVE_int_load)
1153
# define AO_int_load(addr) AO_int_load_acquire(addr)
1154
# define AO_HAVE_int_load
1157
#if defined(AO_HAVE_int_load_full) && !defined(AO_HAVE_int_load_acquire)
1158
# define AO_int_load_acquire(addr) AO_int_load_full(addr)
1159
# define AO_HAVE_int_load_acquire
1162
#if defined(AO_HAVE_int_load_full) && !defined(AO_HAVE_int_load_read)
1163
# define AO_int_load_read(addr) AO_int_load_full(addr)
1164
# define AO_HAVE_int_load_read
1167
#if !defined(AO_HAVE_int_load_acquire_read) && defined(AO_HAVE_int_load_acquire)
1168
# define AO_int_load_acquire_read(addr) AO_int_load_acquire(addr)
1169
# define AO_HAVE_int_load_acquire_read
1172
#if defined(AO_HAVE_int_load) && defined(AO_HAVE_nop_full) && \
1173
!defined(AO_HAVE_int_load_acquire)
1174
AO_INLINE unsigned int
1175
AO_int_load_acquire(volatile unsigned int *addr)
1177
unsigned int result = AO_int_load(addr);
1178
/* Acquire barrier would be useless, since the load could be delayed */
1183
# define AO_HAVE_int_load_acquire
1186
#if defined(AO_HAVE_int_load) && defined(AO_HAVE_nop_read) && \
1187
!defined(AO_HAVE_int_load_read)
1188
AO_INLINE unsigned int
1189
AO_int_load_read(volatile unsigned int *addr)
1191
unsigned int result = AO_int_load(addr);
1192
/* Acquire barrier would be useless, since the load could be delayed */
1197
# define AO_HAVE_int_load_read
1200
#if defined(AO_HAVE_int_load_acquire) && defined(AO_HAVE_nop_full) && \
1201
!defined(AO_HAVE_int_load_full)
1202
# define AO_int_load_full(addr) (AO_nop_full(), AO_int_load_acquire(addr))
1203
# define AO_HAVE_int_load_full
1206
#if !defined(AO_HAVE_int_load_acquire_read) && defined(AO_HAVE_int_load_read)
1207
# define AO_int_load_acquire_read(addr) AO_int_load_read(addr)
1208
# define AO_HAVE_int_load_acquire_read
1211
#if defined(AO_HAVE_int_load_acquire_read) && !defined(AO_HAVE_int_load)
1212
# define AO_int_load(addr) AO_int_load_acquire_read(addr)
1213
# define AO_HAVE_int_load
1216
#ifdef AO_NO_DD_ORDERING
1217
# if defined(AO_HAVE_int_load_acquire_read)
1218
# define AO_int_load_dd_acquire_read(addr) \
1219
AO_int_load_acquire_read(addr)
1220
# define AO_HAVE_int_load_dd_acquire_read
1223
# if defined(AO_HAVE_int_load)
1224
# define AO_int_load_dd_acquire_read(addr) \
1226
# define AO_HAVE_int_load_dd_acquire_read
1233
#if defined(AO_HAVE_int_store_release) && !defined(AO_HAVE_int_store)
1234
# define AO_int_store(addr, val) AO_int_store_release(addr,val)
1235
# define AO_HAVE_int_store
1238
#if defined(AO_HAVE_int_store_full) && !defined(AO_HAVE_int_store_release)
1239
# define AO_int_store_release(addr,val) AO_int_store_full(addr,val)
1240
# define AO_HAVE_int_store_release
1243
#if defined(AO_HAVE_int_store_full) && !defined(AO_HAVE_int_store_write)
1244
# define AO_int_store_write(addr,val) AO_int_store_full(addr,val)
1245
# define AO_HAVE_int_store_write
1248
#if defined(AO_HAVE_int_store_release) && \
1249
!defined(AO_HAVE_int_store_release_write)
1250
# define AO_int_store_release_write(addr, val) \
1251
AO_int_store_release(addr,val)
1252
# define AO_HAVE_int_store_release_write
1255
#if defined(AO_HAVE_int_store_write) && !defined(AO_HAVE_int_store)
1256
# define AO_int_store(addr, val) AO_int_store_write(addr,val)
1257
# define AO_HAVE_int_store
1260
#if defined(AO_HAVE_int_store) && defined(AO_HAVE_nop_full) && \
1261
!defined(AO_HAVE_int_store_release)
1262
# define AO_int_store_release(addr,val) \
1263
(AO_nop_full(), AO_int_store(addr,val))
1264
# define AO_HAVE_int_store_release
1267
#if defined(AO_HAVE_nop_write) && defined(AO_HAVE_int_store) && \
1268
!defined(AO_HAVE_int_store_write)
1269
# define AO_int_store_write(addr, val) \
1270
(AO_nop_write(), AO_int_store(addr,val))
1271
# define AO_HAVE_int_store_write
1274
#if defined(AO_HAVE_int_store_write) && \
1275
!defined(AO_HAVE_int_store_release_write)
1276
# define AO_int_store_release_write(addr, val) AO_int_store_write(addr,val)
1277
# define AO_HAVE_int_store_release_write
1280
#if defined(AO_HAVE_int_store_release) && defined(AO_HAVE_nop_full) && \
1281
!defined(AO_HAVE_int_store_full)
1282
# define AO_int_store_full(addr, val) \
1283
(AO_int_store_release(addr, val), AO_nop_full())
1284
# define AO_HAVE_int_store_full
1288
/* int_fetch_and_add */
1289
#if defined(AO_HAVE_int_compare_and_swap_full) && \
1290
!defined(AO_HAVE_int_fetch_and_add_full)
1292
AO_int_fetch_and_add_full(volatile unsigned int *addr,
1300
while (!AO_int_compare_and_swap_full(addr, old, old+incr));
1303
# define AO_HAVE_int_fetch_and_add_full
1306
#if defined(AO_HAVE_int_compare_and_swap_acquire) && \
1307
!defined(AO_HAVE_int_fetch_and_add_acquire)
1309
AO_int_fetch_and_add_acquire(volatile unsigned int *addr,
1317
while (!AO_int_compare_and_swap_acquire(addr, old, old+incr));
1320
# define AO_HAVE_int_fetch_and_add_acquire
1323
#if defined(AO_HAVE_int_compare_and_swap_release) && \
1324
!defined(AO_HAVE_int_fetch_and_add_release)
1326
AO_int_fetch_and_add_release(volatile unsigned int *addr,
1334
while (!AO_int_compare_and_swap_release(addr, old, old+incr));
1337
# define AO_HAVE_int_fetch_and_add_release
1340
#if defined(AO_HAVE_int_fetch_and_add_full)
1341
# if !defined(AO_HAVE_int_fetch_and_add_release)
1342
# define AO_int_fetch_and_add_release(addr, val) \
1343
AO_int_fetch_and_add_full(addr, val)
1344
# define AO_HAVE_int_fetch_and_add_release
1346
# if !defined(AO_HAVE_int_fetch_and_add_acquire)
1347
# define AO_int_fetch_and_add_acquire(addr, val) \
1348
AO_int_fetch_and_add_full(addr, val)
1349
# define AO_HAVE_int_fetch_and_add_acquire
1351
# if !defined(AO_HAVE_int_fetch_and_add_write)
1352
# define AO_int_fetch_and_add_write(addr, val) \
1353
AO_int_fetch_and_add_full(addr, val)
1354
# define AO_HAVE_int_fetch_and_add_write
1356
# if !defined(AO_HAVE_int_fetch_and_add_read)
1357
# define AO_int_fetch_and_add_read(addr, val) \
1358
AO_int_fetch_and_add_full(addr, val)
1359
# define AO_HAVE_int_fetch_and_add_read
1361
#endif /* AO_HAVE_int_fetch_and_add_full */
1363
#if !defined(AO_HAVE_int_fetch_and_add) && \
1364
defined(AO_HAVE_int_fetch_and_add_release)
1365
# define AO_int_fetch_and_add(addr, val) \
1366
AO_int_fetch_and_add_release(addr, val)
1367
# define AO_HAVE_int_fetch_and_add
1369
#if !defined(AO_HAVE_int_fetch_and_add) && \
1370
defined(AO_HAVE_int_fetch_and_add_acquire)
1371
# define AO_int_fetch_and_add(addr, val) \
1372
AO_int_fetch_and_add_acquire(addr, val)
1373
# define AO_HAVE_int_fetch_and_add
1375
#if !defined(AO_HAVE_int_fetch_and_add) && \
1376
defined(AO_HAVE_int_fetch_and_add_write)
1377
# define AO_int_fetch_and_add(addr, val) \
1378
AO_int_fetch_and_add_write(addr, val)
1379
# define AO_HAVE_int_fetch_and_add
1381
#if !defined(AO_HAVE_int_fetch_and_add) && \
1382
defined(AO_HAVE_int_fetch_and_add_read)
1383
# define AO_int_fetch_and_add(addr, val) \
1384
AO_int_fetch_and_add_read(addr, val)
1385
# define AO_HAVE_int_fetch_and_add
1388
#if defined(AO_HAVE_int_fetch_and_add_acquire) &&\
1389
defined(AO_HAVE_nop_full) && \
1390
!defined(AO_HAVE_int_fetch_and_add_full)
1391
# define AO_int_fetch_and_add_full(addr, val) \
1392
(AO_nop_full(), AO_int_fetch_and_add_acquire(addr, val))
1395
#if !defined(AO_HAVE_int_fetch_and_add_release_write) && \
1396
defined(AO_HAVE_int_fetch_and_add_write)
1397
# define AO_int_fetch_and_add_release_write(addr, val) \
1398
AO_int_fetch_and_add_write(addr, val)
1399
# define AO_HAVE_int_fetch_and_add_release_write
1401
#if !defined(AO_HAVE_int_fetch_and_add_release_write) && \
1402
defined(AO_HAVE_int_fetch_and_add_release)
1403
# define AO_int_fetch_and_add_release_write(addr, val) \
1404
AO_int_fetch_and_add_release(addr, val)
1405
# define AO_HAVE_int_fetch_and_add_release_write
1407
#if !defined(AO_HAVE_int_fetch_and_add_acquire_read) && \
1408
defined(AO_HAVE_int_fetch_and_add_read)
1409
# define AO_int_fetch_and_add_acquire_read(addr, val) \
1410
AO_int_fetch_and_add_read(addr, val)
1411
# define AO_HAVE_int_fetch_and_add_acquire_read
1413
#if !defined(AO_HAVE_int_fetch_and_add_acquire_read) && \
1414
defined(AO_HAVE_int_fetch_and_add_acquire)
1415
# define AO_int_fetch_and_add_acquire_read(addr, val) \
1416
AO_int_fetch_and_add_acquire(addr, val)
1417
# define AO_HAVE_int_fetch_and_add_acquire_read
1420
#ifdef AO_NO_DD_ORDERING
1421
# if defined(AO_HAVE_int_fetch_and_add_acquire_read)
1422
# define AO_int_fetch_and_add_dd_acquire_read(addr, val) \
1423
AO_int_fetch_and_add_acquire_read(addr, val)
1424
# define AO_HAVE_int_fetch_and_add_dd_acquire_read
1427
# if defined(AO_HAVE_int_fetch_and_add)
1428
# define AO_int_fetch_and_add_dd_acquire_read(addr, val) \
1429
AO_int_fetch_and_add(addr, val)
1430
# define AO_HAVE_int_fetch_and_add_dd_acquire_read
1434
/* int_fetch_and_add1 */
1436
#if defined(AO_HAVE_int_fetch_and_add_full) &&\
1437
!defined(AO_HAVE_int_fetch_and_add1_full)
1438
# define AO_int_fetch_and_add1_full(addr) \
1439
AO_int_fetch_and_add_full(addr,1)
1440
# define AO_HAVE_int_fetch_and_add1_full
1442
#if defined(AO_HAVE_int_fetch_and_add_release) &&\
1443
!defined(AO_HAVE_int_fetch_and_add1_release)
1444
# define AO_int_fetch_and_add1_release(addr) \
1445
AO_int_fetch_and_add_release(addr,1)
1446
# define AO_HAVE_int_fetch_and_add1_release
1448
#if defined(AO_HAVE_int_fetch_and_add_acquire) &&\
1449
!defined(AO_HAVE_int_fetch_and_add1_acquire)
1450
# define AO_int_fetch_and_add1_acquire(addr) \
1451
AO_int_fetch_and_add_acquire(addr,1)
1452
# define AO_HAVE_int_fetch_and_add1_acquire
1454
#if defined(AO_HAVE_int_fetch_and_add_write) &&\
1455
!defined(AO_HAVE_int_fetch_and_add1_write)
1456
# define AO_int_fetch_and_add1_write(addr) \
1457
AO_int_fetch_and_add_write(addr,1)
1458
# define AO_HAVE_int_fetch_and_add1_write
1460
#if defined(AO_HAVE_int_fetch_and_add_read) &&\
1461
!defined(AO_HAVE_int_fetch_and_add1_read)
1462
# define AO_int_fetch_and_add1_read(addr) \
1463
AO_int_fetch_and_add_read(addr,1)
1464
# define AO_HAVE_int_fetch_and_add1_read
1466
#if defined(AO_HAVE_int_fetch_and_add_release_write) &&\
1467
!defined(AO_HAVE_int_fetch_and_add1_release_write)
1468
# define AO_int_fetch_and_add1_release_write(addr) \
1469
AO_int_fetch_and_add_release_write(addr,1)
1470
# define AO_HAVE_int_fetch_and_add1_release_write
1472
#if defined(AO_HAVE_int_fetch_and_add_acquire_read) &&\
1473
!defined(AO_HAVE_int_fetch_and_add1_acquire_read)
1474
# define AO_int_fetch_and_add1_acquire_read(addr) \
1475
AO_int_fetch_and_add_acquire_read(addr,1)
1476
# define AO_HAVE_int_fetch_and_add1_acquire_read
1478
#if defined(AO_HAVE_int_fetch_and_add) &&\
1479
!defined(AO_HAVE_int_fetch_and_add1)
1480
# define AO_int_fetch_and_add1(addr) \
1481
AO_int_fetch_and_add(addr,1)
1482
# define AO_HAVE_int_fetch_and_add1
1485
#if defined(AO_HAVE_int_fetch_and_add1_full)
1486
# if !defined(AO_HAVE_int_fetch_and_add1_release)
1487
# define AO_int_fetch_and_add1_release(addr) \
1488
AO_int_fetch_and_add1_full(addr)
1489
# define AO_HAVE_int_fetch_and_add1_release
1491
# if !defined(AO_HAVE_int_fetch_and_add1_acquire)
1492
# define AO_int_fetch_and_add1_acquire(addr) \
1493
AO_int_fetch_and_add1_full(addr)
1494
# define AO_HAVE_int_fetch_and_add1_acquire
1496
# if !defined(AO_HAVE_int_fetch_and_add1_write)
1497
# define AO_int_fetch_and_add1_write(addr) \
1498
AO_int_fetch_and_add1_full(addr)
1499
# define AO_HAVE_int_fetch_and_add1_write
1501
# if !defined(AO_HAVE_int_fetch_and_add1_read)
1502
# define AO_int_fetch_and_add1_read(addr) \
1503
AO_int_fetch_and_add1_full(addr)
1504
# define AO_HAVE_int_fetch_and_add1_read
1506
#endif /* AO_HAVE_int_fetch_and_add1_full */
1508
#if !defined(AO_HAVE_int_fetch_and_add1) && \
1509
defined(AO_HAVE_int_fetch_and_add1_release)
1510
# define AO_int_fetch_and_add1(addr) \
1511
AO_int_fetch_and_add1_release(addr)
1512
# define AO_HAVE_int_fetch_and_add1
1514
#if !defined(AO_HAVE_int_fetch_and_add1) && \
1515
defined(AO_HAVE_int_fetch_and_add1_acquire)
1516
# define AO_int_fetch_and_add1(addr) \
1517
AO_int_fetch_and_add1_acquire(addr)
1518
# define AO_HAVE_int_fetch_and_add1
1520
#if !defined(AO_HAVE_int_fetch_and_add1) && \
1521
defined(AO_HAVE_int_fetch_and_add1_write)
1522
# define AO_int_fetch_and_add1(addr) \
1523
AO_int_fetch_and_add1_write(addr)
1524
# define AO_HAVE_int_fetch_and_add1
1526
#if !defined(AO_HAVE_int_fetch_and_add1) && \
1527
defined(AO_HAVE_int_fetch_and_add1_read)
1528
# define AO_int_fetch_and_add1(addr) \
1529
AO_int_fetch_and_add1_read(addr)
1530
# define AO_HAVE_int_fetch_and_add1
1533
#if defined(AO_HAVE_int_fetch_and_add1_acquire) &&\
1534
defined(AO_HAVE_nop_full) && \
1535
!defined(AO_HAVE_int_fetch_and_add1_full)
1536
# define AO_int_fetch_and_add1_full(addr) \
1537
(AO_nop_full(), AO_int_fetch_and_add1_acquire(addr))
1538
# define AO_HAVE_int_fetch_and_add1_full
1541
#if !defined(AO_HAVE_int_fetch_and_add1_release_write) && \
1542
defined(AO_HAVE_int_fetch_and_add1_write)
1543
# define AO_int_fetch_and_add1_release_write(addr) \
1544
AO_int_fetch_and_add1_write(addr)
1545
# define AO_HAVE_int_fetch_and_add1_release_write
1547
#if !defined(AO_HAVE_int_fetch_and_add1_release_write) && \
1548
defined(AO_HAVE_int_fetch_and_add1_release)
1549
# define AO_int_fetch_and_add1_release_write(addr) \
1550
AO_int_fetch_and_add1_release(addr)
1551
# define AO_HAVE_int_fetch_and_add1_release_write
1553
#if !defined(AO_HAVE_int_fetch_and_add1_acquire_read) && \
1554
defined(AO_HAVE_int_fetch_and_add1_read)
1555
# define AO_int_fetch_and_add1_acquire_read(addr) \
1556
AO_int_fetch_and_add1_read(addr)
1557
# define AO_HAVE_int_fetch_and_add1_acquire_read
1559
#if !defined(AO_HAVE_int_fetch_and_add1_acquire_read) && \
1560
defined(AO_HAVE_int_fetch_and_add1_acquire)
1561
# define AO_int_fetch_and_add1_acquire_read(addr) \
1562
AO_int_fetch_and_add1_acquire(addr)
1563
# define AO_HAVE_int_fetch_and_add1_acquire_read
1566
#ifdef AO_NO_DD_ORDERING
1567
# if defined(AO_HAVE_int_fetch_and_add1_acquire_read)
1568
# define AO_int_fetch_and_add1_dd_acquire_read(addr) \
1569
AO_int_fetch_and_add1_acquire_read(addr)
1570
# define AO_HAVE_int_fetch_and_add1_dd_acquire_read
1573
# if defined(AO_HAVE_int_fetch_and_add1)
1574
# define AO_int_fetch_and_add1_dd_acquire_read(addr) \
1575
AO_int_fetch_and_add1(addr)
1576
# define AO_HAVE_int_fetch_and_add1_dd_acquire_read
1580
/* int_fetch_and_sub1 */
1582
#if defined(AO_HAVE_int_fetch_and_add_full) &&\
1583
!defined(AO_HAVE_int_fetch_and_sub1_full)
1584
# define AO_int_fetch_and_sub1_full(addr) \
1585
AO_int_fetch_and_add_full(addr,(unsigned int)(-1))
1586
# define AO_HAVE_int_fetch_and_sub1_full
1588
#if defined(AO_HAVE_int_fetch_and_add_release) &&\
1589
!defined(AO_HAVE_int_fetch_and_sub1_release)
1590
# define AO_int_fetch_and_sub1_release(addr) \
1591
AO_int_fetch_and_add_release(addr,(unsigned int)(-1))
1592
# define AO_HAVE_int_fetch_and_sub1_release
1594
#if defined(AO_HAVE_int_fetch_and_add_acquire) &&\
1595
!defined(AO_HAVE_int_fetch_and_sub1_acquire)
1596
# define AO_int_fetch_and_sub1_acquire(addr) \
1597
AO_int_fetch_and_add_acquire(addr,(unsigned int)(-1))
1598
# define AO_HAVE_int_fetch_and_sub1_acquire
1600
#if defined(AO_HAVE_int_fetch_and_add_write) &&\
1601
!defined(AO_HAVE_int_fetch_and_sub1_write)
1602
# define AO_int_fetch_and_sub1_write(addr) \
1603
AO_int_fetch_and_add_write(addr,(unsigned int)(-1))
1604
# define AO_HAVE_int_fetch_and_sub1_write
1606
#if defined(AO_HAVE_int_fetch_and_add_read) &&\
1607
!defined(AO_HAVE_int_fetch_and_sub1_read)
1608
# define AO_int_fetch_and_sub1_read(addr) \
1609
AO_int_fetch_and_add_read(addr,(unsigned int)(-1))
1610
# define AO_HAVE_int_fetch_and_sub1_read
1612
#if defined(AO_HAVE_int_fetch_and_add_release_write) &&\
1613
!defined(AO_HAVE_int_fetch_and_sub1_release_write)
1614
# define AO_int_fetch_and_sub1_release_write(addr) \
1615
AO_int_fetch_and_add_release_write(addr,(unsigned int)(-1))
1616
# define AO_HAVE_int_fetch_and_sub1_release_write
1618
#if defined(AO_HAVE_int_fetch_and_add_acquire_read) &&\
1619
!defined(AO_HAVE_int_fetch_and_sub1_acquire_read)
1620
# define AO_int_fetch_and_sub1_acquire_read(addr) \
1621
AO_int_fetch_and_add_acquire_read(addr,(unsigned int)(-1))
1622
# define AO_HAVE_int_fetch_and_sub1_acquire_read
1624
#if defined(AO_HAVE_int_fetch_and_add) &&\
1625
!defined(AO_HAVE_int_fetch_and_sub1)
1626
# define AO_int_fetch_and_sub1(addr) \
1627
AO_int_fetch_and_add(addr,(unsigned int)(-1))
1628
# define AO_HAVE_int_fetch_and_sub1
1631
#if defined(AO_HAVE_int_fetch_and_sub1_full)
1632
# if !defined(AO_HAVE_int_fetch_and_sub1_release)
1633
# define AO_int_fetch_and_sub1_release(addr) \
1634
AO_int_fetch_and_sub1_full(addr)
1635
# define AO_HAVE_int_fetch_and_sub1_release
1637
# if !defined(AO_HAVE_int_fetch_and_sub1_acquire)
1638
# define AO_int_fetch_and_sub1_acquire(addr) \
1639
AO_int_fetch_and_sub1_full(addr)
1640
# define AO_HAVE_int_fetch_and_sub1_acquire
1642
# if !defined(AO_HAVE_int_fetch_and_sub1_write)
1643
# define AO_int_fetch_and_sub1_write(addr) \
1644
AO_int_fetch_and_sub1_full(addr)
1645
# define AO_HAVE_int_fetch_and_sub1_write
1647
# if !defined(AO_HAVE_int_fetch_and_sub1_read)
1648
# define AO_int_fetch_and_sub1_read(addr) \
1649
AO_int_fetch_and_sub1_full(addr)
1650
# define AO_HAVE_int_fetch_and_sub1_read
1652
#endif /* AO_HAVE_int_fetch_and_sub1_full */
1654
#if !defined(AO_HAVE_int_fetch_and_sub1) && \
1655
defined(AO_HAVE_int_fetch_and_sub1_release)
1656
# define AO_int_fetch_and_sub1(addr) \
1657
AO_int_fetch_and_sub1_release(addr)
1658
# define AO_HAVE_int_fetch_and_sub1
1660
#if !defined(AO_HAVE_int_fetch_and_sub1) && \
1661
defined(AO_HAVE_int_fetch_and_sub1_acquire)
1662
# define AO_int_fetch_and_sub1(addr) \
1663
AO_int_fetch_and_sub1_acquire(addr)
1664
# define AO_HAVE_int_fetch_and_sub1
1666
#if !defined(AO_HAVE_int_fetch_and_sub1) && \
1667
defined(AO_HAVE_int_fetch_and_sub1_write)
1668
# define AO_int_fetch_and_sub1(addr) \
1669
AO_int_fetch_and_sub1_write(addr)
1670
# define AO_HAVE_int_fetch_and_sub1
1672
#if !defined(AO_HAVE_int_fetch_and_sub1) && \
1673
defined(AO_HAVE_int_fetch_and_sub1_read)
1674
# define AO_int_fetch_and_sub1(addr) \
1675
AO_int_fetch_and_sub1_read(addr)
1676
# define AO_HAVE_int_fetch_and_sub1
1679
#if defined(AO_HAVE_int_fetch_and_sub1_acquire) &&\
1680
defined(AO_HAVE_nop_full) && \
1681
!defined(AO_HAVE_int_fetch_and_sub1_full)
1682
# define AO_int_fetch_and_sub1_full(addr) \
1683
(AO_nop_full(), AO_int_fetch_and_sub1_acquire(addr))
1684
# define AO_HAVE_int_fetch_and_sub1_full
1687
#if !defined(AO_HAVE_int_fetch_and_sub1_release_write) && \
1688
defined(AO_HAVE_int_fetch_and_sub1_write)
1689
# define AO_int_fetch_and_sub1_release_write(addr) \
1690
AO_int_fetch_and_sub1_write(addr)
1691
# define AO_HAVE_int_fetch_and_sub1_release_write
1693
#if !defined(AO_HAVE_int_fetch_and_sub1_release_write) && \
1694
defined(AO_HAVE_int_fetch_and_sub1_release)
1695
# define AO_int_fetch_and_sub1_release_write(addr) \
1696
AO_int_fetch_and_sub1_release(addr)
1697
# define AO_HAVE_int_fetch_and_sub1_release_write
1699
#if !defined(AO_HAVE_int_fetch_and_sub1_acquire_read) && \
1700
defined(AO_HAVE_int_fetch_and_sub1_read)
1701
# define AO_int_fetch_and_sub1_acquire_read(addr) \
1702
AO_int_fetch_and_sub1_read(addr)
1703
# define AO_HAVE_int_fetch_and_sub1_acquire_read
1705
#if !defined(AO_HAVE_int_fetch_and_sub1_acquire_read) && \
1706
defined(AO_HAVE_int_fetch_and_sub1_acquire)
1707
# define AO_int_fetch_and_sub1_acquire_read(addr) \
1708
AO_int_fetch_and_sub1_acquire(addr)
1709
# define AO_HAVE_int_fetch_and_sub1_acquire_read
1712
#ifdef AO_NO_DD_ORDERING
1713
# if defined(AO_HAVE_int_fetch_and_sub1_acquire_read)
1714
# define AO_int_fetch_and_sub1_dd_acquire_read(addr) \
1715
AO_int_fetch_and_sub1_acquire_read(addr)
1716
# define AO_HAVE_int_fetch_and_sub1_dd_acquire_read
1719
# if defined(AO_HAVE_int_fetch_and_sub1)
1720
# define AO_int_fetch_and_sub1_dd_acquire_read(addr) \
1721
AO_int_fetch_and_sub1(addr)
1722
# define AO_HAVE_int_fetch_and_sub1_dd_acquire_read