Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/common/lib/libc/arch/powerpc/atomic/atomic_cas.S,v rcsdiff: /ftp/cvs/cvsroot/src/common/lib/libc/arch/powerpc/atomic/atomic_cas.S,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.7 retrieving revision 1.8 diff -u -p -r1.7 -r1.8 --- src/common/lib/libc/arch/powerpc/atomic/atomic_cas.S 2011/01/15 07:31:11 1.7 +++ src/common/lib/libc/arch/powerpc/atomic/atomic_cas.S 2014/03/07 07:17:54 1.8 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_cas.S,v 1.7 2011/01/15 07:31:11 matt Exp $ */ +/* $NetBSD: atomic_cas.S,v 1.8 2014/03/07 07:17:54 matt Exp $ */ /*- * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc. @@ -31,36 +31,65 @@ #include "atomic_op_asm.h" -__RCSID("$NetBSD: atomic_cas.S,v 1.7 2011/01/15 07:31:11 matt Exp $") +__RCSID("$NetBSD: atomic_cas.S,v 1.8 2014/03/07 07:17:54 matt Exp $") .text ENTRY(_atomic_cas_32) -1: lwarx %r10,0,%r3 - cmpw %r10,%r4 - bne- 2f - stwcx. %r5,0,%r3 - bne- 1b -2: mr %r3,%r10 - blr + mr %r10,%r3 +1: lwarx %r3,0,%r10 + cmpw %r3,%r4 + bnelr- + stwcx. %r5,0,%r10 + beqlr+ + b 1b END(_atomic_cas_32) ATOMIC_OP_ALIAS(atomic_cas_32,_atomic_cas_32) -ATOMIC_OP_ALIAS(atomic_cas_uint,_atomic_cas_32) -STRONG_ALIAS(_atomic_cas_uint,_atomic_cas_32) -#if !defined(_LP64) -ATOMIC_OP_ALIAS(atomic_cas_ulong,_atomic_cas_32) -STRONG_ALIAS(_atomic_cas_ulong,_atomic_cas_32) -ATOMIC_OP_ALIAS(atomic_cas_ptr,_atomic_cas_32) -STRONG_ALIAS(_atomic_cas_ptr,_atomic_cas_32) -#endif - ATOMIC_OP_ALIAS(atomic_cas_32_ni,_atomic_cas_32) STRONG_ALIAS(_atomic_cas_32_ni,_atomic_cas_32) + +ATOMIC_OP_ALIAS(atomic_cas_uint,_atomic_cas_32) ATOMIC_OP_ALIAS(atomic_cas_uint_ni,_atomic_cas_32) + +STRONG_ALIAS(_atomic_cas_uint,_atomic_cas_32) STRONG_ALIAS(_atomic_cas_uint_ni,_atomic_cas_32) -#if !defined(_LP64) + +#if defined(_LP64) +ENTRY(_atomic_cas_64) + mr %r10,%r3 +1: ldarx %r3,0,%r10 + cmpd %r3,%r4 + bnelr- + stdcx. %r5,0,%r10 + beqlr+ + b 1b +END(_atomic_cas_64) + +ATOMIC_OP_ALIAS(atomic_cas_64,_atomic_cas_64) +ATOMIC_OP_ALIAS(atomic_cas_64_ni,_atomic_cas_64) +STRONG_ALIAS(_atomic_cas_64_ni,_atomic_cas_64) + +ATOMIC_OP_ALIAS(atomic_cas_ulong,_atomic_cas_64) +ATOMIC_OP_ALIAS(atomic_cas_ulong_ni,_atomic_cas_64) + +ATOMIC_OP_ALIAS(atomic_cas_ptr,_atomic_cas_64) +ATOMIC_OP_ALIAS(atomic_cas_ptr_ni,_atomic_cas_64) + +STRONG_ALIAS(_atomic_cas_ulong,_atomic_cas_64) +STRONG_ALIAS(_atomic_cas_ulong_ni,_atomic_cas_64) + +STRONG_ALIAS(_atomic_cas_ptr,_atomic_cas_64) +STRONG_ALIAS(_atomic_cas_ptr_ni,_atomic_cas_64) +#else +ATOMIC_OP_ALIAS(atomic_cas_ulong,_atomic_cas_32) ATOMIC_OP_ALIAS(atomic_cas_ulong_ni,_atomic_cas_32) -STRONG_ALIAS(_atomic_cas_ulong_ni,_atomic_cas_32) + +ATOMIC_OP_ALIAS(atomic_cas_ptr,_atomic_cas_32) ATOMIC_OP_ALIAS(atomic_cas_ptr_ni,_atomic_cas_32) + +STRONG_ALIAS(_atomic_cas_ulong,_atomic_cas_32) +STRONG_ALIAS(_atomic_cas_ulong_ni,_atomic_cas_32) + +STRONG_ALIAS(_atomic_cas_ptr,_atomic_cas_32) STRONG_ALIAS(_atomic_cas_ptr_ni,_atomic_cas_32) #endif