Skip to content

Commit

Permalink
linuxkpi: Add atomic64_fetch_add
Browse files Browse the repository at this point in the history
Linux variant of atomic_fetchadd_64.

Reviewed by:	bz
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D34296

(cherry picked from commit 1889bed)
  • Loading branch information
evadot committed Mar 5, 2022
1 parent db4c095 commit ec504d3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sys/compat/linuxkpi/common/include/asm/atomic64.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ typedef struct {
#define atomic64_dec_return(v) atomic64_sub_return(1, (v))
#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)

static inline int64_t
atomic64_fetch_add(int64_t i, atomic64_t *v)
{
return (atomic_fetchadd_64(&v->counter, i));
}

static inline int64_t
atomic64_add_return(int64_t i, atomic64_t *v)
{
Expand Down

0 comments on commit ec504d3

Please sign in to comment.