From owner-svn-src-all@freebsd.org Thu Mar 23 22:22:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85AC9D1B78D; Thu, 23 Mar 2017 22:22:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 388291B0E; Thu, 23 Mar 2017 22:22:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2NMMPAn043315; Thu, 23 Mar 2017 22:22:25 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2NMMPjA043313; Thu, 23 Mar 2017 22:22:25 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201703232222.v2NMMPjA043313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 23 Mar 2017 22:22:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315874 - stable/11/sys/arm/include X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Mar 2017 22:22:26 -0000 Author: mjg Date: Thu Mar 23 22:22:24 2017 New Revision: 315874 URL: https://svnweb.freebsd.org/changeset/base/315874 Log: MFC r312932,r312933,r312949,r313141 (by cognet) Use strexeq instead of needlessly branch. == (by cognet) Remove useless labels. == (by cognet) Correct the IT instruction in atomic_fcmpset_64(). == (by andrew) Only define atomic_fcmpset_long in the kernel. We may include machine/atomic.h in userspace, however atomic_fcmpset_32 is unimplemented there. Modified: stable/11/sys/arm/include/atomic-v4.h stable/11/sys/arm/include/atomic-v6.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/include/atomic-v4.h ============================================================================== --- stable/11/sys/arm/include/atomic-v4.h Thu Mar 23 22:14:08 2017 (r315873) +++ stable/11/sys/arm/include/atomic-v4.h Thu Mar 23 22:22:24 2017 (r315874) @@ -463,6 +463,8 @@ atomic_cmpset_long(volatile u_long *dst, return (atomic_cmpset_32((volatile uint32_t *)dst, old, newe)); } +#ifdef _KERNEL +/* atomic_fcmpset_32 is only defined for the kernel */ static __inline u_long atomic_fcmpset_long(volatile u_long *dst, u_long *old, u_long newe) { @@ -470,6 +472,7 @@ atomic_fcmpset_long(volatile u_long *dst return (atomic_fcmpset_32((volatile uint32_t *)dst, (uint32_t *)old, newe)); } +#endif static __inline u_long atomic_fetchadd_long(volatile u_long *p, u_long v) Modified: stable/11/sys/arm/include/atomic-v6.h ============================================================================== --- stable/11/sys/arm/include/atomic-v6.h Thu Mar 23 22:14:08 2017 (r315873) +++ stable/11/sys/arm/include/atomic-v6.h Thu Mar 23 22:22:24 2017 (r315874) @@ -198,13 +198,11 @@ atomic_fcmpset_32(volatile uint32_t *p, int ret; __asm __volatile( - "1: mov %0, #1 \n" + " mov %0, #1 \n" " ldrex %1, [%2] \n" " cmp %1, %3 \n" - " it ne \n" - " bne 2f \n" - " strex %0, %4, [%2] \n" - "2:" + " it eq \n" + " strexeq %0, %4, [%2] \n" : "=&r" (ret), "=&r" (tmp), "+r" (p), "+r" (_cmpval), "+r" (newval) : : "cc", "memory"); *cmpval = tmp; @@ -222,7 +220,7 @@ atomic_fcmpset_64(volatile uint64_t *p, "1: mov %[ret], #1 \n" " ldrexd %Q[tmp], %R[tmp], [%[ptr]] \n" " teq %Q[tmp], %Q[_cmpval] \n" - " itee eq \n" + " ite eq \n" " teqeq %R[tmp], %R[_cmpval] \n" " bne 2f \n" " strexd %[ret], %Q[newval], %R[newval], [%[ptr]]\n"