| * Process-global memory barriers |
| * Copyright (c) 2018 Red Hat, Inc. |
| * Author: Paolo Bonzini <pbonzini@redhat.com> |
| #include "qemu/sys_membarrier.h" |
| #include "qemu/error-report.h" |
| #include <linux/membarrier.h> |
| membarrier(int cmd, int flags) |
| return syscall(__NR_membarrier, cmd, flags); |
| FlushProcessWriteBuffers(); |
| #elif defined CONFIG_LINUX |
| membarrier(MEMBARRIER_CMD_SHARED, 0); |
| #error --enable-membarrier is not supported on this operating system. |
| void smp_mb_global_init(void) |
| int ret = membarrier(MEMBARRIER_CMD_QUERY, 0); |
| error_report("This QEMU binary requires the membarrier system call."); |
| error_report("Please upgrade your system to a newer version of Linux"); |
| if (!(ret & MEMBARRIER_CMD_SHARED)) { |
| error_report("This QEMU binary requires MEMBARRIER_CMD_SHARED support."); |
| error_report("Please upgrade your system to a newer version of Linux"); |