2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 2019 Andrew Turner
5 * Copyright (c) 2021 The FreeBSD Foundation
7 * This software was developed by SRI International and the University of
8 * Cambridge Computer Laboratory (Department of Computer Science and
9 * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the
10 * DARPA SSITH research programme.
12 * Portions of this software were written by Mark Johnston under sponsorship
13 * by the FreeBSD Foundation.
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
24 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 #ifndef _SYS_ATOMIC_SAN_H_
40 #define _SYS_ATOMIC_SAN_H_
42 #ifndef _MACHINE_ATOMIC_H_
43 #error do not include this header, use machine/atomic.h
46 #include <sys/types.h>
48 #define ATOMIC_SAN_FUNC_1(sp, op, name, type) \
49 void sp##_atomic_##op##_##name(volatile type *, type); \
50 void sp##_atomic_##op##_acq_##name(volatile type *, type); \
51 void sp##_atomic_##op##_rel_##name(volatile type *, type)
53 #define ATOMIC_SAN_CMPSET(sp, name, type) \
54 int sp##_atomic_cmpset_##name(volatile type *, type, type); \
55 int sp##_atomic_cmpset_acq_##name(volatile type *, type, type); \
56 int sp##_atomic_cmpset_rel_##name(volatile type *, type, type)
58 #define ATOMIC_SAN_FCMPSET(sp, name, type) \
59 int sp##_atomic_fcmpset_##name(volatile type *, type *, type); \
60 int sp##_atomic_fcmpset_acq_##name(volatile type *, type *, type); \
61 int sp##_atomic_fcmpset_rel_##name(volatile type *, type *, type)
63 #define ATOMIC_SAN_READ(sp, op, name, type) \
64 type sp##_atomic_##op##_##name(volatile type *, type)
66 #define ATOMIC_SAN_READANDCLEAR(sp, name, type) \
67 type sp##_atomic_readandclear_##name(volatile type *)
69 #define ATOMIC_SAN_LOAD(sp, name, type) \
70 type sp##_atomic_load_##name(volatile type *)
72 #define ATOMIC_SAN_LOAD_ACQ(sp, name, type) \
73 type sp##_atomic_load_acq_##name(volatile type *)
75 #define ATOMIC_SAN_STORE(sp, name, type) \
76 void sp##_atomic_store_##name(volatile type *, type)
78 #define ATOMIC_SAN_STORE_REL(sp, name, type) \
79 void sp##_atomic_store_rel_##name(volatile type *, type)
81 #define ATOMIC_SAN_TEST(sp, op, name, type) \
82 int sp##_atomic_##op##_##name(volatile type *, u_int); \
83 int sp##_atomic_##op##_acq_##name(volatile type *, u_int)
85 #define _ATOMIC_SAN_THREAD_FENCE(sp) \
86 void sp##_atomic_thread_fence_acq(void); \
87 void sp##_atomic_thread_fence_rel(void); \
88 void sp##_atomic_thread_fence_acq_rel(void); \
89 void sp##_atomic_thread_fence_seq_cst(void); \
90 void sp##_atomic_interrupt_fence(void)
92 #define ATOMIC_SAN_THREAD_FENCE(sp) \
93 _ATOMIC_SAN_THREAD_FENCE(sp)
95 #define ATOMIC_SAN_LOAD_STORE(sp, name, type) \
96 ATOMIC_SAN_LOAD(sp, name, type); \
97 ATOMIC_SAN_STORE(sp, name, type)
99 #define _ATOMIC_SAN_FUNCS(sp, name, type) \
100 ATOMIC_SAN_FUNC_1(sp, add, name, type); \
101 ATOMIC_SAN_FUNC_1(sp, clear, name, type); \
102 ATOMIC_SAN_CMPSET(sp, name, type); \
103 ATOMIC_SAN_FCMPSET(sp, name, type); \
104 ATOMIC_SAN_READ(sp, fetchadd, name, type); \
105 ATOMIC_SAN_LOAD(sp, name, type); \
106 ATOMIC_SAN_LOAD_ACQ(sp, name, type); \
107 ATOMIC_SAN_READANDCLEAR(sp, name, type); \
108 ATOMIC_SAN_FUNC_1(sp, set, name, type); \
109 ATOMIC_SAN_FUNC_1(sp, subtract, name, type); \
110 ATOMIC_SAN_STORE(sp, name, type); \
111 ATOMIC_SAN_STORE_REL(sp, name, type); \
112 ATOMIC_SAN_READ(sp, swap, name, type); \
113 ATOMIC_SAN_TEST(sp, testandclear, name, type); \
114 ATOMIC_SAN_TEST(sp, testandset, name, type)
116 #define ATOMIC_SAN_FUNCS(name, type) \
117 _ATOMIC_SAN_FUNCS(SAN_INTERCEPTOR_PREFIX, name, type)
119 ATOMIC_SAN_FUNCS(char, uint8_t);
120 ATOMIC_SAN_FUNCS(short, uint16_t);
121 ATOMIC_SAN_FUNCS(int, u_int);
122 ATOMIC_SAN_FUNCS(long, u_long);
123 ATOMIC_SAN_FUNCS(ptr, uintptr_t);
124 ATOMIC_SAN_FUNCS(8, uint8_t);
125 ATOMIC_SAN_FUNCS(16, uint16_t);
126 ATOMIC_SAN_FUNCS(32, uint32_t);
127 ATOMIC_SAN_FUNCS(64, uint64_t);
128 ATOMIC_SAN_LOAD_STORE(SAN_INTERCEPTOR_PREFIX, bool, bool);
129 ATOMIC_SAN_THREAD_FENCE(SAN_INTERCEPTOR_PREFIX);
134 * Redirect uses of an atomic(9) function to the sanitizer's interceptor.
135 * For instance, KASAN callers of atomic_add_char() will be redirected to
136 * kasan_atomic_add_char().
138 #define ATOMIC_SAN(func) \
139 __CONCAT(SAN_INTERCEPTOR_PREFIX, __CONCAT(_atomic_, func))
141 #define atomic_load_bool ATOMIC_SAN(load_bool)
142 #define atomic_store_bool ATOMIC_SAN(store_bool)
144 #define atomic_add_char ATOMIC_SAN(add_char)
145 #define atomic_add_acq_char ATOMIC_SAN(add_acq_char)
146 #define atomic_add_rel_char ATOMIC_SAN(add_rel_char)
147 #define atomic_clear_char ATOMIC_SAN(clear_char)
148 #define atomic_clear_acq_char ATOMIC_SAN(clear_acq_char)
149 #define atomic_clear_rel_char ATOMIC_SAN(clear_rel_char)
150 #define atomic_cmpset_char ATOMIC_SAN(cmpset_char)
151 #define atomic_cmpset_acq_char ATOMIC_SAN(cmpset_acq_char)
152 #define atomic_cmpset_rel_char ATOMIC_SAN(cmpset_rel_char)
153 #define atomic_fcmpset_char ATOMIC_SAN(fcmpset_char)
154 #define atomic_fcmpset_acq_char ATOMIC_SAN(fcmpset_acq_char)
155 #define atomic_fcmpset_rel_char ATOMIC_SAN(fcmpset_rel_char)
156 #define atomic_fetchadd_char ATOMIC_SAN(fetchadd_char)
157 #define atomic_load_char ATOMIC_SAN(load_char)
158 #define atomic_load_acq_char ATOMIC_SAN(load_acq_char)
159 #define atomic_readandclear_char ATOMIC_SAN(readandclear_char)
160 #define atomic_set_char ATOMIC_SAN(set_char)
161 #define atomic_set_acq_char ATOMIC_SAN(set_acq_char)
162 #define atomic_set_rel_char ATOMIC_SAN(set_rel_char)
163 #define atomic_subtract_char ATOMIC_SAN(subtract_char)
164 #define atomic_subtract_acq_char ATOMIC_SAN(subtract_acq_char)
165 #define atomic_subtract_rel_char ATOMIC_SAN(subtract_rel_char)
166 #define atomic_store_char ATOMIC_SAN(store_char)
167 #define atomic_store_rel_char ATOMIC_SAN(store_rel_char)
168 #define atomic_swap_char ATOMIC_SAN(swap_char)
169 #define atomic_testandclear_char ATOMIC_SAN(testandclear_char)
170 #define atomic_testandset_char ATOMIC_SAN(testandset_char)
172 #define atomic_add_short ATOMIC_SAN(add_short)
173 #define atomic_add_acq_short ATOMIC_SAN(add_acq_short)
174 #define atomic_add_rel_short ATOMIC_SAN(add_rel_short)
175 #define atomic_clear_short ATOMIC_SAN(clear_short)
176 #define atomic_clear_acq_short ATOMIC_SAN(clear_acq_short)
177 #define atomic_clear_rel_short ATOMIC_SAN(clear_rel_short)
178 #define atomic_cmpset_short ATOMIC_SAN(cmpset_short)
179 #define atomic_cmpset_acq_short ATOMIC_SAN(cmpset_acq_short)
180 #define atomic_cmpset_rel_short ATOMIC_SAN(cmpset_rel_short)
181 #define atomic_fcmpset_short ATOMIC_SAN(fcmpset_short)
182 #define atomic_fcmpset_acq_short ATOMIC_SAN(fcmpset_acq_short)
183 #define atomic_fcmpset_rel_short ATOMIC_SAN(fcmpset_rel_short)
184 #define atomic_fetchadd_short ATOMIC_SAN(fetchadd_short)
185 #define atomic_load_short ATOMIC_SAN(load_short)
186 #define atomic_load_acq_short ATOMIC_SAN(load_acq_short)
187 #define atomic_readandclear_short ATOMIC_SAN(readandclear_short)
188 #define atomic_set_short ATOMIC_SAN(set_short)
189 #define atomic_set_acq_short ATOMIC_SAN(set_acq_short)
190 #define atomic_set_rel_short ATOMIC_SAN(set_rel_short)
191 #define atomic_subtract_short ATOMIC_SAN(subtract_short)
192 #define atomic_subtract_acq_short ATOMIC_SAN(subtract_acq_short)
193 #define atomic_subtract_rel_short ATOMIC_SAN(subtract_rel_short)
194 #define atomic_store_short ATOMIC_SAN(store_short)
195 #define atomic_store_rel_short ATOMIC_SAN(store_rel_short)
196 #define atomic_swap_short ATOMIC_SAN(swap_short)
197 #define atomic_testandclear_short ATOMIC_SAN(testandclear_short)
198 #define atomic_testandset_short ATOMIC_SAN(testandset_short)
200 #define atomic_add_int ATOMIC_SAN(add_int)
201 #define atomic_add_acq_int ATOMIC_SAN(add_acq_int)
202 #define atomic_add_rel_int ATOMIC_SAN(add_rel_int)
203 #define atomic_clear_int ATOMIC_SAN(clear_int)
204 #define atomic_clear_acq_int ATOMIC_SAN(clear_acq_int)
205 #define atomic_clear_rel_int ATOMIC_SAN(clear_rel_int)
206 #define atomic_cmpset_int ATOMIC_SAN(cmpset_int)
207 #define atomic_cmpset_acq_int ATOMIC_SAN(cmpset_acq_int)
208 #define atomic_cmpset_rel_int ATOMIC_SAN(cmpset_rel_int)
209 #define atomic_fcmpset_int ATOMIC_SAN(fcmpset_int)
210 #define atomic_fcmpset_acq_int ATOMIC_SAN(fcmpset_acq_int)
211 #define atomic_fcmpset_rel_int ATOMIC_SAN(fcmpset_rel_int)
212 #define atomic_fetchadd_int ATOMIC_SAN(fetchadd_int)
213 #define atomic_load_int ATOMIC_SAN(load_int)
214 #define atomic_load_acq_int ATOMIC_SAN(load_acq_int)
215 #define atomic_readandclear_int ATOMIC_SAN(readandclear_int)
216 #define atomic_set_int ATOMIC_SAN(set_int)
217 #define atomic_set_acq_int ATOMIC_SAN(set_acq_int)
218 #define atomic_set_rel_int ATOMIC_SAN(set_rel_int)
219 #define atomic_subtract_int ATOMIC_SAN(subtract_int)
220 #define atomic_subtract_acq_int ATOMIC_SAN(subtract_acq_int)
221 #define atomic_subtract_rel_int ATOMIC_SAN(subtract_rel_int)
222 #define atomic_store_int ATOMIC_SAN(store_int)
223 #define atomic_store_rel_int ATOMIC_SAN(store_rel_int)
224 #define atomic_swap_int ATOMIC_SAN(swap_int)
225 #define atomic_testandclear_int ATOMIC_SAN(testandclear_int)
226 #define atomic_testandset_int ATOMIC_SAN(testandset_int)
228 #define atomic_add_long ATOMIC_SAN(add_long)
229 #define atomic_add_acq_long ATOMIC_SAN(add_acq_long)
230 #define atomic_add_rel_long ATOMIC_SAN(add_rel_long)
231 #define atomic_clear_long ATOMIC_SAN(clear_long)
232 #define atomic_clear_acq_long ATOMIC_SAN(clear_acq_long)
233 #define atomic_clear_rel_long ATOMIC_SAN(clear_rel_long)
234 #define atomic_cmpset_long ATOMIC_SAN(cmpset_long)
235 #define atomic_cmpset_acq_long ATOMIC_SAN(cmpset_acq_long)
236 #define atomic_cmpset_rel_long ATOMIC_SAN(cmpset_rel_long)
237 #define atomic_fcmpset_long ATOMIC_SAN(fcmpset_long)
238 #define atomic_fcmpset_acq_long ATOMIC_SAN(fcmpset_acq_long)
239 #define atomic_fcmpset_rel_long ATOMIC_SAN(fcmpset_rel_long)
240 #define atomic_fetchadd_long ATOMIC_SAN(fetchadd_long)
241 #define atomic_load_long ATOMIC_SAN(load_long)
242 #define atomic_load_acq_long ATOMIC_SAN(load_acq_long)
243 #define atomic_readandclear_long ATOMIC_SAN(readandclear_long)
244 #define atomic_set_long ATOMIC_SAN(set_long)
245 #define atomic_set_acq_long ATOMIC_SAN(set_acq_long)
246 #define atomic_set_rel_long ATOMIC_SAN(set_rel_long)
247 #define atomic_subtract_long ATOMIC_SAN(subtract_long)
248 #define atomic_subtract_acq_long ATOMIC_SAN(subtract_acq_long)
249 #define atomic_subtract_rel_long ATOMIC_SAN(subtract_rel_long)
250 #define atomic_store_long ATOMIC_SAN(store_long)
251 #define atomic_store_rel_long ATOMIC_SAN(store_rel_long)
252 #define atomic_swap_long ATOMIC_SAN(swap_long)
253 #define atomic_testandclear_long ATOMIC_SAN(testandclear_long)
254 #define atomic_testandset_long ATOMIC_SAN(testandset_long)
255 #define atomic_testandset_acq_long ATOMIC_SAN(testandset_acq_long)
257 #define atomic_add_ptr ATOMIC_SAN(add_ptr)
258 #define atomic_add_acq_ptr ATOMIC_SAN(add_acq_ptr)
259 #define atomic_add_rel_ptr ATOMIC_SAN(add_rel_ptr)
260 #define atomic_clear_ptr ATOMIC_SAN(clear_ptr)
261 #define atomic_clear_acq_ptr ATOMIC_SAN(clear_acq_ptr)
262 #define atomic_clear_rel_ptr ATOMIC_SAN(clear_rel_ptr)
263 #define atomic_cmpset_ptr ATOMIC_SAN(cmpset_ptr)
264 #define atomic_cmpset_acq_ptr ATOMIC_SAN(cmpset_acq_ptr)
265 #define atomic_cmpset_rel_ptr ATOMIC_SAN(cmpset_rel_ptr)
266 #define atomic_fcmpset_ptr ATOMIC_SAN(fcmpset_ptr)
267 #define atomic_fcmpset_acq_ptr ATOMIC_SAN(fcmpset_acq_ptr)
268 #define atomic_fcmpset_rel_ptr ATOMIC_SAN(fcmpset_rel_ptr)
269 #define atomic_fetchadd_ptr ATOMIC_SAN(fetchadd_ptr)
270 #define atomic_load_ptr(x) \
271 ((void *)ATOMIC_SAN(load_ptr)(__DECONST(volatile uintptr_t *, (x))))
272 #define atomic_load_acq_ptr ATOMIC_SAN(load_acq_ptr)
273 #define atomic_load_consume_ptr(x) \
274 ((void *)atomic_load_acq_ptr((volatile uintptr_t *)(x)))
275 #define atomic_readandclear_ptr ATOMIC_SAN(readandclear_ptr)
276 #define atomic_set_ptr ATOMIC_SAN(set_ptr)
277 #define atomic_set_acq_ptr ATOMIC_SAN(set_acq_ptr)
278 #define atomic_set_rel_ptr ATOMIC_SAN(set_rel_ptr)
279 #define atomic_subtract_ptr ATOMIC_SAN(subtract_ptr)
280 #define atomic_subtract_acq_ptr ATOMIC_SAN(subtract_acq_ptr)
281 #define atomic_subtract_rel_ptr ATOMIC_SAN(subtract_rel_ptr)
282 #define atomic_store_ptr(x, v) ({ \
283 __typeof(*x) __value = (v); \
284 ATOMIC_SAN(store_ptr)((volatile uintptr_t *)(x), (uintptr_t)(__value));\
286 #define atomic_store_rel_ptr ATOMIC_SAN(store_rel_ptr)
287 #define atomic_swap_ptr ATOMIC_SAN(swap_ptr)
288 #define atomic_testandclear_ptr ATOMIC_SAN(testandclear_ptr)
289 #define atomic_testandset_ptr ATOMIC_SAN(testandset_ptr)
291 #define atomic_add_8 ATOMIC_SAN(add_8)
292 #define atomic_add_acq_8 ATOMIC_SAN(add_acq_8)
293 #define atomic_add_rel_8 ATOMIC_SAN(add_rel_8)
294 #define atomic_clear_8 ATOMIC_SAN(clear_8)
295 #define atomic_clear_acq_8 ATOMIC_SAN(clear_acq_8)
296 #define atomic_clear_rel_8 ATOMIC_SAN(clear_rel_8)
297 #define atomic_cmpset_8 ATOMIC_SAN(cmpset_8)
298 #define atomic_cmpset_acq_8 ATOMIC_SAN(cmpset_acq_8)
299 #define atomic_cmpset_rel_8 ATOMIC_SAN(cmpset_rel_8)
300 #define atomic_fcmpset_8 ATOMIC_SAN(fcmpset_8)
301 #define atomic_fcmpset_acq_8 ATOMIC_SAN(fcmpset_acq_8)
302 #define atomic_fcmpset_rel_8 ATOMIC_SAN(fcmpset_rel_8)
303 #define atomic_fetchadd_8 ATOMIC_SAN(fetchadd_8)
304 #define atomic_load_8 ATOMIC_SAN(load_8)
305 #define atomic_load_acq_8 ATOMIC_SAN(load_acq_8)
306 #define atomic_readandclear_8 ATOMIC_SAN(readandclear_8)
307 #define atomic_set_8 ATOMIC_SAN(set_8)
308 #define atomic_set_acq_8 ATOMIC_SAN(set_acq_8)
309 #define atomic_set_rel_8 ATOMIC_SAN(set_rel_8)
310 #define atomic_subtract_8 ATOMIC_SAN(subtract_8)
311 #define atomic_subtract_acq_8 ATOMIC_SAN(subtract_acq_8)
312 #define atomic_subtract_rel_8 ATOMIC_SAN(subtract_rel_8)
313 #define atomic_store_8 ATOMIC_SAN(store_8)
314 #define atomic_store_rel_8 ATOMIC_SAN(store_rel_8)
315 #define atomic_swap_8 ATOMIC_SAN(swap_8)
316 #define atomic_testandclear_8 ATOMIC_SAN(testandclear_8)
317 #define atomic_testandset_8 ATOMIC_SAN(testandset_8)
319 #define atomic_add_16 ATOMIC_SAN(add_16)
320 #define atomic_add_acq_16 ATOMIC_SAN(add_acq_16)
321 #define atomic_add_rel_16 ATOMIC_SAN(add_rel_16)
322 #define atomic_clear_16 ATOMIC_SAN(clear_16)
323 #define atomic_clear_acq_16 ATOMIC_SAN(clear_acq_16)
324 #define atomic_clear_rel_16 ATOMIC_SAN(clear_rel_16)
325 #define atomic_cmpset_16 ATOMIC_SAN(cmpset_16)
326 #define atomic_cmpset_acq_16 ATOMIC_SAN(cmpset_acq_16)
327 #define atomic_cmpset_rel_16 ATOMIC_SAN(cmpset_rel_16)
328 #define atomic_fcmpset_16 ATOMIC_SAN(fcmpset_16)
329 #define atomic_fcmpset_acq_16 ATOMIC_SAN(fcmpset_acq_16)
330 #define atomic_fcmpset_rel_16 ATOMIC_SAN(fcmpset_rel_16)
331 #define atomic_fetchadd_16 ATOMIC_SAN(fetchadd_16)
332 #define atomic_load_16 ATOMIC_SAN(load_16)
333 #define atomic_load_acq_16 ATOMIC_SAN(load_acq_16)
334 #define atomic_readandclear_16 ATOMIC_SAN(readandclear_16)
335 #define atomic_set_16 ATOMIC_SAN(set_16)
336 #define atomic_set_acq_16 ATOMIC_SAN(set_acq_16)
337 #define atomic_set_rel_16 ATOMIC_SAN(set_rel_16)
338 #define atomic_subtract_16 ATOMIC_SAN(subtract_16)
339 #define atomic_subtract_acq_16 ATOMIC_SAN(subtract_acq_16)
340 #define atomic_subtract_rel_16 ATOMIC_SAN(subtract_rel_16)
341 #define atomic_store_16 ATOMIC_SAN(store_16)
342 #define atomic_store_rel_16 ATOMIC_SAN(store_rel_16)
343 #define atomic_swap_16 ATOMIC_SAN(swap_16)
344 #define atomic_testandclear_16 ATOMIC_SAN(testandclear_16)
345 #define atomic_testandset_16 ATOMIC_SAN(testandset_16)
347 #define atomic_add_32 ATOMIC_SAN(add_32)
348 #define atomic_add_acq_32 ATOMIC_SAN(add_acq_32)
349 #define atomic_add_rel_32 ATOMIC_SAN(add_rel_32)
350 #define atomic_clear_32 ATOMIC_SAN(clear_32)
351 #define atomic_clear_acq_32 ATOMIC_SAN(clear_acq_32)
352 #define atomic_clear_rel_32 ATOMIC_SAN(clear_rel_32)
353 #define atomic_cmpset_32 ATOMIC_SAN(cmpset_32)
354 #define atomic_cmpset_acq_32 ATOMIC_SAN(cmpset_acq_32)
355 #define atomic_cmpset_rel_32 ATOMIC_SAN(cmpset_rel_32)
356 #define atomic_fcmpset_32 ATOMIC_SAN(fcmpset_32)
357 #define atomic_fcmpset_acq_32 ATOMIC_SAN(fcmpset_acq_32)
358 #define atomic_fcmpset_rel_32 ATOMIC_SAN(fcmpset_rel_32)
359 #define atomic_fetchadd_32 ATOMIC_SAN(fetchadd_32)
360 #define atomic_load_32 ATOMIC_SAN(load_32)
361 #define atomic_load_acq_32 ATOMIC_SAN(load_acq_32)
362 #define atomic_readandclear_32 ATOMIC_SAN(readandclear_32)
363 #define atomic_set_32 ATOMIC_SAN(set_32)
364 #define atomic_set_acq_32 ATOMIC_SAN(set_acq_32)
365 #define atomic_set_rel_32 ATOMIC_SAN(set_rel_32)
366 #define atomic_subtract_32 ATOMIC_SAN(subtract_32)
367 #define atomic_subtract_acq_32 ATOMIC_SAN(subtract_acq_32)
368 #define atomic_subtract_rel_32 ATOMIC_SAN(subtract_rel_32)
369 #define atomic_store_32 ATOMIC_SAN(store_32)
370 #define atomic_store_rel_32 ATOMIC_SAN(store_rel_32)
371 #define atomic_swap_32 ATOMIC_SAN(swap_32)
372 #define atomic_testandclear_32 ATOMIC_SAN(testandclear_32)
373 #define atomic_testandset_32 ATOMIC_SAN(testandset_32)
375 #define atomic_add_64 ATOMIC_SAN(add_64)
376 #define atomic_add_acq_64 ATOMIC_SAN(add_acq_64)
377 #define atomic_add_rel_64 ATOMIC_SAN(add_rel_64)
378 #define atomic_clear_64 ATOMIC_SAN(clear_64)
379 #define atomic_clear_acq_64 ATOMIC_SAN(clear_acq_64)
380 #define atomic_clear_rel_64 ATOMIC_SAN(clear_rel_64)
381 #define atomic_cmpset_64 ATOMIC_SAN(cmpset_64)
382 #define atomic_cmpset_acq_64 ATOMIC_SAN(cmpset_acq_64)
383 #define atomic_cmpset_rel_64 ATOMIC_SAN(cmpset_rel_64)
384 #define atomic_fcmpset_64 ATOMIC_SAN(fcmpset_64)
385 #define atomic_fcmpset_acq_64 ATOMIC_SAN(fcmpset_acq_64)
386 #define atomic_fcmpset_rel_64 ATOMIC_SAN(fcmpset_rel_64)
387 #define atomic_fetchadd_64 ATOMIC_SAN(fetchadd_64)
388 #define atomic_load_64 ATOMIC_SAN(load_64)
389 #define atomic_load_acq_64 ATOMIC_SAN(load_acq_64)
390 #define atomic_readandclear_64 ATOMIC_SAN(readandclear_64)
391 #define atomic_set_64 ATOMIC_SAN(set_64)
392 #define atomic_set_acq_64 ATOMIC_SAN(set_acq_64)
393 #define atomic_set_rel_64 ATOMIC_SAN(set_rel_64)
394 #define atomic_subtract_64 ATOMIC_SAN(subtract_64)
395 #define atomic_subtract_acq_64 ATOMIC_SAN(subtract_acq_64)
396 #define atomic_subtract_rel_64 ATOMIC_SAN(subtract_rel_64)
397 #define atomic_store_64 ATOMIC_SAN(store_64)
398 #define atomic_store_rel_64 ATOMIC_SAN(store_rel_64)
399 #define atomic_swap_64 ATOMIC_SAN(swap_64)
400 #define atomic_testandclear_64 ATOMIC_SAN(testandclear_64)
401 #define atomic_testandset_64 ATOMIC_SAN(testandset_64)
403 #define atomic_thread_fence_acq ATOMIC_SAN(thread_fence_acq)
404 #define atomic_thread_fence_acq_rel ATOMIC_SAN(thread_fence_acq_rel)
405 #define atomic_thread_fence_rel ATOMIC_SAN(thread_fence_rel)
406 #define atomic_thread_fence_seq_cst ATOMIC_SAN(thread_fence_seq_cst)
407 #define atomic_interrupt_fence ATOMIC_SAN(interrupt_fence)
409 #endif /* !SAN_RUNTIME */
411 #endif /* !_SYS_ATOMIC_SAN_H_ */