git: bbdd27a5bc84 - stable/13 - linuxkpi: Implement rcu_replace_pointer() macro

Neel Chauhan nc at FreeBSD.org
Sat May 1 00:57:31 UTC 2021


The branch stable/13 has been updated by nc (ports committer):

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

commit bbdd27a5bc8496b270d9f39d97f984d092411241
Author:     Neel Chauhan <nc at FreeBSD.org>
AuthorDate: 2021-04-28 15:04:52 +0000
Commit:     Neel Chauhan <nc at FreeBSD.org>
CommitDate: 2021-05-01 00:54:42 +0000

    linuxkpi: Implement rcu_replace_pointer() macro
    
    This is needed for the drm-kmod 5.5 update.
    
    Reviewed by:            hselasky (src)
    Differential Revision:  https://reviews.freebsd.org/D30025
    
    (cherry picked from commit efe7f12cd37bf8f2538df387d565e7849112a598)
---
 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);				\


More information about the dev-commits-src-all mailing list