From: Kefu Chai Date: Tue, 4 Apr 2017 03:14:32 +0000 (+0800) Subject: common/simple_spin: use __ppc_yield() on all powerpc archs X-Git-Tag: v12.0.2~208^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=58e173c54d4077c3c773968f815a2005cdbb2e76;p=ceph.git 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 --- diff --git a/src/common/simple_spin.cc b/src/common/simple_spin.cc index 2d875365e056..ef41a2b515bb 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"