diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2018-02-16 10:04:18 +0100 |
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-03-12 16:12:47 +0100 |
| commit | c8d3877e48c4f57381d72eaf8d016bff12ce2d7c (patch) | |
| tree | 204fd1c6da69bdfab70ac5e25007c67195d3e78f /include/qemu/sys_membarrier.h | |
| parent | 77a8b8462b02a10aea5cad389a8f9260f79ede36 (diff) | |
| download | focaccia-qemu-c8d3877e48c4f57381d72eaf8d016bff12ce2d7c.tar.gz focaccia-qemu-c8d3877e48c4f57381d72eaf8d016bff12ce2d7c.zip | |
membarrier: introduce qemu/sys_membarrier.h
This new header file provides heavy-weight "global" memory barriers that enforce memory ordering on each running thread belonging to the current process. For now, use a dummy implementation that issues memory barriers on both sides (matching what QEMU has been doing so far). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/qemu/sys_membarrier.h')
| -rw-r--r-- | include/qemu/sys_membarrier.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/qemu/sys_membarrier.h b/include/qemu/sys_membarrier.h new file mode 100644 index 0000000000..9ce7f5210b --- /dev/null +++ b/include/qemu/sys_membarrier.h @@ -0,0 +1,17 @@ +/* + * Process-global memory barriers + * + * Copyright (c) 2018 Red Hat, Inc. + * + * Author: Paolo Bonzini <pbonzini@redhat.com> + */ + +#ifndef QEMU_SYS_MEMBARRIER_H +#define QEMU_SYS_MEMBARRIER_H 1 + +/* Keep it simple, execute a real memory barrier on both sides. */ +static inline void smp_mb_global_init(void) {} +#define smp_mb_global() smp_mb() +#define smp_mb_placeholder() smp_mb() + +#endif |