include/exec/target_page.h: move page-target.c to header
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20250730220519.1140447-3-pierrick.bouvier@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
parent
38838f0837
commit
9dbb61bb2c
3 changed files with 11 additions and 23 deletions
|
|
@ -62,6 +62,15 @@ static inline int qemu_target_page_bits(void)
|
|||
return TARGET_PAGE_BITS;
|
||||
}
|
||||
|
||||
size_t qemu_target_pages_to_MiB(size_t pages);
|
||||
/* Convert target pages to MiB (2**20). */
|
||||
static inline size_t qemu_target_pages_to_MiB(size_t pages)
|
||||
{
|
||||
int page_bits = TARGET_PAGE_BITS;
|
||||
|
||||
/* So far, the largest (non-huge) page size is 64k, i.e. 16 bits. */
|
||||
g_assert(page_bits < 20);
|
||||
|
||||
return pages >> (20 - page_bits);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue