]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/simple_spin: use __ppc_yield() on all powerpc archs 14310/head
authorKefu Chai <kchai@redhat.com>
Tue, 4 Apr 2017 03:14:32 +0000 (11:14 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 4 Apr 2017 03:23:48 +0000 (11:23 +0800)
__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 <kchai@redhat.com>
src/common/simple_spin.cc

index 2d875365e0560fbe1567c826b325655b063a188b..ef41a2b515bbbd601cb91b212c9e3cc50e19322d 100644 (file)
@@ -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"