Date: Tue, 7 Aug 2018 18:56:01 +0000 (UTC) From: Marius Strobl <marius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337432 - head/sys/arm/include Message-ID: <201808071856.w77Iu1tv097731@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808071856.w77Iu1tv097731>