PAPI 7.1.0.0
Loading...
Searching...
No Matches
common32_defs.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2003-2011 Hewlett-Packard Development Company, L.P.
3 * Copyright (c) 2009-2021 Ivan Maidanski
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 * SOFTWARE.
22 */
23
24/* This file contains AO primitives based on VC++ built-in intrinsic */
25/* functions commonly available across 32- and 64-bit architectures. */
26
27/* This file should be included from arch-specific header files. */
28/* Define AO_USE_INTERLOCKED_INTRINSICS if _Interlocked primitives */
29/* (used below) are available as intrinsic ones for a target arch */
30/* (otherwise "Interlocked" functions family is used instead). */
31/* Define AO_ASSUME_WINDOWS98 if CAS is available. */
32
33#if _MSC_VER <= 1400 || !defined(AO_USE_INTERLOCKED_INTRINSICS) \
34 || defined(_WIN32_WCE)
35# include <windows.h>
36 /* Seems like over-kill, but that's what MSDN recommends. */
37 /* And apparently winbase.h is not always self-contained. */
38 /* Optionally, client could define WIN32_LEAN_AND_MEAN before */
39 /* include atomic_ops.h to reduce amount of Windows internal */
40 /* headers included by windows.h one. */
41#endif
42
43#if _MSC_VER < 1310 || !defined(AO_USE_INTERLOCKED_INTRINSICS)
44
45# define _InterlockedIncrement InterlockedIncrement
46# define _InterlockedDecrement InterlockedDecrement
47# define _InterlockedExchangeAdd InterlockedExchangeAdd
48# define _InterlockedCompareExchange InterlockedCompareExchange
49
50# define AO_INTERLOCKED_VOLATILE
51
52#else /* elif _MSC_VER >= 1310 */
53
54# if _MSC_VER >= 1400
55# ifndef _WIN32_WCE
56# include <intrin.h>
57# endif
58
59# else /* elif _MSC_VER < 1400 */
60# ifdef __cplusplus
61 extern "C" {
62# endif
63 LONG __cdecl _InterlockedIncrement(LONG volatile *);
64 LONG __cdecl _InterlockedDecrement(LONG volatile *);
65 LONG __cdecl _InterlockedExchangeAdd(LONG volatile *, LONG);
66 LONG __cdecl _InterlockedCompareExchange(LONG volatile *,
67 LONG /* Exchange */, LONG /* Comp */);
68# ifdef __cplusplus
69 } /* extern "C" */
70# endif
71# endif /* _MSC_VER < 1400 */
72
73# if !defined(AO_PREFER_GENERALIZED) || !defined(AO_ASSUME_WINDOWS98)
74# pragma intrinsic (_InterlockedIncrement)
75# pragma intrinsic (_InterlockedDecrement)
76# pragma intrinsic (_InterlockedExchangeAdd)
77# ifndef AO_T_IS_INT
78# pragma intrinsic (_InterlockedIncrement64)
79# pragma intrinsic (_InterlockedDecrement64)
80# pragma intrinsic (_InterlockedExchangeAdd64)
81# endif
82# endif /* !AO_PREFER_GENERALIZED */
83
84# pragma intrinsic (_InterlockedCompareExchange)
85# ifndef AO_T_IS_INT
86# pragma intrinsic (_InterlockedCompareExchange64)
87# endif
88
89# define AO_INTERLOCKED_VOLATILE volatile
90
91#endif /* _MSC_VER >= 1310 */
92
93#if !defined(AO_PREFER_GENERALIZED) || !defined(AO_ASSUME_WINDOWS98)
95 AO_fetch_and_add_full(volatile AO_t *p, AO_t incr)
96 {
97# ifdef AO_T_IS_INT
99# else
100 return _InterlockedExchangeAdd64((__int64 volatile *)p, incr);
101# endif
102 }
103# define AO_HAVE_fetch_and_add_full
104
107 {
108# ifdef AO_T_IS_INT
110# else
111 return _InterlockedIncrement64((__int64 volatile *)p) - 1;
112# endif
113 }
114# define AO_HAVE_fetch_and_add1_full
115
118 {
119# ifdef AO_T_IS_INT
121# else
122 return _InterlockedDecrement64((__int64 volatile *)p) + 1;
123# endif
124 }
125# define AO_HAVE_fetch_and_sub1_full
126
127# ifndef AO_T_IS_INT
128 AO_INLINE unsigned int
129 AO_int_fetch_and_add_full(volatile unsigned int *p, unsigned int incr)
130 {
131 return _InterlockedExchangeAdd((long volatile *)p, incr);
132 }
133# define AO_HAVE_int_fetch_and_add_full
134
135 AO_INLINE unsigned int
136 AO_int_fetch_and_add1_full(volatile unsigned int *p)
137 {
138 return _InterlockedIncrement((long volatile *)p) - 1;
139 }
140# define AO_HAVE_int_fetch_and_add1_full
141
142 AO_INLINE unsigned int
143 AO_int_fetch_and_sub1_full(volatile unsigned int *p)
144 {
145 return _InterlockedDecrement((long volatile *)p) + 1;
146 }
147# define AO_HAVE_int_fetch_and_sub1_full
148# endif /* !AO_T_IS_INT */
149#endif /* !AO_PREFER_GENERALIZED */
150
151#ifdef AO_ASSUME_WINDOWS98
153 AO_fetch_compare_and_swap_full(volatile AO_t *addr, AO_t old_val,
154 AO_t new_val)
155 {
156# ifndef AO_T_IS_INT
157 return (AO_t)_InterlockedCompareExchange64((__int64 volatile *)addr,
158 new_val, old_val);
159# elif defined(AO_OLD_STYLE_INTERLOCKED_COMPARE_EXCHANGE)
161 (void *AO_INTERLOCKED_VOLATILE *)addr,
162 (void *)new_val, (void *)old_val);
163# else
165 new_val, old_val);
166# endif
167 }
168# define AO_HAVE_fetch_compare_and_swap_full
169
170# ifndef AO_T_IS_INT
171 AO_INLINE unsigned int
172 AO_int_fetch_compare_and_swap_full(volatile unsigned int *addr,
173 unsigned int old_val,
174 unsigned int new_val)
175 {
176 return _InterlockedCompareExchange((long volatile *)addr,
177 new_val, old_val);
178 }
179# define AO_HAVE_int_fetch_compare_and_swap_full
180# endif /* !AO_T_IS_INT */
181#endif /* AO_ASSUME_WINDOWS98 */
182
183#if (_MSC_VER > 1400) && (!defined(_M_ARM) || _MSC_VER >= 1800)
184
185# if _MSC_VER < 1800 || !defined(AO_PREFER_GENERALIZED)
186# pragma intrinsic (_InterlockedAnd8)
187# pragma intrinsic (_InterlockedOr8)
188# pragma intrinsic (_InterlockedXor8)
189
190 AO_INLINE void
191 AO_char_and_full(volatile unsigned char *p, unsigned char value)
192 {
193 _InterlockedAnd8((char volatile *)p, value);
194 }
195# define AO_HAVE_char_and_full
196
197 AO_INLINE void
198 AO_char_or_full(volatile unsigned char *p, unsigned char value)
199 {
200 _InterlockedOr8((char volatile *)p, value);
201 }
202# define AO_HAVE_char_or_full
203
204 AO_INLINE void
205 AO_char_xor_full(volatile unsigned char *p, unsigned char value)
206 {
207 _InterlockedXor8((char volatile *)p, value);
208 }
209# define AO_HAVE_char_xor_full
210# endif /* _MSC_VER < 1800 || !AO_PREFER_GENERALIZED */
211
212# pragma intrinsic (_InterlockedCompareExchange16)
213
214 AO_INLINE unsigned short
215 AO_short_fetch_compare_and_swap_full(volatile unsigned short *addr,
216 unsigned short old_val,
217 unsigned short new_val)
218 {
219 return _InterlockedCompareExchange16((short volatile *)addr,
220 new_val, old_val);
221 }
222# define AO_HAVE_short_fetch_compare_and_swap_full
223
224# ifndef AO_PREFER_GENERALIZED
225# pragma intrinsic (_InterlockedIncrement16)
226# pragma intrinsic (_InterlockedDecrement16)
227
228 AO_INLINE unsigned short
229 AO_short_fetch_and_add1_full(volatile unsigned short *p)
230 {
231 return _InterlockedIncrement16((short volatile *)p) - 1;
232 }
233# define AO_HAVE_short_fetch_and_add1_full
234
235 AO_INLINE unsigned short
236 AO_short_fetch_and_sub1_full(volatile unsigned short *p)
237 {
238 return _InterlockedDecrement16((short volatile *)p) + 1;
239 }
240# define AO_HAVE_short_fetch_and_sub1_full
241# endif /* !AO_PREFER_GENERALIZED */
242
243#endif /* _MSC_VER > 1400 */
244
245#if _MSC_VER >= 1800 /* Visual Studio 2013+ */
246
247# ifndef AO_PREFER_GENERALIZED
248# pragma intrinsic (_InterlockedAnd16)
249# pragma intrinsic (_InterlockedOr16)
250# pragma intrinsic (_InterlockedXor16)
251
252 AO_INLINE void
253 AO_short_and_full(volatile unsigned short *p, unsigned short value)
254 {
255 (void)_InterlockedAnd16((short volatile *)p, value);
256 }
257# define AO_HAVE_short_and_full
258
259 AO_INLINE void
260 AO_short_or_full(volatile unsigned short *p, unsigned short value)
261 {
262 (void)_InterlockedOr16((short volatile *)p, value);
263 }
264# define AO_HAVE_short_or_full
265
266 AO_INLINE void
267 AO_short_xor_full(volatile unsigned short *p, unsigned short value)
268 {
269 (void)_InterlockedXor16((short volatile *)p, value);
270 }
271# define AO_HAVE_short_xor_full
272
273# pragma intrinsic (_InterlockedAnd)
274# pragma intrinsic (_InterlockedOr)
275# pragma intrinsic (_InterlockedXor)
276
277# ifndef AO_T_IS_INT
278 AO_INLINE void
279 AO_int_and_full(volatile unsigned int *p, unsigned int value)
280 {
281 (void)_InterlockedAnd((long volatile *)p, value);
282 }
283# define AO_HAVE_int_and_full
284
285 AO_INLINE void
286 AO_int_or_full(volatile unsigned int *p, unsigned int value)
287 {
288 (void)_InterlockedOr((long volatile *)p, value);
289 }
290# define AO_HAVE_int_or_full
291
292 AO_INLINE void
293 AO_int_xor_full(volatile unsigned int *p, unsigned int value)
294 {
295 (void)_InterlockedXor((long volatile *)p, value);
296 }
297# define AO_HAVE_int_xor_full
298
299# pragma intrinsic (_InterlockedAnd64)
300# pragma intrinsic (_InterlockedOr64)
301# pragma intrinsic (_InterlockedXor64)
302# endif /* !AO_T_IS_INT */
303
304 AO_INLINE void
305 AO_and_full(volatile AO_t *p, AO_t value)
306 {
307# ifdef AO_T_IS_INT
308 (void)_InterlockedAnd((long volatile *)p, value);
309# else
310 (void)_InterlockedAnd64((__int64 volatile *)p, value);
311# endif
312 }
313# define AO_HAVE_and_full
314
315 AO_INLINE void
316 AO_or_full(volatile AO_t *p, AO_t value)
317 {
318# ifdef AO_T_IS_INT
319 (void)_InterlockedOr((long volatile *)p, value);
320# else
321 (void)_InterlockedOr64((__int64 volatile *)p, value);
322# endif
323 }
324# define AO_HAVE_or_full
325
326 AO_INLINE void
327 AO_xor_full(volatile AO_t *p, AO_t value)
328 {
329# ifdef AO_T_IS_INT
330 (void)_InterlockedXor((long volatile *)p, value);
331# else
332 (void)_InterlockedXor64((__int64 volatile *)p, value);
333# endif
334 }
335# define AO_HAVE_xor_full
336# endif /* !AO_PREFER_GENERALIZED */
337
338# if !defined(AO_PREFER_GENERALIZED) && (defined(_M_ARM) || defined(_M_ARM64))
339# pragma intrinsic (_InterlockedAnd8_acq)
340# pragma intrinsic (_InterlockedAnd8_nf)
341# pragma intrinsic (_InterlockedAnd8_rel)
342# pragma intrinsic (_InterlockedOr8_acq)
343# pragma intrinsic (_InterlockedOr8_nf)
344# pragma intrinsic (_InterlockedOr8_rel)
345# pragma intrinsic (_InterlockedXor8_acq)
346# pragma intrinsic (_InterlockedXor8_nf)
347# pragma intrinsic (_InterlockedXor8_rel)
348
349 AO_INLINE void
350 AO_char_and(volatile unsigned char *p, unsigned char value)
351 {
352 _InterlockedAnd8_nf((char volatile *)p, value);
353 }
354# define AO_HAVE_char_and
355
356 AO_INLINE void
357 AO_char_or(volatile unsigned char *p, unsigned char value)
358 {
359 _InterlockedOr8_nf((char volatile *)p, value);
360 }
361# define AO_HAVE_char_or
362
363 AO_INLINE void
364 AO_char_xor(volatile unsigned char *p, unsigned char value)
365 {
366 _InterlockedXor8_nf((char volatile *)p, value);
367 }
368# define AO_HAVE_char_xor
369
370 AO_INLINE void
371 AO_char_and_acquire(volatile unsigned char *p, unsigned char value)
372 {
373 _InterlockedAnd8_acq((char volatile *)p, value);
374 }
375# define AO_HAVE_char_and_acquire
376
377 AO_INLINE void
378 AO_char_or_acquire(volatile unsigned char *p, unsigned char value)
379 {
380 _InterlockedOr8_acq((char volatile *)p, value);
381 }
382# define AO_HAVE_char_or_acquire
383
384 AO_INLINE void
385 AO_char_xor_acquire(volatile unsigned char *p, unsigned char value)
386 {
387 _InterlockedXor8_acq((char volatile *)p, value);
388 }
389# define AO_HAVE_char_xor_acquire
390
391 AO_INLINE void
392 AO_char_and_release(volatile unsigned char *p, unsigned char value)
393 {
394 _InterlockedAnd8_rel((char volatile *)p, value);
395 }
396# define AO_HAVE_char_and_release
397
398 AO_INLINE void
399 AO_char_or_release(volatile unsigned char *p, unsigned char value)
400 {
401 _InterlockedOr8_rel((char volatile *)p, value);
402 }
403# define AO_HAVE_char_or_release
404
405 AO_INLINE void
406 AO_char_xor_release(volatile unsigned char *p, unsigned char value)
407 {
408 _InterlockedXor8_rel((char volatile *)p, value);
409 }
410# define AO_HAVE_char_xor_release
411
412# pragma intrinsic (_InterlockedAnd16_acq)
413# pragma intrinsic (_InterlockedAnd16_nf)
414# pragma intrinsic (_InterlockedAnd16_rel)
415# pragma intrinsic (_InterlockedOr16_acq)
416# pragma intrinsic (_InterlockedOr16_nf)
417# pragma intrinsic (_InterlockedOr16_rel)
418# pragma intrinsic (_InterlockedXor16_acq)
419# pragma intrinsic (_InterlockedXor16_nf)
420# pragma intrinsic (_InterlockedXor16_rel)
421
422 AO_INLINE void
423 AO_short_and(volatile unsigned short *p, unsigned short value)
424 {
425 (void)_InterlockedAnd16_nf((short volatile *)p, value);
426 }
427# define AO_HAVE_short_and
428
429 AO_INLINE void
430 AO_short_or(volatile unsigned short *p, unsigned short value)
431 {
432 (void)_InterlockedOr16_nf((short volatile *)p, value);
433 }
434# define AO_HAVE_short_or
435
436 AO_INLINE void
437 AO_short_xor(volatile unsigned short *p, unsigned short value)
438 {
439 (void)_InterlockedXor16_nf((short volatile *)p, value);
440 }
441# define AO_HAVE_short_xor
442
443 AO_INLINE void
444 AO_short_and_acquire(volatile unsigned short *p, unsigned short value)
445 {
446 (void)_InterlockedAnd16_acq((short volatile *)p, value);
447 }
448# define AO_HAVE_short_and_acquire
449
450 AO_INLINE void
451 AO_short_or_acquire(volatile unsigned short *p, unsigned short value)
452 {
453 (void)_InterlockedOr16_acq((short volatile *)p, value);
454 }
455# define AO_HAVE_short_or_acquire
456
457 AO_INLINE void
458 AO_short_xor_acquire(volatile unsigned short *p, unsigned short value)
459 {
460 (void)_InterlockedXor16_acq((short volatile *)p, value);
461 }
462# define AO_HAVE_short_xor_acquire
463
464 AO_INLINE void
465 AO_short_and_release(volatile unsigned short *p, unsigned short value)
466 {
467 (void)_InterlockedAnd16_rel((short volatile *)p, value);
468 }
469# define AO_HAVE_short_and_release
470
471 AO_INLINE void
472 AO_short_or_release(volatile unsigned short *p, unsigned short value)
473 {
474 (void)_InterlockedOr16_rel((short volatile *)p, value);
475 }
476# define AO_HAVE_short_or_release
477
478 AO_INLINE void
479 AO_short_xor_release(volatile unsigned short *p, unsigned short value)
480 {
481 (void)_InterlockedXor16_rel((short volatile *)p, value);
482 }
483# define AO_HAVE_short_xor_release
484
485# pragma intrinsic (_InterlockedAnd_acq)
486# pragma intrinsic (_InterlockedAnd_nf)
487# pragma intrinsic (_InterlockedAnd_rel)
488# pragma intrinsic (_InterlockedOr_acq)
489# pragma intrinsic (_InterlockedOr_nf)
490# pragma intrinsic (_InterlockedOr_rel)
491# pragma intrinsic (_InterlockedXor_acq)
492# pragma intrinsic (_InterlockedXor_nf)
493# pragma intrinsic (_InterlockedXor_rel)
494
495# ifndef AO_T_IS_INT
496 AO_INLINE void
497 AO_int_and(volatile unsigned int *p, unsigned int value)
498 {
499 (void)_InterlockedAnd_nf((long volatile *)p, value);
500 }
501# define AO_HAVE_int_and
502
503 AO_INLINE void
504 AO_int_or(volatile unsigned int *p, unsigned int value)
505 {
506 (void)_InterlockedOr_nf((long volatile *)p, value);
507 }
508# define AO_HAVE_int_or
509
510 AO_INLINE void
511 AO_int_xor(volatile unsigned int *p, unsigned int value)
512 {
513 (void)_InterlockedXor_nf((long volatile *)p, value);
514 }
515# define AO_HAVE_int_xor
516
517 AO_INLINE void
518 AO_int_and_acquire(volatile unsigned int *p, unsigned int value)
519 {
520 (void)_InterlockedAnd_acq((long volatile *)p, value);
521 }
522# define AO_HAVE_int_and_acquire
523
524 AO_INLINE void
525 AO_int_or_acquire(volatile unsigned int *p, unsigned int value)
526 {
527 (void)_InterlockedOr_acq((long volatile *)p, value);
528 }
529# define AO_HAVE_int_or_acquire
530
531 AO_INLINE void
532 AO_int_xor_acquire(volatile unsigned int *p, unsigned int value)
533 {
534 (void)_InterlockedXor_acq((long volatile *)p, value);
535 }
536# define AO_HAVE_int_xor_acquire
537
538 AO_INLINE void
539 AO_int_and_release(volatile unsigned int *p, unsigned int value)
540 {
541 (void)_InterlockedAnd_rel((long volatile *)p, value);
542 }
543# define AO_HAVE_int_and_release
544
545 AO_INLINE void
546 AO_int_or_release(volatile unsigned int *p, unsigned int value)
547 {
548 (void)_InterlockedOr_rel((long volatile *)p, value);
549 }
550# define AO_HAVE_int_or_release
551
552 AO_INLINE void
553 AO_int_xor_release(volatile unsigned int *p, unsigned int value)
554 {
555 (void)_InterlockedXor_rel((long volatile *)p, value);
556 }
557# define AO_HAVE_int_xor_release
558
559# pragma intrinsic (_InterlockedAnd64_acq)
560# pragma intrinsic (_InterlockedAnd64_nf)
561# pragma intrinsic (_InterlockedAnd64_rel)
562# pragma intrinsic (_InterlockedOr64_acq)
563# pragma intrinsic (_InterlockedOr64_nf)
564# pragma intrinsic (_InterlockedOr64_rel)
565# pragma intrinsic (_InterlockedXor64_acq)
566# pragma intrinsic (_InterlockedXor64_nf)
567# pragma intrinsic (_InterlockedXor64_rel)
568# endif /* !AO_T_IS_INT */
569
570 AO_INLINE void
571 AO_and(volatile AO_t *p, AO_t value)
572 {
573# ifdef AO_T_IS_INT
574 (void)_InterlockedAnd_nf((long volatile *)p, value);
575# else
576 (void)_InterlockedAnd64_nf((__int64 volatile *)p, value);
577# endif
578 }
579# define AO_HAVE_and
580
581 AO_INLINE void
582 AO_or(volatile AO_t *p, AO_t value)
583 {
584# ifdef AO_T_IS_INT
585 (void)_InterlockedOr_nf((long volatile *)p, value);
586# else
587 (void)_InterlockedOr64_nf((__int64 volatile *)p, value);
588# endif
589 }
590# define AO_HAVE_or
591
592 AO_INLINE void
593 AO_xor(volatile AO_t *p, AO_t value)
594 {
595# ifdef AO_T_IS_INT
596 (void)_InterlockedXor_nf((long volatile *)p, value);
597# else
598 (void)_InterlockedXor64_nf((__int64 volatile *)p, value);
599# endif
600 }
601# define AO_HAVE_xor
602
603 AO_INLINE void
604 AO_and_acquire(volatile AO_t *p, AO_t value)
605 {
606# ifdef AO_T_IS_INT
607 (void)_InterlockedAnd_acq((long volatile *)p, value);
608# else
609 (void)_InterlockedAnd64_acq((__int64 volatile *)p, value);
610# endif
611 }
612# define AO_HAVE_and_acquire
613
614 AO_INLINE void
615 AO_or_acquire(volatile AO_t *p, AO_t value)
616 {
617# ifdef AO_T_IS_INT
618 (void)_InterlockedOr_acq((long volatile *)p, value);
619# else
620 (void)_InterlockedOr64_acq((__int64 volatile *)p, value);
621# endif
622 }
623# define AO_HAVE_or_acquire
624
625 AO_INLINE void
626 AO_xor_acquire(volatile AO_t *p, AO_t value)
627 {
628# ifdef AO_T_IS_INT
629 (void)_InterlockedXor_acq((long volatile *)p, value);
630# else
631 (void)_InterlockedXor64_acq((__int64 volatile *)p, value);
632# endif
633 }
634# define AO_HAVE_xor_acquire
635
636 AO_INLINE void
637 AO_and_release(volatile AO_t *p, AO_t value)
638 {
639# ifdef AO_T_IS_INT
640 (void)_InterlockedAnd_rel((long volatile *)p, value);
641# else
642 (void)_InterlockedAnd64_rel((__int64 volatile *)p, value);
643# endif
644 }
645# define AO_HAVE_and_release
646
647 AO_INLINE void
648 AO_or_release(volatile AO_t *p, AO_t value)
649 {
650# ifdef AO_T_IS_INT
651 (void)_InterlockedOr_rel((long volatile *)p, value);
652# else
653 (void)_InterlockedOr64_rel((__int64 volatile *)p, value);
654# endif
655 }
656# define AO_HAVE_or_release
657
658 AO_INLINE void
659 AO_xor_release(volatile AO_t *p, AO_t value)
660 {
661# ifdef AO_T_IS_INT
662 (void)_InterlockedXor_rel((long volatile *)p, value);
663# else
664 (void)_InterlockedXor64_rel((__int64 volatile *)p, value);
665# endif
666 }
667# define AO_HAVE_xor_release
668
669# pragma intrinsic (_InterlockedDecrement16_acq)
670# pragma intrinsic (_InterlockedDecrement16_nf)
671# pragma intrinsic (_InterlockedDecrement16_rel)
672# pragma intrinsic (_InterlockedIncrement16_acq)
673# pragma intrinsic (_InterlockedIncrement16_nf)
674# pragma intrinsic (_InterlockedIncrement16_rel)
675
676 AO_INLINE unsigned short
677 AO_short_fetch_and_add1(volatile unsigned short *p)
678 {
679 return _InterlockedIncrement16_nf((short volatile *)p) - 1;
680 }
681# define AO_HAVE_short_fetch_and_add1
682
683 AO_INLINE unsigned short
684 AO_short_fetch_and_sub1(volatile unsigned short *p)
685 {
686 return _InterlockedDecrement16_nf((short volatile *)p) + 1;
687 }
688# define AO_HAVE_short_fetch_and_sub1
689
690 AO_INLINE unsigned short
691 AO_short_fetch_and_add1_acquire(volatile unsigned short *p)
692 {
693 return _InterlockedIncrement16_acq((short volatile *)p) - 1;
694 }
695# define AO_HAVE_short_fetch_and_add1_acquire
696
697 AO_INLINE unsigned short
698 AO_short_fetch_and_sub1_acquire(volatile unsigned short *p)
699 {
700 return _InterlockedDecrement16_acq((short volatile *)p) + 1;
701 }
702# define AO_HAVE_short_fetch_and_sub1_acquire
703
704 AO_INLINE unsigned short
705 AO_short_fetch_and_add1_release(volatile unsigned short *p)
706 {
707 return _InterlockedIncrement16_rel((short volatile *)p) - 1;
708 }
709# define AO_HAVE_short_fetch_and_add1_release
710
711 AO_INLINE unsigned short
712 AO_short_fetch_and_sub1_release(volatile unsigned short *p)
713 {
714 return _InterlockedDecrement16_rel((short volatile *)p) + 1;
715 }
716# define AO_HAVE_short_fetch_and_sub1_release
717
718# pragma intrinsic (_InterlockedExchangeAdd_acq)
719# pragma intrinsic (_InterlockedExchangeAdd_nf)
720# pragma intrinsic (_InterlockedExchangeAdd_rel)
721
722# pragma intrinsic (_InterlockedDecrement_acq)
723# pragma intrinsic (_InterlockedDecrement_nf)
724# pragma intrinsic (_InterlockedDecrement_rel)
725# pragma intrinsic (_InterlockedIncrement_acq)
726# pragma intrinsic (_InterlockedIncrement_nf)
727# pragma intrinsic (_InterlockedIncrement_rel)
728
729# ifndef AO_T_IS_INT
730# pragma intrinsic (_InterlockedExchangeAdd64_acq)
731# pragma intrinsic (_InterlockedExchangeAdd64_nf)
732# pragma intrinsic (_InterlockedExchangeAdd64_rel)
733
734# pragma intrinsic (_InterlockedDecrement64_acq)
735# pragma intrinsic (_InterlockedDecrement64_nf)
736# pragma intrinsic (_InterlockedDecrement64_rel)
737# pragma intrinsic (_InterlockedIncrement64_acq)
738# pragma intrinsic (_InterlockedIncrement64_nf)
739# pragma intrinsic (_InterlockedIncrement64_rel)
740# endif
741
743 AO_fetch_and_add(volatile AO_t *p, AO_t incr)
744 {
745# ifdef AO_T_IS_INT
746 return _InterlockedExchangeAdd_nf((long volatile *)p, incr);
747# else
748 return _InterlockedExchangeAdd64_nf((__int64 volatile *)p, incr);
749# endif
750 }
751# define AO_HAVE_fetch_and_add
752
754 AO_fetch_and_add1(volatile AO_t *p)
755 {
756# ifdef AO_T_IS_INT
757 return _InterlockedIncrement_nf((long volatile *)p) - 1;
758# else
759 return _InterlockedIncrement64_nf((__int64 volatile *)p) - 1;
760# endif
761 }
762# define AO_HAVE_fetch_and_add1
763
765 AO_fetch_and_sub1(volatile AO_t *p)
766 {
767# ifdef AO_T_IS_INT
768 return _InterlockedDecrement_nf((long volatile *)p) + 1;
769# else
770 return _InterlockedDecrement64_nf((__int64 volatile *)p) + 1;
771# endif
772 }
773# define AO_HAVE_fetch_and_sub1
774
776 AO_fetch_and_add_acquire(volatile AO_t *p, AO_t incr)
777 {
778# ifdef AO_T_IS_INT
779 return _InterlockedExchangeAdd_acq((long volatile *)p, incr);
780# else
781 return _InterlockedExchangeAdd64_acq((__int64 volatile *)p, incr);
782# endif
783 }
784# define AO_HAVE_fetch_and_add_acquire
785
788 {
789# ifdef AO_T_IS_INT
790 return _InterlockedIncrement_acq((long volatile *)p) - 1;
791# else
792 return _InterlockedIncrement64_acq((__int64 volatile *)p) - 1;
793# endif
794 }
795# define AO_HAVE_fetch_and_add1_acquire
796
799 {
800# ifdef AO_T_IS_INT
801 return _InterlockedDecrement_acq((long volatile *)p) + 1;
802# else
803 return _InterlockedDecrement64_acq((__int64 volatile *)p) + 1;
804# endif
805 }
806# define AO_HAVE_fetch_and_sub1_acquire
807
809 AO_fetch_and_add_release(volatile AO_t *p, AO_t incr)
810 {
811# ifdef AO_T_IS_INT
812 return _InterlockedExchangeAdd_rel((long volatile *)p, incr);
813# else
814 return _InterlockedExchangeAdd64_rel((__int64 volatile *)p, incr);
815# endif
816 }
817# define AO_HAVE_fetch_and_add_release
818
821 {
822# ifdef AO_T_IS_INT
823 return _InterlockedIncrement_rel((long volatile *)p) - 1;
824# else
825 return _InterlockedIncrement64_rel((__int64 volatile *)p) - 1;
826# endif
827 }
828# define AO_HAVE_fetch_and_add1_release
829
832 {
833# ifdef AO_T_IS_INT
834 return _InterlockedDecrement_rel((long volatile *)p) + 1;
835# else
836 return _InterlockedDecrement64_rel((__int64 volatile *)p) + 1;
837# endif
838 }
839# define AO_HAVE_fetch_and_sub1_release
840
841# ifndef AO_T_IS_INT
842 AO_INLINE unsigned int
843 AO_int_fetch_and_add(volatile unsigned int *p, unsigned int incr)
844 {
845 return _InterlockedExchangeAdd_nf((long volatile *)p, incr);
846 }
847# define AO_HAVE_int_fetch_and_add
848
849 AO_INLINE unsigned int
850 AO_int_fetch_and_add1(volatile unsigned int *p)
851 {
852 return _InterlockedIncrement_nf((long volatile *)p) - 1;
853 }
854# define AO_HAVE_int_fetch_and_add1
855
856 AO_INLINE unsigned int
857 AO_int_fetch_and_sub1(volatile unsigned int *p)
858 {
859 return _InterlockedDecrement_nf((long volatile *)p) + 1;
860 }
861# define AO_HAVE_int_fetch_and_sub1
862
863 AO_INLINE unsigned int
864 AO_int_fetch_and_add_acquire(volatile unsigned int *p,
865 unsigned int incr)
866 {
867 return _InterlockedExchangeAdd_acq((long volatile *)p, incr);
868 }
869# define AO_HAVE_int_fetch_and_add_acquire
870
871 AO_INLINE unsigned int
872 AO_int_fetch_and_add1_acquire(volatile unsigned int *p)
873 {
874 return _InterlockedIncrement_acq((long volatile *)p) - 1;
875 }
876# define AO_HAVE_int_fetch_and_add1_acquire
877
878 AO_INLINE unsigned int
879 AO_int_fetch_and_sub1_acquire(volatile unsigned int *p)
880 {
881 return _InterlockedDecrement_acq((long volatile *)p) + 1;
882 }
883# define AO_HAVE_int_fetch_and_sub1_acquire
884
885 AO_INLINE unsigned int
886 AO_int_fetch_and_add_release(volatile unsigned int *p,
887 unsigned int incr)
888 {
889 return _InterlockedExchangeAdd_rel((long volatile *)p, incr);
890 }
891# define AO_HAVE_int_fetch_and_add_release
892
893 AO_INLINE unsigned int
894 AO_int_fetch_and_add1_release(volatile unsigned int *p)
895 {
896 return _InterlockedIncrement_rel((long volatile *)p) - 1;
897 }
898# define AO_HAVE_int_fetch_and_add1_release
899
900 AO_INLINE unsigned int
901 AO_int_fetch_and_sub1_release(volatile unsigned int *p)
902 {
903 return _InterlockedDecrement_rel((long volatile *)p) + 1;
904 }
905# define AO_HAVE_int_fetch_and_sub1_release
906# endif /* !AO_T_IS_INT */
907
908# endif /* !AO_PREFER_GENERALIZED && (_M_ARM || _M_ARM64) */
909
910# pragma intrinsic (_InterlockedCompareExchange8)
911
912 AO_INLINE unsigned char
913 AO_char_fetch_compare_and_swap_full(volatile unsigned char *addr,
914 unsigned char old_val,
915 unsigned char new_val)
916 {
917 return _InterlockedCompareExchange8((char volatile *)addr,
918 new_val, old_val);
919 }
920# define AO_HAVE_char_fetch_compare_and_swap_full
921
922# if defined(_M_ARM) || defined(_M_ARM64)
923
924# pragma intrinsic (_InterlockedCompareExchange_acq)
925# pragma intrinsic (_InterlockedCompareExchange_nf)
926# pragma intrinsic (_InterlockedCompareExchange_rel)
927# ifndef AO_T_IS_INT
928# pragma intrinsic (_InterlockedCompareExchange64_acq)
929# pragma intrinsic (_InterlockedCompareExchange64_nf)
930# pragma intrinsic (_InterlockedCompareExchange64_rel)
931# endif
932
934 AO_fetch_compare_and_swap(volatile AO_t *addr, AO_t old_val, AO_t new_val)
935 {
936# ifdef AO_T_IS_INT
937 return _InterlockedCompareExchange_nf((long volatile *)addr,
938 new_val, old_val);
939# else
940 return (AO_t)_InterlockedCompareExchange64_nf(
941 (__int64 volatile *)addr, new_val, old_val);
942# endif
943 }
944# define AO_HAVE_fetch_compare_and_swap
945
947 AO_fetch_compare_and_swap_acquire(volatile AO_t *addr, AO_t old_val,
948 AO_t new_val)
949 {
950# ifdef AO_T_IS_INT
951 return _InterlockedCompareExchange_acq((long volatile *)addr,
952 new_val, old_val);
953# else
954 return (AO_t)_InterlockedCompareExchange64_acq(
955 (__int64 volatile *)addr, new_val, old_val);
956# endif
957 }
958# define AO_HAVE_fetch_compare_and_swap_acquire
959
961 AO_fetch_compare_and_swap_release(volatile AO_t *addr, AO_t old_val,
962 AO_t new_val)
963 {
964# ifdef AO_T_IS_INT
965 return _InterlockedCompareExchange_rel((long volatile *)addr,
966 new_val, old_val);
967# else
968 return (AO_t)_InterlockedCompareExchange64_rel(
969 (__int64 volatile *)addr, new_val, old_val);
970# endif
971 }
972# define AO_HAVE_fetch_compare_and_swap_release
973
974# ifndef AO_T_IS_INT
975 AO_INLINE unsigned int
976 AO_int_fetch_compare_and_swap(volatile unsigned int *addr,
977 unsigned int old_val,
978 unsigned int new_val)
979 {
980 return _InterlockedCompareExchange_nf((long volatile *)addr,
981 new_val, old_val);
982 }
983# define AO_HAVE_int_fetch_compare_and_swap
984
985 AO_INLINE unsigned int
986 AO_int_fetch_compare_and_swap_acquire(volatile unsigned int *addr,
987 unsigned int old_val,
988 unsigned int new_val)
989 {
990 return _InterlockedCompareExchange_acq((long volatile *)addr,
991 new_val, old_val);
992 }
993# define AO_HAVE_int_fetch_compare_and_swap_acquire
994
995 AO_INLINE unsigned int
996 AO_int_fetch_compare_and_swap_release(volatile unsigned int *addr,
997 unsigned int old_val,
998 unsigned int new_val)
999 {
1000 return _InterlockedCompareExchange_rel((long volatile *)addr,
1001 new_val, old_val);
1002 }
1003# define AO_HAVE_int_fetch_compare_and_swap_release
1004# endif /* !AO_T_IS_INT */
1005
1006# pragma intrinsic (_InterlockedCompareExchange16_acq)
1007# pragma intrinsic (_InterlockedCompareExchange16_nf)
1008# pragma intrinsic (_InterlockedCompareExchange16_rel)
1009# pragma intrinsic (_InterlockedCompareExchange8_acq)
1010# pragma intrinsic (_InterlockedCompareExchange8_nf)
1011# pragma intrinsic (_InterlockedCompareExchange8_rel)
1012
1013 AO_INLINE unsigned short
1014 AO_short_fetch_compare_and_swap(volatile unsigned short *addr,
1015 unsigned short old_val,
1016 unsigned short new_val)
1017 {
1018 return _InterlockedCompareExchange16_nf((short volatile *)addr,
1019 new_val, old_val);
1020 }
1021# define AO_HAVE_short_fetch_compare_and_swap
1022
1023 AO_INLINE unsigned short
1024 AO_short_fetch_compare_and_swap_acquire(volatile unsigned short *addr,
1025 unsigned short old_val,
1026 unsigned short new_val)
1027 {
1028 return _InterlockedCompareExchange16_acq((short volatile *)addr,
1029 new_val, old_val);
1030 }
1031# define AO_HAVE_short_fetch_compare_and_swap_acquire
1032
1033 AO_INLINE unsigned short
1034 AO_short_fetch_compare_and_swap_release(volatile unsigned short *addr,
1035 unsigned short old_val,
1036 unsigned short new_val)
1037 {
1038 return _InterlockedCompareExchange16_rel((short volatile *)addr,
1039 new_val, old_val);
1040 }
1041# define AO_HAVE_short_fetch_compare_and_swap_release
1042
1043 AO_INLINE unsigned char
1044 AO_char_fetch_compare_and_swap(volatile unsigned char *addr,
1045 unsigned char old_val,
1046 unsigned char new_val)
1047 {
1048 return _InterlockedCompareExchange8_nf((char volatile *)addr,
1049 new_val, old_val);
1050 }
1051# define AO_HAVE_char_fetch_compare_and_swap
1052
1053 AO_INLINE unsigned char
1054 AO_char_fetch_compare_and_swap_acquire(volatile unsigned char *addr,
1055 unsigned char old_val,
1056 unsigned char new_val)
1057 {
1058 return _InterlockedCompareExchange8_acq((char volatile *)addr,
1059 new_val, old_val);
1060 }
1061# define AO_HAVE_char_fetch_compare_and_swap_acquire
1062
1063 AO_INLINE unsigned char
1064 AO_char_fetch_compare_and_swap_release(volatile unsigned char *addr,
1065 unsigned char old_val,
1066 unsigned char new_val)
1067 {
1068 return _InterlockedCompareExchange8_rel((char volatile *)addr,
1069 new_val, old_val);
1070 }
1071# define AO_HAVE_char_fetch_compare_and_swap_release
1072# endif /* _M_ARM || _M_ARM64 */
1073
1074# if !defined(AO_PREFER_GENERALIZED) && !defined(_M_ARM)
1075# pragma intrinsic (_InterlockedExchangeAdd16)
1076# pragma intrinsic (_InterlockedExchangeAdd8)
1077
1078 AO_INLINE unsigned char
1079 AO_char_fetch_and_add_full(volatile unsigned char *p, unsigned char incr)
1080 {
1081 return _InterlockedExchangeAdd8((char volatile *)p, incr);
1082 }
1083# define AO_HAVE_char_fetch_and_add_full
1084
1085 AO_INLINE unsigned short
1086 AO_short_fetch_and_add_full(volatile unsigned short *p,
1087 unsigned short incr)
1088 {
1089 return _InterlockedExchangeAdd16((short volatile *)p, incr);
1090 }
1091# define AO_HAVE_short_fetch_and_add_full
1092
1093# if defined(_M_ARM64)
1094# pragma intrinsic (_InterlockedExchangeAdd16_acq)
1095# pragma intrinsic (_InterlockedExchangeAdd16_nf)
1096# pragma intrinsic (_InterlockedExchangeAdd16_rel)
1097# pragma intrinsic (_InterlockedExchangeAdd8_acq)
1098# pragma intrinsic (_InterlockedExchangeAdd8_nf)
1099# pragma intrinsic (_InterlockedExchangeAdd8_rel)
1100
1101 AO_INLINE unsigned char
1102 AO_char_fetch_and_add(volatile unsigned char *p, unsigned char incr)
1103 {
1104 return _InterlockedExchangeAdd8_nf((char volatile *)p, incr);
1105 }
1106# define AO_HAVE_char_fetch_and_add
1107
1108 AO_INLINE unsigned short
1109 AO_short_fetch_and_add(volatile unsigned short *p, unsigned short incr)
1110 {
1111 return _InterlockedExchangeAdd16_nf((short volatile *)p, incr);
1112 }
1113# define AO_HAVE_short_fetch_and_add
1114
1115 AO_INLINE unsigned char
1116 AO_char_fetch_and_add_acquire(volatile unsigned char *p,
1117 unsigned char incr)
1118 {
1119 return _InterlockedExchangeAdd8_acq((char volatile *)p, incr);
1120 }
1121# define AO_HAVE_char_fetch_and_add_acquire
1122
1123 AO_INLINE unsigned short
1124 AO_short_fetch_and_add_acquire(volatile unsigned short *p,
1125 unsigned short incr)
1126 {
1127 return _InterlockedExchangeAdd16_acq((short volatile *)p, incr);
1128 }
1129# define AO_HAVE_short_fetch_and_add_acquire
1130
1131 AO_INLINE unsigned char
1132 AO_char_fetch_and_add_release(volatile unsigned char *p,
1133 unsigned char incr)
1134 {
1135 return _InterlockedExchangeAdd8_rel((char volatile *)p, incr);
1136 }
1137# define AO_HAVE_char_fetch_and_add_release
1138
1139 AO_INLINE unsigned short
1140 AO_short_fetch_and_add_release(volatile unsigned short *p,
1141 unsigned short incr)
1142 {
1143 return _InterlockedExchangeAdd16_rel((short volatile *)p, incr);
1144 }
1145# define AO_HAVE_short_fetch_and_add_release
1146# endif /* _M_ARM64 */
1147
1148# endif /* !AO_PREFER_GENERALIZED && !_M_ARM */
1149
1150# if !defined(_M_ARM) || _M_ARM >= 6
1151# include "../test_and_set_t_is_char.h"
1152
1153# pragma intrinsic (_InterlockedExchange8)
1154
1156 AO_test_and_set_full(volatile AO_TS_t *addr)
1157 {
1158 return (AO_TS_VAL_t)(_InterlockedExchange8((char volatile *)addr,
1159 (AO_TS_t)AO_TS_SET) & 0xff);
1160 /* Note: bitwise "and 0xff" is applied to the result because cast */
1161 /* to unsigned char does not work properly (for a reason) if /J */
1162 /* option is passed to the MS VC compiler. */
1163 }
1164# define AO_HAVE_test_and_set_full
1165# endif /* !_M_ARM || _M_ARM >= 6 */
1166
1167# if _M_ARM >= 6 || defined(_M_ARM64)
1168# pragma intrinsic (_InterlockedExchange8_acq)
1169# pragma intrinsic (_InterlockedExchange8_nf)
1170# pragma intrinsic (_InterlockedExchange8_rel)
1171
1173 AO_test_and_set(volatile AO_TS_t *addr)
1174 {
1175 return (AO_TS_VAL_t)(_InterlockedExchange8_nf((char volatile *)addr,
1176 (AO_TS_t)AO_TS_SET) & 0xff);
1177 }
1178# define AO_HAVE_test_and_set
1179
1181 AO_test_and_set_acquire(volatile AO_TS_t *addr)
1182 {
1183 return (AO_TS_VAL_t)(_InterlockedExchange8_acq((char volatile *)addr,
1184 (AO_TS_t)AO_TS_SET) & 0xff);
1185 }
1186# define AO_HAVE_test_and_set_acquire
1187
1189 AO_test_and_set_release(volatile AO_TS_t *addr)
1190 {
1191 return (AO_TS_VAL_t)(_InterlockedExchange8_rel((char volatile *)addr,
1192 (AO_TS_t)AO_TS_SET) & 0xff);
1193 }
1194# define AO_HAVE_test_and_set_release
1195# endif /* _M_ARM >= 6 || _M_ARM64 */
1196
1197#endif /* _MSC_VER >= 1800 */
#define AO_t
Definition: atomic_ops.h:156
#define AO_INLINE
Definition: atomic_ops.h:186
AO_INLINE AO_TS_VAL_t AO_test_and_set_full(volatile AO_TS_t *addr)
Definition: avr32.h:33
AO_INLINE unsigned int AO_int_fetch_and_add_full(volatile unsigned int *p, unsigned int incr)
AO_INLINE AO_t AO_fetch_and_sub1_full(volatile AO_t *p)
AO_INLINE unsigned int AO_int_fetch_and_sub1_full(volatile unsigned int *p)
AO_INLINE AO_t AO_fetch_and_add_full(volatile AO_t *p, AO_t incr)
Definition: common32_defs.h:95
AO_INLINE AO_t AO_fetch_and_add1_full(volatile AO_t *p)
AO_INLINE unsigned int AO_int_fetch_and_add1_full(volatile unsigned int *p)
#define AO_INTERLOCKED_VOLATILE
Definition: common32_defs.h:50
#define _InterlockedCompareExchange
Definition: common32_defs.h:48
#define _InterlockedDecrement
Definition: common32_defs.h:46
#define _InterlockedIncrement
Definition: common32_defs.h:45
#define _InterlockedExchangeAdd
Definition: common32_defs.h:47
#define AO_fetch_compare_and_swap_full(addr, old, newval)
Definition: emul_cas.h:61
AO_INLINE void AO_and(volatile AO_t *p, AO_t value)
Definition: gcc/arm.h:410
AO_INLINE unsigned short AO_short_fetch_and_add(volatile unsigned short *p, unsigned short incr)
Definition: gcc/arm.h:502
AO_INLINE unsigned char AO_char_fetch_and_add(volatile unsigned char *p, unsigned char incr)
Definition: gcc/arm.h:478
AO_INLINE AO_t AO_fetch_and_add(volatile AO_t *p, AO_t incr)
Definition: gcc/arm.h:338
AO_INLINE AO_t AO_fetch_compare_and_swap(volatile AO_t *addr, AO_t old_val, AO_t new_val)
Definition: gcc/arm.h:559
AO_INLINE void AO_or(volatile AO_t *p, AO_t value)
Definition: gcc/arm.h:432
AO_INLINE AO_TS_VAL_t AO_test_and_set(volatile AO_TS_t *addr)
Definition: gcc/arm.h:314
AO_INLINE void AO_xor(volatile AO_t *p, AO_t value)
Definition: gcc/arm.h:454
AO_INLINE AO_t AO_fetch_and_sub1(volatile AO_t *p)
Definition: gcc/arm.h:386
AO_INLINE AO_t AO_fetch_and_add1(volatile AO_t *p)
Definition: gcc/arm.h:362
#define AO_TS_t
Definition: gcc/hppa.h:39
#define AO_TS_VAL_t
Definition: gcc/hppa.h:44
#define AO_TS_SET
Definition: gcc/hppa.h:46
AO_INLINE unsigned short AO_short_fetch_compare_and_swap_acquire(volatile unsigned short *addr, unsigned short old, unsigned short new_val)
Definition: gcc/ia64.h:173
AO_INLINE unsigned char AO_char_fetch_compare_and_swap_acquire(volatile unsigned char *addr, unsigned char old, unsigned char new_val)
Definition: gcc/ia64.h:145
AO_INLINE unsigned int AO_int_fetch_compare_and_swap_acquire(volatile unsigned int *addr, unsigned int old, unsigned int new_val)
Definition: gcc/ia64.h:254
AO_INLINE unsigned int AO_int_fetch_compare_and_swap_release(volatile unsigned int *addr, unsigned int old, unsigned int new_val)
Definition: gcc/ia64.h:267
AO_INLINE AO_t AO_fetch_and_add1_release(volatile AO_t *addr)
Definition: gcc/ia64.h:78
AO_INLINE unsigned int AO_int_fetch_and_sub1_release(volatile unsigned int *addr)
Definition: gcc/ia64.h:242
AO_INLINE unsigned int AO_int_fetch_and_add1_acquire(volatile unsigned int *addr)
Definition: gcc/ia64.h:209
AO_INLINE AO_t AO_fetch_compare_and_swap_release(volatile AO_t *addr, AO_t old, AO_t new_val)
Definition: gcc/ia64.h:130
AO_INLINE unsigned int AO_int_fetch_and_add1_release(volatile unsigned int *addr)
Definition: gcc/ia64.h:220
AO_INLINE unsigned int AO_int_fetch_and_sub1_acquire(volatile unsigned int *addr)
Definition: gcc/ia64.h:231
AO_INLINE AO_t AO_fetch_and_sub1_acquire(volatile AO_t *addr)
Definition: gcc/ia64.h:90
AO_INLINE AO_t AO_fetch_and_add1_acquire(volatile AO_t *addr)
Definition: gcc/ia64.h:66
AO_INLINE unsigned short AO_short_fetch_compare_and_swap_release(volatile unsigned short *addr, unsigned short old, unsigned short new_val)
Definition: gcc/ia64.h:187
AO_INLINE unsigned char AO_char_fetch_compare_and_swap_release(volatile unsigned char *addr, unsigned char old, unsigned char new_val)
Definition: gcc/ia64.h:159
AO_INLINE AO_t AO_fetch_and_sub1_release(volatile AO_t *addr)
Definition: gcc/ia64.h:102
AO_INLINE AO_t AO_fetch_compare_and_swap_acquire(volatile AO_t *addr, AO_t old, AO_t new_val)
Definition: gcc/ia64.h:115
AO_INLINE unsigned short AO_short_fetch_compare_and_swap_full(volatile unsigned short *addr, unsigned short old_val, unsigned short new_val)
Definition: gcc/x86.h:343
AO_INLINE unsigned char AO_char_fetch_compare_and_swap_full(volatile unsigned char *addr, unsigned char old_val, unsigned char new_val)
Definition: gcc/x86.h:323
AO_INLINE void AO_char_xor_release(volatile unsignedchar *addr, unsignedchar value)
AO_INLINE AO_t AO_fetch_and_add_release(volatile AO_t *addr, AO_t incr)
AO_INLINE void AO_short_xor(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE void AO_int_xor_acquire(volatile unsigned *addr, unsigned value)
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 void AO_char_and_acquire(volatile unsignedchar *addr, unsignedchar value)
AO_INLINE void AO_char_or_acquire(volatile unsignedchar *addr, unsignedchar value)
AO_INLINE unsigned char AO_char_fetch_and_add_release(volatile unsignedchar *addr, unsignedchar incr)
AO_INLINE void AO_int_and_acquire(volatile unsigned *addr, unsigned value)
AO_INLINE AO_t AO_fetch_and_add_acquire(volatile AO_t *addr, AO_t incr)
AO_INLINE void AO_char_xor_acquire(volatile unsignedchar *addr, unsignedchar value)
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 void AO_xor_acquire(volatile AO_t *addr, AO_t value)
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_or_release(volatile AO_t *addr, AO_t 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_char_and(volatile unsignedchar *addr, unsignedchar value)
AO_INLINE void AO_int_or(volatile unsigned *addr, unsigned 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_short_and_release(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE void AO_short_or_release(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE void AO_short_xor_acquire(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE void AO_int_or_acquire(volatile unsigned *addr, unsigned value)
AO_INLINE void AO_int_and_full(volatile unsigned *addr, unsigned value)
AO_INLINE void AO_short_and(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE void AO_char_or_release(volatile unsignedchar *addr, unsignedchar value)
AO_INLINE void AO_short_or_acquire(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE void AO_char_and_release(volatile unsignedchar *addr, unsignedchar value)
AO_INLINE void AO_or_full(volatile AO_t *addr, AO_t value)
AO_INLINE void AO_int_xor_release(volatile unsigned *addr, unsigned value)
AO_INLINE void AO_and_full(volatile AO_t *addr, AO_t value)
AO_INLINE void AO_xor_release(volatile AO_t *addr, AO_t value)
AO_INLINE void AO_char_or(volatile unsignedchar *addr, unsignedchar value)
AO_INLINE void AO_int_xor_full(volatile unsigned *addr, unsigned value)
AO_INLINE void AO_short_or(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE void AO_and_release(volatile AO_t *addr, AO_t value)
AO_INLINE void AO_char_xor(volatile unsignedchar *addr, unsignedchar value)
AO_INLINE void AO_int_and(volatile unsigned *addr, unsigned value)
AO_INLINE void AO_or_acquire(volatile AO_t *addr, AO_t 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_and_acquire(volatile AO_t *addr, AO_t value)
AO_INLINE void AO_xor_full(volatile AO_t *addr, AO_t value)
AO_INLINE void AO_short_xor_release(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE unsigned AO_int_fetch_and_add_acquire(volatile unsigned *addr, unsigned incr)
AO_INLINE void AO_short_and_acquire(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE void AO_int_or_release(volatile unsigned *addr, unsigned value)
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 void AO_int_and_release(volatile unsigned *addr, unsigned value)
AO_INLINE void AO_int_xor(volatile unsigned *addr, unsigned value)
AO_INLINE AO_TS_VAL_t AO_test_and_set_acquire(volatile AO_TS_t *addr)
Definition: generic.h:103
AO_INLINE AO_TS_VAL_t AO_test_and_set_release(volatile AO_TS_t *addr)
Definition: generic.h:110
AO_INLINE unsigned AO_int_fetch_compare_and_swap_full(volatile unsigned *addr, unsigned old_val, unsigned new_val)