Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Apr 2021 15:06:07 GMT
From:      Neel Chauhan <nc@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: efe7f12cd37b - main - linuxkpi: Implement rcu_replace_pointer() macro
Message-ID:  <202104281506.13SF679b004900@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by nc (ports committer):

URL: https://cgit.FreeBSD.org/src/commit/?id=efe7f12cd37bf8f2538df387d565e7849112a598

commit efe7f12cd37bf8f2538df387d565e7849112a598
Author:     Neel Chauhan <nc@FreeBSD.org>
AuthorDate: 2021-04-28 15:04:52 +0000
Commit:     Neel Chauhan <nc@FreeBSD.org>
CommitDate: 2021-04-28 15:04:52 +0000

    linuxkpi: Implement rcu_replace_pointer() macro
    
    This is needed for the drm-kmod 5.5 update.
    
    Reviewed by:            hselasky (src)
    MFC after:              3 days
    Differential Revision:  https://reviews.freebsd.org/D30025
---
 sys/compat/linuxkpi/common/include/linux/rcupdate.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/rcupdate.h b/sys/compat/linuxkpi/common/include/linux/rcupdate.h
index a43736e0285f..ea97fecee53b 100644
--- a/sys/compat/linuxkpi/common/include/linux/rcupdate.h
+++ b/sys/compat/linuxkpi/common/include/linux/rcupdate.h
@@ -97,6 +97,13 @@
 	    (uintptr_t)(v));					\
 } while (0)
 
+#define	rcu_replace_pointer(rcu, ptr, c)			\
+({								\
+	typeof(ptr) __tmp = rcu_dereference_protected(rcu, c);	\
+	rcu_assign_pointer(rcu, ptr);				\
+	__tmp;							\
+})
+
 #define	rcu_swap_protected(rcu, ptr, c) do {			\
 	typeof(ptr) p = rcu_dereference_protected(rcu, c);	\
 	rcu_assign_pointer(rcu, ptr);				\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104281506.13SF679b004900>