Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/common/include/linux linux: rcu_replace_poi...



details:   https://anonhg.NetBSD.org/src/rev/5020ce2fe6c6
branches:  trunk
changeset: 1028636:5020ce2fe6c6
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 11:33:17 2021 +0000

description:
linux: rcu_replace_pointer

diffstat:

 sys/external/bsd/common/include/linux/rcupdate.h |  10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diffs (24 lines):

diff -r 6267bf34c102 -r 5020ce2fe6c6 sys/external/bsd/common/include/linux/rcupdate.h
--- a/sys/external/bsd/common/include/linux/rcupdate.h  Sun Dec 19 11:33:09 2021 +0000
+++ b/sys/external/bsd/common/include/linux/rcupdate.h  Sun Dec 19 11:33:17 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rcupdate.h,v 1.5 2021/12/19 11:31:04 riastradh Exp $   */
+/*     $NetBSD: rcupdate.h,v 1.6 2021/12/19 11:33:17 riastradh Exp $   */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -53,6 +53,14 @@
        (P);                                                                  \
 })
 
+#define        rcu_replace_pointer(PTRP, NEWPTR, C) ({                               \
+       __typeof__(PTRP) __rrp_ptrp = (PTRP);                                 \
+       __typeof__(PTRP) __rrp_oldptr =                                       \
+               rcu_dereference_protected(__rrp_ptrp, C);                     \
+       rcu_assign_pointer(__rrp_ptrp, NEWPTR);                               \
+       __rrp_oldptr;                                                         \
+})
+
 
 /* kill_dependency */
 #define        rcu_pointer_handoff(P)  (P)



Home | Main Index | Thread Index | Old Index