diff options
| author | Michael S. Tsirkin | 2015-09-24 13:41:17 +0200 |
|---|---|---|
| committer | Michael S. Tsirkin | 2015-10-21 08:24:44 +0200 |
| commit | 794e8f301a17953efa78ab7538019ec43c59e82a (patch) | |
| tree | 99efbb84259d79552bd700c58242f6350b88efd2 /include | |
| parent | intel_iommu: Add support for translation for devices behind bridges (diff) | |
| download | qemu-794e8f301a17953efa78ab7538019ec43c59e82a.tar.gz qemu-794e8f301a17953efa78ab7538019ec43c59e82a.tar.xz qemu-794e8f301a17953efa78ab7538019ec43c59e82a.zip | |
exec: factor out duplicate mmap code
Anonymous and file-backed RAM allocation are now almost exactly the same.
Reduce code duplication by moving RAM mmap code out of oslib-posix.c and
exec.c.
Reported-by: Marc-André Lureau <mlureau@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Thibaut Collet <thibaut.collet@6wind.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/qemu/mmap-alloc.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/qemu/mmap-alloc.h b/include/qemu/mmap-alloc.h new file mode 100644 index 0000000000..56388e689b --- /dev/null +++ b/include/qemu/mmap-alloc.h @@ -0,0 +1,10 @@ +#ifndef QEMU_MMAP_ALLOC +#define QEMU_MMAP_ALLOC + +#include "qemu-common.h" + +void *qemu_ram_mmap(int fd, size_t size, size_t align, bool shared); + +void qemu_ram_munmap(void *ptr, size_t size); + +#endif |
