]> git.proxmox.com Git - mirror_qemu.git/blame - include/qemu/mmap-alloc.h
Include qemu-common.h exactly where needed
[mirror_qemu.git] / include / qemu / mmap-alloc.h
CommitLineData
2a6a4076
MA
1#ifndef QEMU_MMAP_ALLOC_H
2#define QEMU_MMAP_ALLOC_H
794e8f30 3
794e8f30 4
7197fb40
MT
5size_t qemu_fd_getpagesize(int fd);
6
9c607668
AK
7size_t qemu_mempath_getpagesize(const char *mem_path);
8
2ac0f162
ZY
9/**
10 * qemu_ram_mmap: mmap the specified file or device.
11 *
12 * Parameters:
13 * @fd: the file or the device to mmap
14 * @size: the number of bytes to be mmaped
15 * @align: if not zero, specify the alignment of the starting mapping address;
16 * otherwise, the alignment in use will be determined by QEMU.
17 * @shared: map has RAM_SHARED flag.
18 * @is_pmem: map has RAM_PMEM flag.
19 *
20 * Return:
21 * On success, return a pointer to the mapped area.
22 * On failure, return MAP_FAILED.
23 */
24void *qemu_ram_mmap(int fd,
25 size_t size,
26 size_t align,
27 bool shared,
28 bool is_pmem);
794e8f30 29
53adb9d4 30void qemu_ram_munmap(int fd, void *ptr, size_t size);
794e8f30
MT
31
32#endif