From 7f6fb9ce1cdd20b4c57dd402154b21587b0eb3c9 Mon Sep 17 00:00:00 2001 From: guoshichao Date: Mon, 5 Aug 2024 14:20:18 +0800 Subject: [PATCH] greenhills: add the "__sync_synchronize" func impl we add ghs header file support using to fix the following link error: [elxr] (error #412) unresolved symbols: 1 __sync_synchronize from libopenamp.a(io.o) Signed-off-by: guoshichao --- libs/libc/machine/arch_atomic.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libs/libc/machine/arch_atomic.c b/libs/libc/machine/arch_atomic.c index efb7238888..0db93e79b2 100644 --- a/libs/libc/machine/arch_atomic.c +++ b/libs/libc/machine/arch_atomic.c @@ -754,3 +754,16 @@ SYNC_VAL_CMP_SWAP(4, uint32_t) SYNC_VAL_CMP_SWAP(8, uint64_t) #endif /* __clang__ */ + +#ifdef __ghs__ + +/**************************************************************************** + * Name: __sync_synchronize + ****************************************************************************/ + +void weak_function __sync_synchronize(void) +{ + asm volatile("" ::: "memory"); +} + +#endif