Commit 5f8712aa1eaeb973baf1f52422ef8eb73ccb258a

Authored by blueswir1
1 parent cdba95bd

Use MAP_ANON also for FreeBSD (Juergen Lock)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5778 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 5 additions and 2 deletions
... ... @@ -75,8 +75,10 @@ void qemu_vfree(void *ptr)
75 75 #include <sys/types.h>
76 76 #include <sys/mount.h>
77 77 #else
  78 +#ifndef __FreeBSD__
78 79 #include <sys/vfs.h>
79 80 #endif
  81 +#endif
80 82  
81 83 #include <sys/mman.h>
82 84 #include <fcntl.h>
... ... @@ -87,7 +89,8 @@ static void *kqemu_vmalloc(size_t size)
87 89 static int phys_ram_size = 0;
88 90 void *ptr;
89 91  
90   -#ifdef __OpenBSD__ /* no need (?) for a dummy file on OpenBSD */
  92 +/* no need (?) for a dummy file on OpenBSD/FreeBSD */
  93 +#if defined(__OpenBSD__) || defined(__FreeBSD__)
91 94 int map_anon = MAP_ANON;
92 95 #else
93 96 int map_anon = 0;
... ... @@ -154,7 +157,7 @@ static void *kqemu_vmalloc(size_t size)
154 157 }
155 158 size = (size + 4095) & ~4095;
156 159 ftruncate(phys_ram_fd, phys_ram_size + size);
157   -#endif /* !__OpenBSD__ */
  160 +#endif /* !(__OpenBSD__ || __FreeBSD__) */
158 161 ptr = mmap(NULL,
159 162 size,
160 163 PROT_WRITE | PROT_READ, map_anon | MAP_SHARED,
... ...