Add sync_core() to serialize instruction execution on a core.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
barrier();
}
+/*
+ * Serialize core instruction execution. Also acts as a compiler barrier.
+ */
+static inline void sync_core()
+{
+ asm volatile("isync" : : : "memory");
+}
+
#define mftbl() \
({ \
unsigned long rval; \
rep_nop();
}
+/*
+ * Serialize core instruction execution. Also acts as a compiler barrier.
+ */
+static inline void sync_core(void)
+{
+ asm volatile("cpuid" : : : "memory", "eax", "ebx", "ecx", "edx");
+}
+
#define rdtscll(val) \
do { \
unsigned int __a, __d; \