diff options
author | Fan Hong <fan.hong@arm.com> | 2023-11-06 07:11:45 +0000 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2023-11-30 14:44:42 +0200 |
commit | e1647a1a8e4255a2a335d54e67ff509732f05731 (patch) | |
tree | f96544cdf2c87c9af714662c7d5b8e0b0eaa522e /platform/linux-generic/arch | |
parent | 7b6e4293fa15f99ae00985f098383ac853d3bbbd (diff) |
linux-gen: llsc: fix type casts error with CXX
Fix casts to union type erros with CXX on aarch64. When "odp_cpu.h" is
included in some head files, "odp_api_from_cpp.cpp" would include
"odp_cpu.h" as well. Build failure and error of 'unknown conversion of
types' show as going through this file with CXX.
Signed-off-by: Fan Hong <fan.hong@arm.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Diffstat (limited to 'platform/linux-generic/arch')
-rw-r--r-- | platform/linux-generic/arch/aarch64/odp_llsc.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/platform/linux-generic/arch/aarch64/odp_llsc.h b/platform/linux-generic/arch/aarch64/odp_llsc.h index ba7a447d4..498785bd4 100644 --- a/platform/linux-generic/arch/aarch64/odp_llsc.h +++ b/platform/linux-generic/arch/aarch64/odp_llsc.h @@ -150,15 +150,15 @@ static inline uint32_t scd(_odp_u128_t *var, _odp_u128_t neu, int mm) if (mm == __ATOMIC_RELEASE) __asm__ volatile("stlxp %w0, %1, %2, [%3]" : "=&r" (ret) - : "r" (((union i128)neu).i64[0]), - "r" (((union i128)neu).i64[1]), + : "r" (((*(union i128 *)&neu)).i64[0]), + "r" (((*(union i128 *)&neu)).i64[1]), "r" (var) : "memory"); else if (mm == __ATOMIC_RELAXED) __asm__ volatile("stxp %w0, %1, %2, [%3]" : "=&r" (ret) - : "r" (((union i128)neu).i64[0]), - "r" (((union i128)neu).i64[1]), + : "r" (((*(union i128 *)&neu)).i64[0]), + "r" (((*(union i128 *)&neu)).i64[1]), "r" (var) : ); else |