master
h 37 lines 949 Bytes
Raw
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 #ifndef USER_PROBE_GUEST_BASE_H
4 #define USER_PROBE_GUEST_BASE_H
5
6 #ifndef CONFIG_USER_ONLY
7 #error Cannot include this header from system emulation
8 #endif
9
10 #include "exec/vaddr.h"
11
12 typedef struct PGBRange {
13 vaddr lo;
14 vaddr hi;
15 } PGBRange;
16
17 /**
18 * probe_guest_base:
19 * @image_name: the executable being loaded
20 * @image_range: the fixed addresses within the executable
21 *
22 * Creates the initial guest address space in the host memory space.
23 *
24 * If @image_range is NULL, then no address in the executable is fixed,
25 * i.e. it is fully relocatable.
26 *
27 * This function will not return if a valid value for guest_base
28 * cannot be chosen. On return, the executable loader can expect
29 *
30 * target_mmap(i->lo, i->hi - i->lo + 1, ...)
31 *
32 * to succeed.
33 */
34 void probe_guest_base(const char *image_name, const PGBRange *image_range,
35 const PGBRange *commpage_range);
36
37 #endif