diff --git a/api/include/opentelemetry/common/spin_lock_mutex.h b/api/include/opentelemetry/common/spin_lock_mutex.h index 369183b953..7031fa4d23 100644 --- a/api/include/opentelemetry/common/spin_lock_mutex.h +++ b/api/include/opentelemetry/common/spin_lock_mutex.h @@ -68,8 +68,10 @@ class SpinLockMutex # else __builtin_ia32_pause(); # endif -#elif defined(__arm__) - __asm__ volatile("yield" ::: "memory"); +#elif defined(__armel__) || defined(__ARMEL__) + asm volatile("nop" ::: "memory"); +#elif defined(__arm__) || defined(__aarch64__) // arm big endian / arm64 + __asm__ __volatile__("yield" ::: "memory"); #else // TODO: Issue PAGE/YIELD on other architectures. #endif diff --git a/api/test/common/spinlock_benchmark.cc b/api/test/common/spinlock_benchmark.cc index b5e98a2108..da588b7e30 100644 --- a/api/test/common/spinlock_benchmark.cc +++ b/api/test/common/spinlock_benchmark.cc @@ -102,8 +102,10 @@ static void BM_ProcYieldSpinLockThrashing(benchmark::State &s) # else __builtin_ia32_pause(); # endif -#elif defined(__arm__) - __asm__ volatile("yield" ::: "memory"); +#elif defined(__armel__) || defined(__ARMEL__) + asm volatile("nop" ::: "memory"); +#elif defined(__arm__) || defined(__aarch64__) // arm big endian / arm64 + __asm__ __volatile__("yield" ::: "memory"); #endif } },