RTEMS
atomic.h
Go to the documentation of this file.
1 
9 /*
10  * COPYRIGHT (c) 2012-2013 Deng Hengyi.
11  *
12  * The license and distribution terms for this file may be
13  * found in the file LICENSE in this distribution or at
14  * http://www.rtems.org/license/LICENSE.
15  */
16 
17 #ifndef _RTEMS_SCORE_ATOMIC_H
18 #define _RTEMS_SCORE_ATOMIC_H
19 
20 #include <rtems/score/cpuatomic.h>
21 
37 typedef CPU_atomic_Uint Atomic_Uint;
38 
39 typedef CPU_atomic_Ulong Atomic_Ulong;
40 
41 typedef CPU_atomic_Uintptr Atomic_Uintptr;
42 
43 typedef CPU_atomic_Flag Atomic_Flag;
44 
45 typedef CPU_atomic_Order Atomic_Order;
46 
47 #define ATOMIC_ORDER_RELAXED CPU_ATOMIC_ORDER_RELAXED
48 
49 #define ATOMIC_ORDER_ACQUIRE CPU_ATOMIC_ORDER_ACQUIRE
50 
51 #define ATOMIC_ORDER_RELEASE CPU_ATOMIC_ORDER_RELEASE
52 
53 #define ATOMIC_ORDER_ACQ_REL CPU_ATOMIC_ORDER_ACQ_REL
54 
55 #define ATOMIC_ORDER_SEQ_CST CPU_ATOMIC_ORDER_SEQ_CST
56 
57 #define ATOMIC_INITIALIZER_UINT( value ) CPU_ATOMIC_INITIALIZER_UINT( value )
58 
59 #define ATOMIC_INITIALIZER_ULONG( value ) CPU_ATOMIC_INITIALIZER_ULONG( value )
60 
61 #define ATOMIC_INITIALIZER_UINTPTR( value ) CPU_ATOMIC_INITIALIZER_UINTPTR( value )
62 
63 #define ATOMIC_INITIALIZER_FLAG CPU_ATOMIC_INITIALIZER_FLAG
64 
65 #define _Atomic_Fence( order ) _CPU_atomic_Fence( order )
66 
67 #define _Atomic_Init_uint( obj, desired ) \
68  _CPU_atomic_Init_uint( obj, desired )
69 
70 #define _Atomic_Init_ulong( obj, desired ) \
71  _CPU_atomic_Init_ulong( obj, desired )
72 
73 #define _Atomic_Init_uintptr( obj, desired ) \
74  _CPU_atomic_Init_uintptr( obj, desired )
75 
76 #define _Atomic_Load_uint( obj, order ) \
77  _CPU_atomic_Load_uint( obj, order )
78 
79 #define _Atomic_Load_ulong( obj, order ) \
80  _CPU_atomic_Load_ulong( obj, order )
81 
82 #define _Atomic_Load_uintptr( obj, order ) \
83  _CPU_atomic_Load_uintptr( obj, order )
84 
85 #define _Atomic_Store_uint( obj, desr, order ) \
86  _CPU_atomic_Store_uint( obj, desr, order )
87 
88 #define _Atomic_Store_ulong( obj, desr, order ) \
89  _CPU_atomic_Store_ulong( obj, desr, order )
90 
91 #define _Atomic_Store_uintptr( obj, desr, order ) \
92  _CPU_atomic_Store_uintptr( obj, desr, order )
93 
94 #define _Atomic_Fetch_add_uint( obj, arg, order ) \
95  _CPU_atomic_Fetch_add_uint( obj, arg, order )
96 
97 #define _Atomic_Fetch_add_ulong( obj, arg, order ) \
98  _CPU_atomic_Fetch_add_ulong( obj, arg, order )
99 
100 #define _Atomic_Fetch_add_uintptr( obj, arg, order ) \
101  _CPU_atomic_Fetch_add_uintptr( obj, arg, order )
102 
103 #define _Atomic_Fetch_sub_uint( obj, arg, order ) \
104  _CPU_atomic_Fetch_sub_uint( obj, arg, order )
105 
106 #define _Atomic_Fetch_sub_ulong( obj, arg, order ) \
107  _CPU_atomic_Fetch_sub_ulong( obj, arg, order )
108 
109 #define _Atomic_Fetch_sub_uintptr( obj, arg, order ) \
110  _CPU_atomic_Fetch_sub_uintptr( obj, arg, order )
111 
112 #define _Atomic_Fetch_or_uint( obj, arg, order ) \
113  _CPU_atomic_Fetch_or_uint( obj, arg, order )
114 
115 #define _Atomic_Fetch_or_ulong( obj, arg, order ) \
116  _CPU_atomic_Fetch_or_ulong( obj, arg, order )
117 
118 #define _Atomic_Fetch_or_uintptr( obj, arg, order ) \
119  _CPU_atomic_Fetch_or_uintptr( obj, arg, order )
120 
121 #define _Atomic_Fetch_and_uint( obj, arg, order ) \
122  _CPU_atomic_Fetch_and_uint( obj, arg, order )
123 
124 #define _Atomic_Fetch_and_ulong( obj, arg, order ) \
125  _CPU_atomic_Fetch_and_ulong( obj, arg, order )
126 
127 #define _Atomic_Fetch_and_uintptr( obj, arg, order ) \
128  _CPU_atomic_Fetch_and_uintptr( obj, arg, order )
129 
130 #define _Atomic_Exchange_uint( obj, desr, order ) \
131  _CPU_atomic_Exchange_uint( obj, desr, order )
132 
133 #define _Atomic_Exchange_ulong( obj, desr, order ) \
134  _CPU_atomic_Exchange_ulong( obj, desr, order )
135 
136 #define _Atomic_Exchange_uintptr( obj, desr, order ) \
137  _CPU_atomic_Exchange_uintptr( obj, desr, order )
138 
139 #define _Atomic_Compare_exchange_uint( obj, expected, desired, succ, fail ) \
140  _CPU_atomic_Compare_exchange_uint( obj, expected, desired, succ, fail )
141 
142 #define _Atomic_Compare_exchange_ulong( obj, expected, desired, succ, fail ) \
143  _CPU_atomic_Compare_exchange_ulong( obj, expected, desired, succ, fail )
144 
145 #define _Atomic_Compare_exchange_uintptr( obj, expected, desired, succ, fail ) \
146  _CPU_atomic_Compare_exchange_uintptr( obj, expected, desired, succ, fail )
147 
148 #define _Atomic_Flag_clear( obj, order ) \
149  _CPU_atomic_Flag_clear( obj, order )
150 
151 #define _Atomic_Flag_test_and_set( obj, order ) \
152  _CPU_atomic_Flag_test_and_set( obj, order )
153 
156 #endif /* _RTEMS_SCORE_ATOMIC_H */