X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=arch_x86.h;h=e7d945e3859393edece5eb4b2aee4c99538083e2;hb=aa8c36e03126a731c6c925cb32a8649c9802198d;hp=cc3ab012c557f38db5df6c7b5c829a13ceaf511a;hpb=0114ba7f23f86623c237baeb28ec8e4b39b9bb84;p=urcu.git diff --git a/arch_x86.h b/arch_x86.h index cc3ab01..e7d945e 100644 --- a/arch_x86.h +++ b/arch_x86.h @@ -84,10 +84,9 @@ /* 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,14 @@ static inline void cpu_relax(void) 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; \