]> Git Repo - qemu.git/blob - include/qemu/mmap-alloc.h
hw/acpi/piix4: Move TYPE_PIIX4_PM to a public header
[qemu.git] / include / qemu / mmap-alloc.h
1 #ifndef QEMU_MMAP_ALLOC_H
2 #define QEMU_MMAP_ALLOC_H
3
4 #include "qemu-common.h"
5
6 size_t qemu_fd_getpagesize(int fd);
7
8 size_t qemu_mempath_getpagesize(const char *mem_path);
9
10 /**
11  * qemu_ram_mmap: mmap the specified file or device.
12  *
13  * Parameters:
14  *  @fd: the file or the device to mmap
15  *  @size: the number of bytes to be mmaped
16  *  @align: if not zero, specify the alignment of the starting mapping address;
17  *          otherwise, the alignment in use will be determined by QEMU.
18  *  @shared: map has RAM_SHARED flag.
19  *  @is_pmem: map has RAM_PMEM flag.
20  *
21  * Return:
22  *  On success, return a pointer to the mapped area.
23  *  On failure, return MAP_FAILED.
24  */
25 void *qemu_ram_mmap(int fd,
26                     size_t size,
27                     size_t align,
28                     bool shared,
29                     bool is_pmem);
30
31 void qemu_ram_munmap(int fd, void *ptr, size_t size);
32
33 #endif
This page took 0.025554 seconds and 4 git commands to generate.