cmm: let per-arch files provide cmm_smp_* barriers
authorPaolo Bonzini <pbonzini@redhat.com>
Sat, 10 Sep 2011 19:26:19 +0000 (12:26 -0700)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 10 Sep 2011 19:26:19 +0000 (12:26 -0700)
x86 instructions lfence and sfence are rarely needed, thus we want
the cmm_smp_rmb/cmm_smp_wmb macros to be simple compiler barriers.
So, let the per-arch files override the default definitions in
arch/generic.h.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
urcu/arch/generic.h

index 100d3c6c12948a2f88bc769f0dc26325a1036027..1ea7f59ca396d0c13d49372ccb26976bbed2d2d8 100644 (file)
@@ -100,22 +100,50 @@ extern "C" {
 #endif
 
 #ifdef CONFIG_RCU_SMP
+#ifndef cmm_smp_mb
 #define cmm_smp_mb()   cmm_mb()
+#endif
+#ifndef cmm_smp_rmb
 #define cmm_smp_rmb()  cmm_rmb()
+#endif
+#ifndef cmm_smp_wmb
 #define cmm_smp_wmb()  cmm_wmb()
+#endif
+#ifndef cmm_smp_mc
 #define cmm_smp_mc()   cmm_mc()
+#endif
+#ifndef cmm_smp_rmc
 #define cmm_smp_rmc()  cmm_rmc()
+#endif
+#ifndef cmm_smp_wmc
 #define cmm_smp_wmc()  cmm_wmc()
+#endif
+#ifndef cmm_smp_read_barrier_depends
 #define cmm_smp_read_barrier_depends() cmm_read_barrier_depends()
+#endif
 #else
+#ifndef cmm_smp_mb
 #define cmm_smp_mb()   cmm_barrier()
+#endif
+#ifndef cmm_smp_rmb
 #define cmm_smp_rmb()  cmm_barrier()
+#endif
+#ifndef cmm_smp_wmb
 #define cmm_smp_wmb()  cmm_barrier()
+#endif
+#ifndef cmm_smp_mc
 #define cmm_smp_mc()   cmm_barrier()
+#endif
+#ifndef cmm_smp_rmc
 #define cmm_smp_rmc()  cmm_barrier()
+#endif
+#ifndef cmm_smp_wmc
 #define cmm_smp_wmc()  cmm_barrier()
+#endif
+#ifndef cmm_smp_read_barrier_depends
 #define cmm_smp_read_barrier_depends()
 #endif
+#endif
 
 #ifndef caa_cpu_relax
 #define caa_cpu_relax()                cmm_barrier()
This page took 0.025528 seconds and 4 git commands to generate.