Skip to content

Commit

Permalink
linux-gen: llsc: fix type casts error with CXX
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
FanHong674 committed Nov 10, 2023
1 parent fd091a6 commit 53388ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions platform/linux-generic/arch/aarch64/odp_llsc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 53388ca

Please sign in to comment.