mirror of
https://gitlab.com/qemu-project/qemu
synced 2025-04-29 09:22:36 +08:00

Rename to migration_legacy_page_bits, to make it clear that we cannot change the value without causing a migration break. Move to page-vary.h and page-vary-target.c. Define via TARGET_PAGE_BITS if not TARGET_PAGE_BITS_VARY. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
22 lines
477 B
C
22 lines
477 B
C
/*
|
|
* QEMU page values getters (target independent)
|
|
*
|
|
* Copyright (c) 2003 Fabrice Bellard
|
|
*
|
|
* SPDX-License-Identifier: LGPL-2.1-or-later
|
|
*/
|
|
|
|
#include "qemu/osdep.h"
|
|
#include "exec/target_page.h"
|
|
|
|
/* Convert target pages to MiB (2**20). */
|
|
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);
|
|
}
|