| 1 | /* |
| 2 | * MMAP declarations for QEMU user emulation |
| 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 5 | */ |
| 6 | #ifndef USER_MMAP_H |
| 7 | #define USER_MMAP_H |
| 8 | |
| 9 | #include "user/abitypes.h" |
| 10 | |
| 11 | /* |
| 12 | * mmap_next_start: The base address for the next mmap without hint, |
| 13 | * increased after each successful map, starting at task_unmapped_base. |
| 14 | * This is an optimization within QEMU and not part of ADDR_COMPAT_LAYOUT. |
| 15 | */ |
| 16 | extern abi_ulong mmap_next_start; |
| 17 | |
| 18 | int target_mprotect(abi_ulong start, abi_ulong len, int prot); |
| 19 | |
| 20 | abi_long target_mmap(abi_ulong start, abi_ulong len, int prot, |
| 21 | int flags, int fd, off_t offset); |
| 22 | int target_munmap(abi_ulong start, abi_ulong len); |
| 23 | abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size, |
| 24 | abi_ulong new_size, unsigned long flags, |
| 25 | abi_ulong new_addr); |
| 26 | |
| 27 | abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size, abi_ulong alignment); |
| 28 | |
| 29 | void TSA_NO_TSA mmap_fork_start(void); |
| 30 | void TSA_NO_TSA mmap_fork_end(int child); |
| 31 | |
| 32 | #endif |