xref: /dpdk/lib/eal/arm/include/rte_atomic_32.h (revision 719834a6849e1daf4a70ff7742bbcc3ae7e25607)
199a2dd95SBruce Richardson /* SPDX-License-Identifier: BSD-3-Clause
299a2dd95SBruce Richardson  * Copyright(c) 2015 RehiveTech. All rights reserved.
399a2dd95SBruce Richardson  */
499a2dd95SBruce Richardson 
599a2dd95SBruce Richardson #ifndef _RTE_ATOMIC_ARM32_H_
699a2dd95SBruce Richardson #define _RTE_ATOMIC_ARM32_H_
799a2dd95SBruce Richardson 
899a2dd95SBruce Richardson #ifndef RTE_FORCE_INTRINSICS
999a2dd95SBruce Richardson #  error Platform must be built with RTE_FORCE_INTRINSICS
1099a2dd95SBruce Richardson #endif
1199a2dd95SBruce Richardson 
12*719834a6SMattias Rönnblom #include "generic/rte_atomic.h"
13*719834a6SMattias Rönnblom 
1499a2dd95SBruce Richardson #ifdef __cplusplus
1599a2dd95SBruce Richardson extern "C" {
1699a2dd95SBruce Richardson #endif
1799a2dd95SBruce Richardson 
1899a2dd95SBruce Richardson #define	rte_mb()  __sync_synchronize()
1999a2dd95SBruce Richardson 
2099a2dd95SBruce Richardson #define	rte_wmb() do { asm volatile ("dmb st" : : : "memory"); } while (0)
2199a2dd95SBruce Richardson 
2299a2dd95SBruce Richardson #define	rte_rmb() __sync_synchronize()
2399a2dd95SBruce Richardson 
2499a2dd95SBruce Richardson #define rte_smp_mb() rte_mb()
2599a2dd95SBruce Richardson 
2699a2dd95SBruce Richardson #define rte_smp_wmb() rte_wmb()
2799a2dd95SBruce Richardson 
2899a2dd95SBruce Richardson #define rte_smp_rmb() rte_rmb()
2999a2dd95SBruce Richardson 
3099a2dd95SBruce Richardson #define rte_io_mb() rte_mb()
3199a2dd95SBruce Richardson 
3299a2dd95SBruce Richardson #define rte_io_wmb() rte_wmb()
3399a2dd95SBruce Richardson 
3499a2dd95SBruce Richardson #define rte_io_rmb() rte_rmb()
3599a2dd95SBruce Richardson 
3699a2dd95SBruce Richardson static __rte_always_inline void
371ec6a845STyler Retzlaff rte_atomic_thread_fence(rte_memory_order memorder)
3899a2dd95SBruce Richardson {
391ec6a845STyler Retzlaff 	__rte_atomic_thread_fence(memorder);
4099a2dd95SBruce Richardson }
4199a2dd95SBruce Richardson 
4299a2dd95SBruce Richardson #ifdef __cplusplus
4399a2dd95SBruce Richardson }
4499a2dd95SBruce Richardson #endif
4599a2dd95SBruce Richardson 
4699a2dd95SBruce Richardson #endif /* _RTE_ATOMIC_ARM32_H_ */
47