xref: /qemu/linux-user/user-mmap.h (revision 5136598e2667f35ef3dc1d757616a266bd5eb3a2)
15423e6d3SPeter Maydell /*
25423e6d3SPeter Maydell  * user-mmap.h: prototypes for linux-user guest binary loader
35423e6d3SPeter Maydell  *
45423e6d3SPeter Maydell  *  This program is free software; you can redistribute it and/or modify
55423e6d3SPeter Maydell  *  it under the terms of the GNU General Public License as published by
65423e6d3SPeter Maydell  *  the Free Software Foundation; either version 2 of the License, or
75423e6d3SPeter Maydell  *  (at your option) any later version.
85423e6d3SPeter Maydell  *
95423e6d3SPeter Maydell  *  This program is distributed in the hope that it will be useful,
105423e6d3SPeter Maydell  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
115423e6d3SPeter Maydell  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
125423e6d3SPeter Maydell  *  GNU General Public License for more details.
135423e6d3SPeter Maydell  *
145423e6d3SPeter Maydell  *  You should have received a copy of the GNU General Public License
155423e6d3SPeter Maydell  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
165423e6d3SPeter Maydell  */
175423e6d3SPeter Maydell 
185423e6d3SPeter Maydell #ifndef LINUX_USER_USER_MMAP_H
195423e6d3SPeter Maydell #define LINUX_USER_USER_MMAP_H
205423e6d3SPeter Maydell 
21*1405d7e6SPhilippe Mathieu-Daudé #include "user/mmap.h"
22*1405d7e6SPhilippe Mathieu-Daudé 
23c8fb5cf9SRichard Henderson /*
24c8fb5cf9SRichard Henderson  * Guest parameters for the ADDR_COMPAT_LAYOUT personality
25c8fb5cf9SRichard Henderson  * (at present this is the only layout supported by QEMU).
26c8fb5cf9SRichard Henderson  *
27c8fb5cf9SRichard Henderson  * TASK_UNMAPPED_BASE: For mmap without hint (addr != 0), the search
28c8fb5cf9SRichard Henderson  * for unused virtual memory begins at TASK_UNMAPPED_BASE.
29c8fb5cf9SRichard Henderson  *
30da2b71faSRichard Henderson  * ELF_ET_DYN_BASE: When the executable is ET_DYN (i.e. PIE), and requires
31da2b71faSRichard Henderson  * an interpreter (i.e. not -static-pie), use ELF_ET_DYN_BASE instead of
32da2b71faSRichard Henderson  * TASK_UNMAPPED_BASE for selecting the address of the executable.
33da2b71faSRichard Henderson  * This provides some distance between the executable and the interpreter,
34da2b71faSRichard Henderson  * which allows the initial brk to be placed immediately after the
35da2b71faSRichard Henderson  * executable and also have room to grow.
36da2b71faSRichard Henderson  *
37da2b71faSRichard Henderson  * task_unmapped_base, elf_et_dyn_base: When the guest address space is
38da2b71faSRichard Henderson  * limited via -R, the values of TASK_UNMAPPED_BASE and ELF_ET_DYN_BASE
39da2b71faSRichard Henderson  * must be adjusted to fit.
40c8fb5cf9SRichard Henderson  */
41c8fb5cf9SRichard Henderson extern abi_ulong task_unmapped_base;
42da2b71faSRichard Henderson extern abi_ulong elf_et_dyn_base;
43c8fb5cf9SRichard Henderson 
44892a4f6aSIlya Leoshkevich abi_long target_madvise(abi_ulong start, abi_ulong len_in, int advice);
455423e6d3SPeter Maydell 
46225a206cSRichard Henderson abi_ulong target_shmat(CPUArchState *cpu_env, int shmid,
47225a206cSRichard Henderson                        abi_ulong shmaddr, int shmflg);
48225a206cSRichard Henderson abi_long target_shmdt(abi_ulong shmaddr);
49225a206cSRichard Henderson 
505423e6d3SPeter Maydell #endif /* LINUX_USER_USER_MMAP_H */
51