seabios: Update to release 1.6.3.1
[qemu-kvm.git] / qemu-barrier.h
blobc11bb2b59f01c0dd265080cbe170d2bf08dbd0c8
1 #ifndef __QEMU_BARRIER_H
2 #define __QEMU_BARRIER_H 1
4 /* Compiler barrier */
5 #define barrier() asm volatile("" ::: "memory")
7 #if defined(__i386__) || defined(__x86_64__)
9 /*
10 * Because of the strongly ordered x86 storage model, wmb() is a nop
11 * on x86(well, a compiler barrier only). Well, at least as long as
12 * qemu doesn't do accesses to write-combining memory or non-temporal
13 * load/stores from C code.
15 #define smp_wmb() barrier()
17 #elif defined(_ARCH_PPC)
20 * We use an eieio() for a wmb() on powerpc. This assumes we don't
21 * need to order cacheable and non-cacheable stores with respect to
22 * each other
24 #define smp_wmb() asm volatile("eieio" ::: "memory")
26 #else
29 * For (host) platforms we don't have explicit barrier definitions
30 * for, we use the gcc __sync_synchronize() primitive to generate a
31 * full barrier. This should be safe on all platforms, though it may
32 * be overkill.
34 #define smp_wmb() __sync_synchronize()
36 #endif
38 #endif