qemu/qemu-barrier.h
Jan Kiszka 1d93f0f03d Introduce proper compiler barrier
Define barrier() as optimization barrier and replace (potentially
unreliable) asm("") fences.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-07-22 05:52:08 +02:00

10 lines
226 B
C

#ifndef __QEMU_BARRIER_H
#define __QEMU_BARRIER_H 1
/* FIXME: arch dependant, x86 version */
#define smp_wmb() asm volatile("" ::: "memory")
/* Compiler barrier */
#define barrier() asm volatile("" ::: "memory")
#endif