mirror of
https://gitlab.com/qemu-project/qemu.git
synced 2025-10-30 07:57:14 +08:00
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:
committed by
Philippe Mathieu-Daudé
parent
38838f0837
commit
9dbb61bb2c
@ -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
|
||||
|
||||
@ -3899,7 +3899,7 @@ if get_option('b_lto')
|
||||
pagevary = declare_dependency(link_with: pagevary)
|
||||
endif
|
||||
common_ss.add(pagevary)
|
||||
specific_ss.add(files('page-target.c', 'page-vary-target.c'))
|
||||
specific_ss.add(files('page-vary-target.c'))
|
||||
|
||||
common_ss.add(files('target-info.c'))
|
||||
specific_ss.add(files('target-info-stub.c'))
|
||||
|
||||
@ -1,21 +0,0 @@
|
||||
/*
|
||||
* 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);
|
||||
}
|
||||
Reference in New Issue
Block a user