From owner-svn-src-head@FreeBSD.ORG Mon Oct 1 05:12:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91F6810656E3; Mon, 1 Oct 2012 05:12:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 737188FC0A; Mon, 1 Oct 2012 05:12:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q915CIrR085584; Mon, 1 Oct 2012 05:12:18 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q915CIJM085583; Mon, 1 Oct 2012 05:12:18 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201210010512.q915CIJM085583@svn.freebsd.org> From: Andrew Turner Date: Mon, 1 Oct 2012 05:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r241080 - head/sys/arm/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Oct 2012 05:12:18 -0000 Author: andrew Date: Mon Oct 1 05:12:17 2012 New Revision: 241080 URL: http://svn.freebsd.org/changeset/base/241080 Log: Fix the clobber list on the atomic operators that do comparisons. Without this some compilers will place a cmp instruction before the atomic operation and expect to be able to use the result afterwards. By adding "cc" to the list of used registers we tell the compiler to not do this. Modified: head/sys/arm/include/atomic.h Modified: head/sys/arm/include/atomic.h ============================================================================== --- head/sys/arm/include/atomic.h Mon Oct 1 03:17:23 2012 (r241079) +++ head/sys/arm/include/atomic.h Mon Oct 1 05:12:17 2012 (r241080) @@ -123,7 +123,7 @@ atomic_set_32(volatile uint32_t *address "cmp %1, #0\n" "bne 1b\n" : "=&r" (tmp), "+r" (tmp2) - , "+r" (address), "+r" (setmask) : : "memory"); + , "+r" (address), "+r" (setmask) : : "cc", "memory"); } @@ -138,7 +138,7 @@ atomic_set_long(volatile u_long *address "cmp %1, #0\n" "bne 1b\n" : "=&r" (tmp), "+r" (tmp2) - , "+r" (address), "+r" (setmask) : : "memory"); + , "+r" (address), "+r" (setmask) : : "cc", "memory"); } @@ -153,7 +153,7 @@ atomic_clear_32(volatile uint32_t *addre "cmp %1, #0\n" "bne 1b\n" : "=&r" (tmp), "+r" (tmp2) - ,"+r" (address), "+r" (setmask) : : "memory"); + ,"+r" (address), "+r" (setmask) : : "cc", "memory"); } static __inline void @@ -167,7 +167,7 @@ atomic_clear_long(volatile u_long *addre "cmp %1, #0\n" "bne 1b\n" : "=&r" (tmp), "+r" (tmp2) - ,"+r" (address), "+r" (setmask) : : "memory"); + ,"+r" (address), "+r" (setmask) : : "cc", "memory"); } static __inline u_int32_t @@ -185,7 +185,8 @@ atomic_cmpset_32(volatile u_int32_t *p, "moveq %0, #1\n" "2:" : "=&r" (ret) - ,"+r" (p), "+r" (cmpval), "+r" (newval) : : "memory"); + ,"+r" (p), "+r" (cmpval), "+r" (newval) : : "cc", + "memory"); return (ret); } @@ -204,7 +205,8 @@ atomic_cmpset_long(volatile u_long *p, v "moveq %0, #1\n" "2:" : "=&r" (ret) - ,"+r" (p), "+r" (cmpval), "+r" (newval) : : "memory"); + ,"+r" (p), "+r" (cmpval), "+r" (newval) : : "cc", + "memory"); return (ret); } @@ -254,7 +256,7 @@ atomic_add_32(volatile u_int32_t *p, u_i "cmp %1, #0\n" "bne 1b\n" : "=&r" (tmp), "+r" (tmp2) - ,"+r" (p), "+r" (val) : : "memory"); + ,"+r" (p), "+r" (val) : : "cc", "memory"); } static __inline void @@ -268,7 +270,7 @@ atomic_add_long(volatile u_long *p, u_lo "cmp %1, #0\n" "bne 1b\n" : "=&r" (tmp), "+r" (tmp2) - ,"+r" (p), "+r" (val) : : "memory"); + ,"+r" (p), "+r" (val) : : "cc", "memory"); } static __inline void @@ -282,7 +284,7 @@ atomic_subtract_32(volatile u_int32_t *p "cmp %1, #0\n" "bne 1b\n" : "=&r" (tmp), "+r" (tmp2) - ,"+r" (p), "+r" (val) : : "memory"); + ,"+r" (p), "+r" (val) : : "cc", "memory"); } static __inline void @@ -296,7 +298,7 @@ atomic_subtract_long(volatile u_long *p, "cmp %1, #0\n" "bne 1b\n" : "=&r" (tmp), "+r" (tmp2) - ,"+r" (p), "+r" (val) : : "memory"); + ,"+r" (p), "+r" (val) : : "cc", "memory"); } ATOMIC_ACQ_REL(clear, 32) @@ -322,7 +324,7 @@ atomic_fetchadd_32(volatile uint32_t *p, "cmp %2, #0\n" "bne 1b\n" : "+r" (ret), "=&r" (tmp), "+r" (tmp2) - ,"+r" (p), "+r" (val) : : "memory"); + ,"+r" (p), "+r" (val) : : "cc", "memory"); return (ret); } @@ -337,7 +339,7 @@ atomic_readandclear_32(volatile u_int32_ "cmp %2, #0\n" "bne 1b\n" : "=r" (ret), "=&r" (tmp), "+r" (tmp2) - ,"+r" (p) : : "memory"); + ,"+r" (p) : : "cc", "memory"); return (ret); } @@ -370,7 +372,7 @@ atomic_fetchadd_long(volatile u_long *p, "cmp %2, #0\n" "bne 1b\n" : "+r" (ret), "=&r" (tmp), "+r" (tmp2) - ,"+r" (p), "+r" (val) : : "memory"); + ,"+r" (p), "+r" (val) : : "cc", "memory"); return (ret); } @@ -385,7 +387,7 @@ atomic_readandclear_long(volatile u_long "cmp %2, #0\n" "bne 1b\n" : "=r" (ret), "=&r" (tmp), "+r" (tmp2) - ,"+r" (p) : : "memory"); + ,"+r" (p) : : "cc", "memory"); return (ret); } @@ -516,7 +518,7 @@ atomic_cmpset_32(volatile u_int32_t *p, "moveq %1, #1\n" "movne %1, #0\n" : "+r" (ras_start), "=r" (done) - ,"+r" (p), "+r" (cmpval), "+r" (newval) : : "memory"); + ,"+r" (p), "+r" (cmpval), "+r" (newval) : : "cc", "memory"); return (done); }