diff options
author | Malvika Gupta <Malvika.Gupta@arm.com> | 2021-03-19 17:04:48 -0500 |
---|---|---|
committer | Petri Savolainen <petri.savolainen@nokia.com> | 2021-03-23 09:41:54 +0200 |
commit | 274a8a765598b8d970ff4152b0cc975de5da8597 (patch) | |
tree | 1ad1f23349c49f9ac896ee297e117c33ad930dc3 /platform/linux-generic/arch/aarch64 | |
parent | 43d98de49bfd0b32318cdb6fb28087e0efd4bdd4 (diff) |
linux-gen: queue_lf: move aarch64 specific code to arch files
On arm64 systems, the build fails with the --disable-host-optimization
compiler flag as it is unable to locate definitions of lockless APIs
present in arch/aarch64/odp_atomic.h files. Consequently, the aarch64
specific code in odp_queue_lf.c has been moved to the arch-specific file
while the reminder code has been added to a new file under the default
linux-generic implementation.
Signed-off-by: Malvika Gupta <Malvika.Gupta@arm.com>
Reviewed-by: Govindarajan Mohandoss <govindarajan.mohandoss@arm.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Diffstat (limited to 'platform/linux-generic/arch/aarch64')
-rw-r--r-- | platform/linux-generic/arch/aarch64/odp_atomic.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/platform/linux-generic/arch/aarch64/odp_atomic.h b/platform/linux-generic/arch/aarch64/odp_atomic.h index d6648a1f0..6cf114f2e 100644 --- a/platform/linux-generic/arch/aarch64/odp_atomic.h +++ b/platform/linux-generic/arch/aarch64/odp_atomic.h @@ -217,4 +217,28 @@ static inline __int128 __lockfree_load_16(__int128 *var, int mo) return old; } +typedef unsigned __int128 _u128_t; + +static inline _u128_t lockfree_load_u128(_u128_t *atomic) +{ + return __lockfree_load_16((__int128 *)atomic, __ATOMIC_RELAXED); +} + +static inline int lockfree_cas_acq_rel_u128(_u128_t *atomic, + _u128_t old_val, + _u128_t new_val) +{ + return __lockfree_compare_exchange_16((__int128 *)atomic, + (__int128 *)&old_val, + new_val, + 0, + __ATOMIC_ACQ_REL, + __ATOMIC_RELAXED); +} + +static inline int lockfree_check_u128(void) +{ + return 1; +} + #endif /* PLATFORM_LINUXGENERIC_ARCH_ARM_ODP_ATOMIC_H */ |