diff options
| author | Richard Henderson <richard.henderson@linaro.org> | 2023-07-07 21:40:44 +0100 |
|---|---|---|
| committer | Richard Henderson <richard.henderson@linaro.org> | 2023-07-15 08:02:32 +0100 |
| commit | f2bb7cf29991121e427883f26f9737a409f56ee7 (patch) | |
| tree | 3cb6811e0086a736cc7a426df57d4e5750e0e2ee /include/exec/cpu-all.h | |
| parent | 99982beb4d0030470aa761b8b7bc6dc66c39a707 (diff) | |
| download | focaccia-qemu-f2bb7cf29991121e427883f26f9737a409f56ee7.tar.gz focaccia-qemu-f2bb7cf29991121e427883f26f9737a409f56ee7.zip | |
accel/tcg: Introduce page_find_range_empty
Use the interval tree to locate an unused range in the VM. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230707204054.8792-17-richard.henderson@linaro.org>
Diffstat (limited to 'include/exec/cpu-all.h')
| -rw-r--r-- | include/exec/cpu-all.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 94f828b109..eb1c54701a 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -237,6 +237,21 @@ int page_check_range(target_ulong start, target_ulong len, int flags); bool page_check_range_empty(target_ulong start, target_ulong last); /** + * page_find_range_empty + * @min: first byte of search range + * @max: last byte of search range + * @len: size of the hole required + * @align: alignment of the hole required (power of 2) + * + * If there is a range [x, x+@len) within [@min, @max] such that + * x % @align == 0, then return x. Otherwise return -1. + * The memory lock must be held, as the caller will want to ensure + * the returned range stays empty until a new mapping can be installed. + */ +target_ulong page_find_range_empty(target_ulong min, target_ulong max, + target_ulong len, target_ulong align); + +/** * page_get_target_data(address) * @address: guest virtual address * |