Commit c2b48b69cb80170b749b4252f7eb78acbb370879
1 parent
6f7af85d
Fix -linux-user build by reverting r5701
Unfortunately, -linux-user doesn't use osdep as it replaces some of those functions with specific ones. The code #ifdef code in exec.c needs to remain in place so instead of introducing a qemu_getpagesize() let's just use getpagesize() in the non-Windows implementation of qemu_vmalloc. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5703 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
3 changed files
with
11 additions
and
16 deletions
exec.c
... | ... | @@ -231,7 +231,16 @@ static void page_init(void) |
231 | 231 | { |
232 | 232 | /* NOTE: we can always suppose that qemu_host_page_size >= |
233 | 233 | TARGET_PAGE_SIZE */ |
234 | - qemu_real_host_page_size = qemu_getpagesize(); | |
234 | +#ifdef _WIN32 | |
235 | + { | |
236 | + SYSTEM_INFO system_info; | |
237 | + | |
238 | + GetSystemInfo(&system_info); | |
239 | + qemu_real_host_page_size = system_info.dwPageSize; | |
240 | + } | |
241 | +#else | |
242 | + qemu_real_host_page_size = getpagesize(); | |
243 | +#endif | |
235 | 244 | if (qemu_host_page_size == 0) |
236 | 245 | qemu_host_page_size = qemu_real_host_page_size; |
237 | 246 | if (qemu_host_page_size < TARGET_PAGE_SIZE) | ... | ... |
osdep.c
... | ... | @@ -66,14 +66,6 @@ void qemu_vfree(void *ptr) |
66 | 66 | VirtualFree(ptr, 0, MEM_RELEASE); |
67 | 67 | } |
68 | 68 | |
69 | -long qemu_getpagesize(void) | |
70 | -{ | |
71 | - SYSTEM_INFO system_info; | |
72 | - | |
73 | - GetSystemInfo(&system_info); | |
74 | - return system_info.dwPageSize; | |
75 | -} | |
76 | - | |
77 | 69 | #else |
78 | 70 | |
79 | 71 | #if defined(USE_KQEMU) |
... | ... | @@ -198,11 +190,6 @@ void *qemu_memalign(size_t alignment, size_t size) |
198 | 190 | #endif |
199 | 191 | } |
200 | 192 | |
201 | -long qemu_getpagesize(void) | |
202 | -{ | |
203 | - return sysconf(_SC_PAGESIZE); | |
204 | -} | |
205 | - | |
206 | 193 | /* alloc shared memory pages */ |
207 | 194 | void *qemu_vmalloc(size_t size) |
208 | 195 | { |
... | ... | @@ -213,7 +200,7 @@ void *qemu_vmalloc(size_t size) |
213 | 200 | #ifdef _BSD |
214 | 201 | return valloc(size); |
215 | 202 | #else |
216 | - return memalign(qemu_getpagesize(), size); | |
203 | + return memalign(getpagesize(), size); | |
217 | 204 | #endif |
218 | 205 | } |
219 | 206 | ... | ... |