hw/arm/virt: Consolidate GIC finalize logic
[qemu.git] / include / qemu / sys_membarrier.h
blobb5bfa21d521cec579eb93c8566be30fbbd18f186
1 /*
2 * Process-global memory barriers
4 * Copyright (c) 2018 Red Hat, Inc.
6 * Author: Paolo Bonzini <pbonzini@redhat.com>
7 */
9 #ifndef QEMU_SYS_MEMBARRIER_H
10 #define QEMU_SYS_MEMBARRIER_H
12 #ifdef CONFIG_MEMBARRIER
13 /* Only block reordering at the compiler level in the performance-critical
14 * side. The slow side forces processor-level ordering on all other cores
15 * through a system call.
17 extern void smp_mb_global_init(void);
18 extern void smp_mb_global(void);
19 #define smp_mb_placeholder() barrier()
20 #else
21 /* Keep it simple, execute a real memory barrier on both sides. */
22 static inline void smp_mb_global_init(void) {}
23 #define smp_mb_global() smp_mb()
24 #define smp_mb_placeholder() smp_mb()
25 #endif
27 #endif