Commit c2b48b69cb80170b749b4252f7eb78acbb370879

Authored by aliguori
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
@@ -231,7 +231,16 @@ static void page_init(void) @@ -231,7 +231,16 @@ static void page_init(void)
231 { 231 {
232 /* NOTE: we can always suppose that qemu_host_page_size >= 232 /* NOTE: we can always suppose that qemu_host_page_size >=
233 TARGET_PAGE_SIZE */ 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 if (qemu_host_page_size == 0) 244 if (qemu_host_page_size == 0)
236 qemu_host_page_size = qemu_real_host_page_size; 245 qemu_host_page_size = qemu_real_host_page_size;
237 if (qemu_host_page_size < TARGET_PAGE_SIZE) 246 if (qemu_host_page_size < TARGET_PAGE_SIZE)
@@ -66,14 +66,6 @@ void qemu_vfree(void *ptr) @@ -66,14 +66,6 @@ void qemu_vfree(void *ptr)
66 VirtualFree(ptr, 0, MEM_RELEASE); 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 #else 69 #else
78 70
79 #if defined(USE_KQEMU) 71 #if defined(USE_KQEMU)
@@ -198,11 +190,6 @@ void *qemu_memalign(size_t alignment, size_t size) @@ -198,11 +190,6 @@ void *qemu_memalign(size_t alignment, size_t size)
198 #endif 190 #endif
199 } 191 }
200 192
201 -long qemu_getpagesize(void)  
202 -{  
203 - return sysconf(_SC_PAGESIZE);  
204 -}  
205 -  
206 /* alloc shared memory pages */ 193 /* alloc shared memory pages */
207 void *qemu_vmalloc(size_t size) 194 void *qemu_vmalloc(size_t size)
208 { 195 {
@@ -213,7 +200,7 @@ void *qemu_vmalloc(size_t size) @@ -213,7 +200,7 @@ void *qemu_vmalloc(size_t size)
213 #ifdef _BSD 200 #ifdef _BSD
214 return valloc(size); 201 return valloc(size);
215 #else 202 #else
216 - return memalign(qemu_getpagesize(), size); 203 + return memalign(getpagesize(), size);
217 #endif 204 #endif
218 } 205 }
219 206
@@ -72,7 +72,6 @@ @@ -72,7 +72,6 @@
72 void *qemu_memalign(size_t alignment, size_t size); 72 void *qemu_memalign(size_t alignment, size_t size);
73 void *qemu_vmalloc(size_t size); 73 void *qemu_vmalloc(size_t size);
74 void qemu_vfree(void *ptr); 74 void qemu_vfree(void *ptr);
75 -long qemu_getpagesize(void);  
76 75
77 int qemu_create_pidfile(const char *filename); 76 int qemu_create_pidfile(const char *filename);
78 77