mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
memory: move preallocation code out of exec.c
So that backends can use it. Since we need the page size for efficiency, move code to compute it out of translate-all.c and into util/oslib-win32.c. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
e1c57ab86f
commit
38183310be
6 changed files with 97 additions and 50 deletions
|
@ -295,14 +295,7 @@ void page_size_init(void)
|
|||
{
|
||||
/* NOTE: we can always suppose that qemu_host_page_size >=
|
||||
TARGET_PAGE_SIZE */
|
||||
#ifdef _WIN32
|
||||
SYSTEM_INFO system_info;
|
||||
|
||||
GetSystemInfo(&system_info);
|
||||
qemu_real_host_page_size = system_info.dwPageSize;
|
||||
#else
|
||||
qemu_real_host_page_size = getpagesize();
|
||||
#endif
|
||||
if (qemu_host_page_size == 0) {
|
||||
qemu_host_page_size = qemu_real_host_page_size;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue