mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
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>
This commit is contained in:
parent
99982beb4d
commit
f2bb7cf299
2 changed files with 56 additions and 0 deletions
|
@ -236,6 +236,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue