From 58e173c54d4077c3c773968f815a2005cdbb2e76 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 4 Apr 2017 11:14:32 +0800 Subject: [PATCH] common/simple_spin: use __ppc_yield() on all powerpc archs __ppc_yield() is declared in sys/platform/ppc.h by glibc, for better portability we just use the inlined assembly here. the shared resource hints are supported by PowerPC ISA 2.06 but on older PowerPC cores, they are no-ops. so it's fine to do this way. Signed-off-by: Kefu Chai --- src/common/simple_spin.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/simple_spin.cc b/src/common/simple_spin.cc index 2d875365e05..ef41a2b515b 100644 --- a/src/common/simple_spin.cc +++ b/src/common/simple_spin.cc @@ -32,7 +32,7 @@ void simple_spin_lock(simple_spinlock_t *lock) asm volatile("pause"); #elif defined(__arm__) || defined(__aarch64__) asm volatile("yield"); -#elif defined(__ppc64__) +#elif defined(__powerpc__) || defined(__ppc__) asm volatile("or 27,27,27"); #else #error "Unknown architecture" -- 2.47.3