]> git.lttng.org Git - userspace-rcu.git/commitdiff
Fix compilation errors master
authorOlivier Dion <odion@efficios.com>
Mon, 2 Dec 2024 19:41:30 +0000 (14:41 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 2 Dec 2024 19:48:45 +0000 (14:48 -0500)
CMM_{STORE,LOAD}_SHARED() accept expressions.  However,
uatomic_{load,store} accept address.  To pass from the latter to the
former, a dereference is necessary.

Furthermore, the C11 compatibility layer for x86.h on store operations
was wrongly named after the `set' operation.

Change-Id: Icb1468de3de4878b5744e632314aa8332ad7fe26
Signed-off-by: Olivier Dion <odion@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/urcu/uatomic/generic.h
include/urcu/uatomic/x86.h

index e32f1798ba7efe9f65397ee43770dc6d5b26ffb4..5a81e007ea1c808ef0d705af1532bcd0105c7d04 100644 (file)
@@ -95,7 +95,7 @@ extern "C" {
 #    define uatomic_store_mo(addr, v, mo)                              \
        do {                                                            \
                _cmm_compat_c11_smp_mb__before_mo(uatomic_store, mo);   \
-               (void) CMM_STORE_SHARED(addr, v);                       \
+               (void) CMM_STORE_SHARED(*(addr), v);                    \
                _cmm_compat_c11_smp_mb__after_mo(uatomic_store, mo);    \
        } while (0)
 #  endif  /* _CMM_TOOLCHAIN_SUPPORT_C11_MM */
@@ -124,7 +124,7 @@ extern "C" {
        __extension__                                                   \
        ({                                                              \
                _cmm_compat_c11_smp_mb__before_mo(uatomic_load, mo);    \
-               __typeof__(*(addr)) _rcu_value = CMM_LOAD_SHARED(addr); \
+               __typeof__(*(addr)) _rcu_value = CMM_LOAD_SHARED(*(addr)); \
                _cmm_compat_c11_smp_mb__after_mo(uatomic_load, mo);     \
                                                                        \
                _rcu_value;                                             \
index 5afb4472d544ee372f145ae9630f8dad5da4812d..4706458be7493abe605274770a39007d58c51f24 100644 (file)
@@ -693,7 +693,7 @@ static inline void _cmm_compat_c11_smp_mb__after_uatomic_load_mo(enum cmm_memord
        }
 }
 
-static inline void _cmm_compat_c11_smp_mb__before_uatomic_set_mo(enum cmm_memorder mo)
+static inline void _cmm_compat_c11_smp_mb__before_uatomic_store_mo(enum cmm_memorder mo)
 {
        /*
         * A SMP barrier is not necessary for CMM_SEQ_CST because the store can
@@ -718,7 +718,7 @@ static inline void _cmm_compat_c11_smp_mb__before_uatomic_set_mo(enum cmm_memord
        }
 }
 
-static inline void _cmm_compat_c11_smp_mb__after_uatomic_set_mo(enum cmm_memorder mo)
+static inline void _cmm_compat_c11_smp_mb__after_uatomic_store_mo(enum cmm_memorder mo)
 {
        /*
         * A SMP barrier is necessary for CMM_SEQ_CST because the store can be
This page took 0.030111 seconds and 4 git commands to generate.