Add missing rcu_cmpxchg_pointer define
[urcu.git] / arch_x86.h
index cc3ab012c557f38db5df6c7b5c829a13ceaf511a..8a5732536c9d3106af919b5467dab1f58c5f9313 100644 (file)
 /* Nop everywhere except on alpha. */
 #define smp_read_barrier_depends()
 
-/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
 static inline void rep_nop(void)
 {
-       asm volatile("rep; nop" ::: "memory");
+       asm volatile("rep; nop" : : : "memory");
 }
 
 static inline void cpu_relax(void)
@@ -95,6 +94,26 @@ static inline void cpu_relax(void)
        rep_nop();
 }
 
+/*
+ * Serialize core instruction execution. Also acts as a compiler barrier.
+ */
+#ifdef __PIC__
+/*
+ * Cannot use cpuid because it clobbers the ebx register and clashes
+ * with -fPIC :
+ * error: PIC register 'ebx' clobbered in 'asm'
+ */
+static inline void sync_core(void)
+{
+       mb();
+}
+#else
+static inline void sync_core(void)
+{
+       asm volatile("cpuid" : : : "memory", "eax", "ebx", "ecx", "edx");
+}
+#endif
+
 #define rdtscll(val)                                                     \
        do {                                                              \
             unsigned int __a, __d;                                       \
This page took 0.022379 seconds and 4 git commands to generate.