Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2/include/linux atomic_long_xchg
details: https://anonhg.NetBSD.org/src/rev/f55668987538
branches: trunk
changeset: 1028397:f55668987538
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Dec 19 10:57:12 2021 +0000
description:
atomic_long_xchg
diffstat:
sys/external/bsd/drm2/include/linux/atomic.h | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diffs (28 lines):
diff -r 29c6cfc5d196 -r f55668987538 sys/external/bsd/drm2/include/linux/atomic.h
--- a/sys/external/bsd/drm2/include/linux/atomic.h Sun Dec 19 10:57:05 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/atomic.h Sun Dec 19 10:57:12 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic.h,v 1.29 2021/12/19 01:46:01 riastradh Exp $ */
+/* $NetBSD: atomic.h,v 1.30 2021/12/19 10:57:12 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -421,6 +421,18 @@
}
static inline long
+atomic_long_xchg(struct atomic_long *a, long new)
+{
+ long old;
+
+ smp_mb__before_atomic();
+ old = (long)atomic_swap_ulong(&a->al_v, (unsigned long)new);
+ smp_mb__after_atomic();
+
+ return old;
+}
+
+static inline long
atomic_long_cmpxchg(struct atomic_long *a, long expect, long new)
{
long old;
Home |
Main Index |
Thread Index |
Old Index