git: 1dc28d6cc594 - stable/13 - linuxkpi: atomic: Add atomic_fetch_inc
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 07 Sep 2022 15:10:02 UTC
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, &~)