1 #include "atomic_ops.h"
3 * Copyright (c) 2003 by Hewlett-Packard Company. All rights reserved.
5 * This file is covered by the GNU general public license, version 2.
6 * see doc/COPYING for details.
9 /* This generates a compilable program. But it is really meant to be */
10 /* be used only with cc -E, to inspect the expensions generated by */
13 /* The result will not link or run. */
15 void list_atomic(void)
17 AO_T val, newval = 0, oldval = 0;
21 # if defined(AO_HAVE_nop)
27 # if defined(AO_HAVE_load)
33 # if defined(AO_HAVE_store)
34 "AO_store(&val, newval):";
35 AO_store(&val, newval);
39 # if defined(AO_HAVE_test_and_set)
40 "AO_test_and_set(&ts):";
45 # if defined(AO_HAVE_fetch_and_add1)
46 "AO_fetch_and_add1(&val):";
47 AO_fetch_and_add1(&val);
49 "No AO_fetch_and_add1";
51 # if defined(AO_HAVE_fetch_and_sub1)
52 "AO_fetch_and_sub1(&val):";
53 AO_fetch_and_sub1(&val);
55 "No AO_fetch_and_sub1";
57 # if defined(AO_HAVE_fetch_and_add)
58 "AO_fetch_and_add(&val, incr):";
59 AO_fetch_and_add(&val, incr);
61 "No AO_fetch_and_add";
63 # if defined(AO_HAVE_compare_and_swap)
64 "AO_compare_and_swap(&val, oldval, newval):";
65 AO_compare_and_swap(&val, oldval, newval);
67 "No AO_compare_and_swap";
71 * Copyright (c) 2003 by Hewlett-Packard Company. All rights reserved.
73 * This file is covered by the GNU general public license, version 2.
74 * see doc/COPYING for details.
77 /* This generates a compilable program. But it is really meant to be */
78 /* be used only with cc -E, to inspect the expensions generated by */
81 /* The result will not link or run. */
83 void list_atomic_release(void)
85 AO_T val, newval = 0, oldval = 0;
89 # if defined(AO_HAVE_nop_release)
95 # if defined(AO_HAVE_load_release)
96 "AO_load_release(&val):";
97 AO_load_release(&val);
101 # if defined(AO_HAVE_store_release)
102 "AO_store_release(&val, newval):";
103 AO_store_release(&val, newval);
105 "No AO_store_release";
107 # if defined(AO_HAVE_test_and_set_release)
108 "AO_test_and_set_release(&ts):";
109 AO_test_and_set_release(&ts);
111 "No AO_test_and_set_release";
113 # if defined(AO_HAVE_fetch_and_add1_release)
114 "AO_fetch_and_add1_release(&val):";
115 AO_fetch_and_add1_release(&val);
117 "No AO_fetch_and_add1_release";
119 # if defined(AO_HAVE_fetch_and_sub1_release)
120 "AO_fetch_and_sub1_release(&val):";
121 AO_fetch_and_sub1_release(&val);
123 "No AO_fetch_and_sub1_release";
125 # if defined(AO_HAVE_fetch_and_add_release)
126 "AO_fetch_and_add_release(&val, incr):";
127 AO_fetch_and_add_release(&val, incr);
129 "No AO_fetch_and_add_release";
131 # if defined(AO_HAVE_compare_and_swap_release)
132 "AO_compare_and_swap_release(&val, oldval, newval):";
133 AO_compare_and_swap_release(&val, oldval, newval);
135 "No AO_compare_and_swap_release";
139 * Copyright (c) 2003 by Hewlett-Packard Company. All rights reserved.
141 * This file is covered by the GNU general public license, version 2.
142 * see doc/COPYING for details.
145 /* This generates a compilable program. But it is really meant to be */
146 /* be used only with cc -E, to inspect the expensions generated by */
149 /* The result will not link or run. */
151 void list_atomic_acquire(void)
153 AO_T val, newval = 0, oldval = 0;
157 # if defined(AO_HAVE_nop_acquire)
158 "AO_nop_acquire(): ";
163 # if defined(AO_HAVE_load_acquire)
164 "AO_load_acquire(&val):";
165 AO_load_acquire(&val);
167 "No AO_load_acquire";
169 # if defined(AO_HAVE_store_acquire)
170 "AO_store_acquire(&val, newval):";
171 AO_store_acquire(&val, newval);
173 "No AO_store_acquire";
175 # if defined(AO_HAVE_test_and_set_acquire)
176 "AO_test_and_set_acquire(&ts):";
177 AO_test_and_set_acquire(&ts);
179 "No AO_test_and_set_acquire";
181 # if defined(AO_HAVE_fetch_and_add1_acquire)
182 "AO_fetch_and_add1_acquire(&val):";
183 AO_fetch_and_add1_acquire(&val);
185 "No AO_fetch_and_add1_acquire";
187 # if defined(AO_HAVE_fetch_and_sub1_acquire)
188 "AO_fetch_and_sub1_acquire(&val):";
189 AO_fetch_and_sub1_acquire(&val);
191 "No AO_fetch_and_sub1_acquire";
193 # if defined(AO_HAVE_fetch_and_add_acquire)
194 "AO_fetch_and_add_acquire(&val, incr):";
195 AO_fetch_and_add_acquire(&val, incr);
197 "No AO_fetch_and_add_acquire";
199 # if defined(AO_HAVE_compare_and_swap_acquire)
200 "AO_compare_and_swap_acquire(&val, oldval, newval):";
201 AO_compare_and_swap_acquire(&val, oldval, newval);
203 "No AO_compare_and_swap_acquire";
207 * Copyright (c) 2003 by Hewlett-Packard Company. All rights reserved.
209 * This file is covered by the GNU general public license, version 2.
210 * see doc/COPYING for details.
213 /* This generates a compilable program. But it is really meant to be */
214 /* be used only with cc -E, to inspect the expensions generated by */
217 /* The result will not link or run. */
219 void list_atomic_read(void)
221 AO_T val, newval = 0, oldval = 0;
225 # if defined(AO_HAVE_nop_read)
231 # if defined(AO_HAVE_load_read)
232 "AO_load_read(&val):";
237 # if defined(AO_HAVE_store_read)
238 "AO_store_read(&val, newval):";
239 AO_store_read(&val, newval);
243 # if defined(AO_HAVE_test_and_set_read)
244 "AO_test_and_set_read(&ts):";
245 AO_test_and_set_read(&ts);
247 "No AO_test_and_set_read";
249 # if defined(AO_HAVE_fetch_and_add1_read)
250 "AO_fetch_and_add1_read(&val):";
251 AO_fetch_and_add1_read(&val);
253 "No AO_fetch_and_add1_read";
255 # if defined(AO_HAVE_fetch_and_sub1_read)
256 "AO_fetch_and_sub1_read(&val):";
257 AO_fetch_and_sub1_read(&val);
259 "No AO_fetch_and_sub1_read";
261 # if defined(AO_HAVE_fetch_and_add_read)
262 "AO_fetch_and_add_read(&val, incr):";
263 AO_fetch_and_add_read(&val, incr);
265 "No AO_fetch_and_add_read";
267 # if defined(AO_HAVE_compare_and_swap_read)
268 "AO_compare_and_swap_read(&val, oldval, newval):";
269 AO_compare_and_swap_read(&val, oldval, newval);
271 "No AO_compare_and_swap_read";
275 * Copyright (c) 2003 by Hewlett-Packard Company. All rights reserved.
277 * This file is covered by the GNU general public license, version 2.
278 * see doc/COPYING for details.
281 /* This generates a compilable program. But it is really meant to be */
282 /* be used only with cc -E, to inspect the expensions generated by */
285 /* The result will not link or run. */
287 void list_atomic_write(void)
289 AO_T val, newval = 0, oldval = 0;
293 # if defined(AO_HAVE_nop_write)
299 # if defined(AO_HAVE_load_write)
300 "AO_load_write(&val):";
305 # if defined(AO_HAVE_store_write)
306 "AO_store_write(&val, newval):";
307 AO_store_write(&val, newval);
311 # if defined(AO_HAVE_test_and_set_write)
312 "AO_test_and_set_write(&ts):";
313 AO_test_and_set_write(&ts);
315 "No AO_test_and_set_write";
317 # if defined(AO_HAVE_fetch_and_add1_write)
318 "AO_fetch_and_add1_write(&val):";
319 AO_fetch_and_add1_write(&val);
321 "No AO_fetch_and_add1_write";
323 # if defined(AO_HAVE_fetch_and_sub1_write)
324 "AO_fetch_and_sub1_write(&val):";
325 AO_fetch_and_sub1_write(&val);
327 "No AO_fetch_and_sub1_write";
329 # if defined(AO_HAVE_fetch_and_add_write)
330 "AO_fetch_and_add_write(&val, incr):";
331 AO_fetch_and_add_write(&val, incr);
333 "No AO_fetch_and_add_write";
335 # if defined(AO_HAVE_compare_and_swap_write)
336 "AO_compare_and_swap_write(&val, oldval, newval):";
337 AO_compare_and_swap_write(&val, oldval, newval);
339 "No AO_compare_and_swap_write";
343 * Copyright (c) 2003 by Hewlett-Packard Company. All rights reserved.
345 * This file is covered by the GNU general public license, version 2.
346 * see doc/COPYING for details.
349 /* This generates a compilable program. But it is really meant to be */
350 /* be used only with cc -E, to inspect the expensions generated by */
353 /* The result will not link or run. */
355 void list_atomic_full(void)
357 AO_T val, newval = 0, oldval = 0;
361 # if defined(AO_HAVE_nop_full)
367 # if defined(AO_HAVE_load_full)
368 "AO_load_full(&val):";
373 # if defined(AO_HAVE_store_full)
374 "AO_store_full(&val, newval):";
375 AO_store_full(&val, newval);
379 # if defined(AO_HAVE_test_and_set_full)
380 "AO_test_and_set_full(&ts):";
381 AO_test_and_set_full(&ts);
383 "No AO_test_and_set_full";
385 # if defined(AO_HAVE_fetch_and_add1_full)
386 "AO_fetch_and_add1_full(&val):";
387 AO_fetch_and_add1_full(&val);
389 "No AO_fetch_and_add1_full";
391 # if defined(AO_HAVE_fetch_and_sub1_full)
392 "AO_fetch_and_sub1_full(&val):";
393 AO_fetch_and_sub1_full(&val);
395 "No AO_fetch_and_sub1_full";
397 # if defined(AO_HAVE_fetch_and_add_full)
398 "AO_fetch_and_add_full(&val, incr):";
399 AO_fetch_and_add_full(&val, incr);
401 "No AO_fetch_and_add_full";
403 # if defined(AO_HAVE_compare_and_swap_full)
404 "AO_compare_and_swap_full(&val, oldval, newval):";
405 AO_compare_and_swap_full(&val, oldval, newval);
407 "No AO_compare_and_swap_full";
411 * Copyright (c) 2003 by Hewlett-Packard Company. All rights reserved.
413 * This file is covered by the GNU general public license, version 2.
414 * see doc/COPYING for details.
417 /* This generates a compilable program. But it is really meant to be */
418 /* be used only with cc -E, to inspect the expensions generated by */
421 /* The result will not link or run. */
423 void list_atomic_release_write(void)
425 AO_T val, newval = 0, oldval = 0;
429 # if defined(AO_HAVE_nop_release_write)
430 "AO_nop_release_write(): ";
431 AO_nop_release_write();
433 "No AO_nop_release_write";
435 # if defined(AO_HAVE_load_release_write)
436 "AO_load_release_write(&val):";
437 AO_load_release_write(&val);
439 "No AO_load_release_write";
441 # if defined(AO_HAVE_store_release_write)
442 "AO_store_release_write(&val, newval):";
443 AO_store_release_write(&val, newval);
445 "No AO_store_release_write";
447 # if defined(AO_HAVE_test_and_set_release_write)
448 "AO_test_and_set_release_write(&ts):";
449 AO_test_and_set_release_write(&ts);
451 "No AO_test_and_set_release_write";
453 # if defined(AO_HAVE_fetch_and_add1_release_write)
454 "AO_fetch_and_add1_release_write(&val):";
455 AO_fetch_and_add1_release_write(&val);
457 "No AO_fetch_and_add1_release_write";
459 # if defined(AO_HAVE_fetch_and_sub1_release_write)
460 "AO_fetch_and_sub1_release_write(&val):";
461 AO_fetch_and_sub1_release_write(&val);
463 "No AO_fetch_and_sub1_release_write";
465 # if defined(AO_HAVE_fetch_and_add_release_write)
466 "AO_fetch_and_add_release_write(&val, incr):";
467 AO_fetch_and_add_release_write(&val, incr);
469 "No AO_fetch_and_add_release_write";
471 # if defined(AO_HAVE_compare_and_swap_release_write)
472 "AO_compare_and_swap_release_write(&val, oldval, newval):";
473 AO_compare_and_swap_release_write(&val, oldval, newval);
475 "No AO_compare_and_swap_release_write";
479 * Copyright (c) 2003 by Hewlett-Packard Company. All rights reserved.
481 * This file is covered by the GNU general public license, version 2.
482 * see doc/COPYING for details.
485 /* This generates a compilable program. But it is really meant to be */
486 /* be used only with cc -E, to inspect the expensions generated by */
489 /* The result will not link or run. */
491 void list_atomic_acquire_read(void)
493 AO_T val, newval = 0, oldval = 0;
497 # if defined(AO_HAVE_nop_acquire_read)
498 "AO_nop_acquire_read(): ";
499 AO_nop_acquire_read();
501 "No AO_nop_acquire_read";
503 # if defined(AO_HAVE_load_acquire_read)
504 "AO_load_acquire_read(&val):";
505 AO_load_acquire_read(&val);
507 "No AO_load_acquire_read";
509 # if defined(AO_HAVE_store_acquire_read)
510 "AO_store_acquire_read(&val, newval):";
511 AO_store_acquire_read(&val, newval);
513 "No AO_store_acquire_read";
515 # if defined(AO_HAVE_test_and_set_acquire_read)
516 "AO_test_and_set_acquire_read(&ts):";
517 AO_test_and_set_acquire_read(&ts);
519 "No AO_test_and_set_acquire_read";
521 # if defined(AO_HAVE_fetch_and_add1_acquire_read)
522 "AO_fetch_and_add1_acquire_read(&val):";
523 AO_fetch_and_add1_acquire_read(&val);
525 "No AO_fetch_and_add1_acquire_read";
527 # if defined(AO_HAVE_fetch_and_sub1_acquire_read)
528 "AO_fetch_and_sub1_acquire_read(&val):";
529 AO_fetch_and_sub1_acquire_read(&val);
531 "No AO_fetch_and_sub1_acquire_read";
533 # if defined(AO_HAVE_fetch_and_add_acquire_read)
534 "AO_fetch_and_add_acquire_read(&val, incr):";
535 AO_fetch_and_add_acquire_read(&val, incr);
537 "No AO_fetch_and_add_acquire_read";
539 # if defined(AO_HAVE_compare_and_swap_acquire_read)
540 "AO_compare_and_swap_acquire_read(&val, oldval, newval):";
541 AO_compare_and_swap_acquire_read(&val, oldval, newval);
543 "No AO_compare_and_swap_acquire_read";