diff options
author | Matias Elo <matias.elo@nokia.com> | 2021-04-28 15:52:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-28 15:52:39 +0300 |
commit | 029cb31ef951664c12cfe61563a25f3ff6449e5a (patch) | |
tree | bb12bb9dcd04e8a1176a782b50a16a085c03963f /platform/linux-generic/include-abi/odp/api/abi/atomic.h | |
parent | c3e252739b6c5812d11ac07ec7df687d927de36e (diff) | |
parent | 20eb6b4655671fbfb6fd41c7407762cd30f1cfc5 (diff) |
Merge ODP v1.27.0.0v1.27.0.0_DPDK_19.11
Merge ODP linux-generic v1.27.0.0 into ODP-DPDK.
Diffstat (limited to 'platform/linux-generic/include-abi/odp/api/abi/atomic.h')
-rw-r--r-- | platform/linux-generic/include-abi/odp/api/abi/atomic.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/platform/linux-generic/include-abi/odp/api/abi/atomic.h b/platform/linux-generic/include-abi/odp/api/abi/atomic.h index 955b99370..13c12a79f 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/atomic.h +++ b/platform/linux-generic/include-abi/odp/api/abi/atomic.h @@ -55,6 +55,31 @@ typedef struct ODP_ALIGNED(sizeof(uint64_t)) odp_atomic_u64_s { #endif +#ifdef _ODP_LOCK_FREE_128BIT_ATOMICS + +/** + * @internal + * Atomic 128-bit unsigned integer + */ +typedef struct ODP_ALIGNED(sizeof(odp_u128_t)) odp_atomic_u128_s { + odp_u128_t v; /**< Actual storage for the atomic variable */ +} odp_atomic_u128_t; + +#else + +/** + * @internal + * Atomic 128-bit unsigned integer + */ +typedef struct ODP_ALIGNED(sizeof(odp_u128_t)) odp_atomic_u128_s { + odp_u128_t v; /**< Actual storage for the atomic variable */ + /* Some architectures do not support lock-free operations on 128-bit + * data types. We use a spin lock to ensure atomicity. */ + char lock; /**< Spin lock (if needed) used to ensure atomic access */ +} odp_atomic_u128_t; + +#endif + /** @ingroup odp_atomic * @{ */ |