From owner-svn-src-all@freebsd.org Tue Aug 7 18:56:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 612C51067C3B; Tue, 7 Aug 2018 18:56:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17D687C398; Tue, 7 Aug 2018 18:56:02 +0000 (UTC) (envelope-from marius@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED3501FBE2; Tue, 7 Aug 2018 18:56:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77Iu1Ba097732; Tue, 7 Aug 2018 18:56:01 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77Iu1tv097731; Tue, 7 Aug 2018 18:56:01 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201808071856.w77Iu1tv097731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Tue, 7 Aug 2018 18:56:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337432 - head/sys/arm/include X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/arm/include X-SVN-Commit-Revision: 337432 X-SVN-Commit-Repository: base 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.27 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: Tue, 07 Aug 2018 18:56:02 -0000 Author: marius Date: Tue Aug 7 18:56:01 2018 New Revision: 337432 URL: https://svnweb.freebsd.org/changeset/base/337432 Log: Implement atomic_swap_64(9). Modified: head/sys/arm/include/atomic-v4.h Modified: head/sys/arm/include/atomic-v4.h ============================================================================== --- head/sys/arm/include/atomic-v4.h Tue Aug 7 18:29:10 2018 (r337431) +++ head/sys/arm/include/atomic-v4.h Tue Aug 7 18:56:01 2018 (r337432) @@ -249,6 +249,19 @@ atomic_subtract_64(volatile u_int64_t *p, u_int64_t va __with_interrupts_disabled(*p -= val); } +static __inline uint64_t +atomic_swap_64(volatile uint64_t *p, uint64_t v) +{ + uint64_t value; + + __with_interrupts_disabled( + { + value = *p; + *p = v; + }); + return (value); +} + #else /* !_KERNEL */ static __inline void