Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Sep 2022 15:10:02 GMT
From:      Emmanuel Vadot <manu@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 1dc28d6cc594 - stable/13 - linuxkpi: atomic: Add atomic_fetch_inc
Message-ID:  <202209071510.287FA2mu019180@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by manu:

URL: https://cgit.FreeBSD.org/src/commit/?id=1dc28d6cc594ae99e999d309f6e108abef76f86c

commit 1dc28d6cc594ae99e999d309f6e108abef76f86c
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2022-07-26 08:00:42 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2022-09-07 15:09:03 +0000

    linuxkpi: atomic: Add atomic_fetch_inc
    
    Reviewed by:    hselasky
    Sponsored by:   Beckhoff Automation GmbH & Co. KG
    Differential Revision:  https://reviews.freebsd.org/D35936
    
    (cherry picked from commit 6be89cc88d63263b51bfb0271e2119cccbc86f16)
---
 sys/compat/linuxkpi/common/include/asm/atomic.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/asm/atomic.h b/sys/compat/linuxkpi/common/include/asm/atomic.h
index 8c201ad6a101..7c7a2c4d4b92 100644
--- a/sys/compat/linuxkpi/common/include/asm/atomic.h
+++ b/sys/compat/linuxkpi/common/include/asm/atomic.h
@@ -307,6 +307,13 @@ static inline int atomic_fetch_##op(int i, atomic_t *v)		\
 	return (c);						\
 }
 
+static inline int
+atomic_fetch_inc(atomic_t *v)
+{
+
+	return ((atomic_inc_return(v) - 1));
+}
+
 LINUX_ATOMIC_OP(or, |)
 LINUX_ATOMIC_OP(and, &)
 LINUX_ATOMIC_OP(andnot, &~)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202209071510.287FA2mu019180>