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 Implement atomic64_cmpxchg.



details:   https://anonhg.NetBSD.org/src/rev/d51416520fdf
branches:  trunk
changeset: 992595:d51416520fdf
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 07:08:58 2018 +0000

description:
Implement atomic64_cmpxchg.

diffstat:

 sys/external/bsd/drm2/include/linux/atomic.h |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (22 lines):

diff -r 9ca47588694a -r d51416520fdf sys/external/bsd/drm2/include/linux/atomic.h
--- a/sys/external/bsd/drm2/include/linux/atomic.h      Mon Aug 27 07:08:47 2018 +0000
+++ b/sys/external/bsd/drm2/include/linux/atomic.h      Mon Aug 27 07:08:58 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atomic.h,v 1.8 2018/08/27 06:19:05 riastradh Exp $     */
+/*     $NetBSD: atomic.h,v 1.9 2018/08/27 07:08:58 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -195,6 +195,12 @@
        return atomic_swap_64(&a->a_v, v);
 }
 
+static inline uint64_t
+atomic64_cmpxchg(struct atomic64 *atomic, uint64_t old, uint64_t new)
+{
+       return atomic_cas_64(&atomic->a_v, old, new);
+}
+
 static inline void
 set_bit(unsigned int bit, volatile unsigned long *ptr)
 {



Home | Main Index | Thread Index | Old Index