1 /* 2 * Copyright (c) 2015, Xilinx Inc. and Contributors. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 /* 8 * @file atomic.h 9 * @brief Atomic primitives for libmetal. 10 */ 11 12 #ifndef __METAL_ATOMIC__H__ 13 #define __METAL_ATOMIC__H__ 14 15 #include <metal/config.h> 16 17 #if defined(HAVE_STDATOMIC_H) && !defined (__CC_ARM) && \ 18 !defined(__STDC_NO_ATOMICS__) && !defined(__cplusplus) 19 20 # include <stdatomic.h> 21 22 #ifndef atomic_thread_fence 23 #define atomic_thread_fence(order) 24 #endif 25 26 #elif defined(__GNUC__) 27 # include <metal/compiler/gcc/atomic.h> 28 #else 29 # include <metal/processor/arm/atomic.h> 30 #endif 31 32 #endif /* __METAL_ATOMIC__H__ */ 33