user-mmap.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * user-mmap.h: prototypes for linux-user guest binary loader
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #ifndef LINUX_USER_USER_MMAP_H
  18. #define LINUX_USER_USER_MMAP_H
  19. #include "user/mmap.h"
  20. /*
  21. * Guest parameters for the ADDR_COMPAT_LAYOUT personality
  22. * (at present this is the only layout supported by QEMU).
  23. *
  24. * TASK_UNMAPPED_BASE: For mmap without hint (addr != 0), the search
  25. * for unused virtual memory begins at TASK_UNMAPPED_BASE.
  26. *
  27. * ELF_ET_DYN_BASE: When the executable is ET_DYN (i.e. PIE), and requires
  28. * an interpreter (i.e. not -static-pie), use ELF_ET_DYN_BASE instead of
  29. * TASK_UNMAPPED_BASE for selecting the address of the executable.
  30. * This provides some distance between the executable and the interpreter,
  31. * which allows the initial brk to be placed immediately after the
  32. * executable and also have room to grow.
  33. *
  34. * task_unmapped_base, elf_et_dyn_base: When the guest address space is
  35. * limited via -R, the values of TASK_UNMAPPED_BASE and ELF_ET_DYN_BASE
  36. * must be adjusted to fit.
  37. */
  38. extern abi_ulong task_unmapped_base;
  39. extern abi_ulong elf_et_dyn_base;
  40. abi_long target_madvise(abi_ulong start, abi_ulong len_in, int advice);
  41. abi_ulong target_shmat(CPUArchState *cpu_env, int shmid,
  42. abi_ulong shmaddr, int shmflg);
  43. abi_long target_shmdt(abi_ulong shmaddr);
  44. #endif /* LINUX_USER_USER_MMAP_H */