Index: powerpc/include/lock.h =================================================================== RCS file: /cvs/src/sys/arch/powerpc/include/lock.h,v retrieving revision 1.5 diff -u -p -r1.5 lock.h --- powerpc/include/lock.h 11 Feb 2015 00:14:11 -0000 1.5 +++ powerpc/include/lock.h 26 Jun 2015 12:23:59 -0000 @@ -37,24 +37,4 @@ #ifndef _POWERPC_LOCK_H_ #define _POWERPC_LOCK_H_ -static __inline int -__cpu_cas(volatile unsigned long *addr, unsigned long old, unsigned long new) -{ - int success, scratch; - __asm volatile( - "1: lwarx %0, 0, %4 \n" - " cmpw 0, %0, %2 \n" - " li %1, 1 \n" - " bne 0,2f \n" - " stwcx. %3, 0, %4 \n" - " li %1, 0 \n" - " bne- 1b \n" - "2: \n" - : "=&r" (scratch), "=&r" (success) - : "r" (old), "r" (new), "r" (addr) - : "memory"); - - return success; -} - #endif /* _POWERPC_LOCK_H_ */ Index: powerpc/powerpc/lock_machdep.c =================================================================== RCS file: /cvs/src/sys/arch/powerpc/powerpc/lock_machdep.c,v retrieving revision 1.1 diff -u -p -r1.1 lock_machdep.c --- powerpc/powerpc/lock_machdep.c 26 Jun 2015 11:15:32 -0000 1.1 +++ powerpc/powerpc/lock_machdep.c 26 Jun 2015 12:23:59 -0000 @@ -82,7 +82,7 @@ __mp_lock(struct __mp_lock *mpl) int s; s = ppc_intr_disable(); - if (__cpu_cas(&mpl->mpl_count, 0, 1) == 0) { + if (atomic_cas_ulong(&mpl->mpl_count, 0, 1) == 0) { membar_enter(); mpl->mpl_cpu = curcpu(); }