diff options
-rw-r--r-- | exec.c | 11 | ||||
-rw-r--r-- | osdep.c | 13 | ||||
-rw-r--r-- | osdep.h | 1 |
3 files changed, 15 insertions, 10 deletions
@@ -231,16 +231,7 @@ static void page_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 + qemu_real_host_page_size = qemu_getpagesize(); if (qemu_host_page_size == 0) qemu_host_page_size = qemu_real_host_page_size; if (qemu_host_page_size < TARGET_PAGE_SIZE) @@ -66,6 +66,14 @@ void qemu_vfree(void *ptr) VirtualFree(ptr, 0, MEM_RELEASE); } +long qemu_getpagesize(void) +{ + SYSTEM_INFO system_info; + + GetSystemInfo(&system_info); + return system_info.dwPageSize; +} + #else #if defined(USE_KQEMU) @@ -190,6 +198,11 @@ void *qemu_memalign(size_t alignment, size_t size) #endif } +long qemu_getpagesize(void) +{ + return sysconf(_SC_PAGESIZE); +} + /* alloc shared memory pages */ void *qemu_vmalloc(size_t size) { @@ -72,6 +72,7 @@ void *qemu_memalign(size_t alignment, size_t size); void *qemu_vmalloc(size_t size); void qemu_vfree(void *ptr); +long qemu_getpagesize(void); int qemu_create_pidfile(const char *filename); |