mirror of
https://github.com/qemu/qemu.git
synced 2026-04-05 21:50:33 +00:00
page-vary: Build finalize_target_page_bits as common code
Use target_info->page_bits_init to merge finalize_target_page_bits_common into finalize_target_page_bits in page-vary-common.c. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Message-ID: <20260217095106.598486-6-richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
committed by
Philippe Mathieu-Daudé
parent
79674d07d4
commit
eb52c6d769
@@ -40,10 +40,6 @@ typedef struct {
|
||||
uint64_t mask;
|
||||
} TargetPageBits;
|
||||
|
||||
#ifdef IN_PAGE_VARY
|
||||
void finalize_target_page_bits_common(int min);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* set_preferred_target_page_bits:
|
||||
* @bits: number of bits needed to represent an address within the page
|
||||
|
||||
@@ -50,11 +50,18 @@ bool set_preferred_target_page_bits(int bits)
|
||||
return true;
|
||||
}
|
||||
|
||||
void finalize_target_page_bits_common(int min)
|
||||
void finalize_target_page_bits(void)
|
||||
{
|
||||
if (target_page.bits == 0) {
|
||||
target_page.bits = min;
|
||||
int bits = target_page.bits;
|
||||
|
||||
if (bits == 0) {
|
||||
const TargetInfo *ti = target_info();
|
||||
|
||||
bits = ti->page_bits_init;
|
||||
assert(bits != 0);
|
||||
target_page.bits = bits;
|
||||
}
|
||||
target_page.mask = -1ull << target_page.bits;
|
||||
|
||||
target_page.mask = -1ull << bits;
|
||||
target_page.decided = true;
|
||||
}
|
||||
|
||||
@@ -38,15 +38,3 @@ int migration_legacy_page_bits(void)
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void finalize_target_page_bits(void)
|
||||
{
|
||||
#ifndef TARGET_PAGE_BITS_VARY
|
||||
finalize_target_page_bits_common(TARGET_PAGE_BITS);
|
||||
#elif defined(CONFIG_USER_ONLY)
|
||||
assert(target_page.bits != 0);
|
||||
finalize_target_page_bits_common(target_page.bits);
|
||||
#else
|
||||
finalize_target_page_bits_common(TARGET_PAGE_BITS_LEGACY);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user