/[qemu]/qemu/osdep.c
ViewVC logotype

Diff of /qemu/osdep.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by bellard, Mon Feb 21 20:10:36 2005 UTC revision 1.9 by bellard, Sun Apr 17 18:33:47 2005 UTC
# Line 273  void *get_mmap_addr(unsigned long size) Line 273  void *get_mmap_addr(unsigned long size)
273    
274  #else  #else
275    
276  #ifdef _BSD  #ifdef _WIN32
277    #include <windows.h>
278    #elif defined(_BSD)
279  #include <stdlib.h>  #include <stdlib.h>
280  #else  #else
281  #include <malloc.h>  #include <malloc.h>
282  #endif  #endif
 #ifdef _WIN32  
 /* XXX: find a solution to have page aligned data */  
 #define memalign(align, size) malloc(size)  
 #endif  
283    
284  int qemu_write(int fd, const void *buf, size_t n)  int qemu_write(int fd, const void *buf, size_t n)
285  {  {
# Line 308  void *qemu_malloc(size_t size) Line 306  void *qemu_malloc(size_t size)
306      return malloc(size);      return malloc(size);
307  }  }
308    
309  #if defined(USE_KQEMU)  #if defined(_WIN32)
310    
311    void *qemu_vmalloc(size_t size)
312    {
313        /* FIXME: this is not exactly optimal solution since VirtualAlloc
314           has 64Kb granularity, but at least it guarantees us that the
315           memory is page aligned. */
316        return VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE);
317    }
318    
319    void qemu_vfree(void *ptr)
320    {
321        VirtualFree(ptr, 0, MEM_RELEASE);
322    }
323    
324    #elif defined(USE_KQEMU)
325    
326  #include <sys/mman.h>  #include <sys/mman.h>
327  #include <fcntl.h>  #include <fcntl.h>

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26