Use MAP_ANON also for FreeBSD (Juergen Lock)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5778 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
blueswir1 2008-11-22 20:43:01 +00:00
parent cdba95bd96
commit 5f8712aa1e
1 changed files with 5 additions and 2 deletions

View File

@ -75,8 +75,10 @@ void qemu_vfree(void *ptr)
#include <sys/types.h>
#include <sys/mount.h>
#else
#ifndef __FreeBSD__
#include <sys/vfs.h>
#endif
#endif
#include <sys/mman.h>
#include <fcntl.h>
@ -87,7 +89,8 @@ static void *kqemu_vmalloc(size_t size)
static int phys_ram_size = 0;
void *ptr;
#ifdef __OpenBSD__ /* no need (?) for a dummy file on OpenBSD */
/* no need (?) for a dummy file on OpenBSD/FreeBSD */
#if defined(__OpenBSD__) || defined(__FreeBSD__)
int map_anon = MAP_ANON;
#else
int map_anon = 0;
@ -154,7 +157,7 @@ static void *kqemu_vmalloc(size_t size)
}
size = (size + 4095) & ~4095;
ftruncate(phys_ram_fd, phys_ram_size + size);
#endif /* !__OpenBSD__ */
#endif /* !(__OpenBSD__ || __FreeBSD__) */
ptr = mmap(NULL,
size,
PROT_WRITE | PROT_READ, map_anon | MAP_SHARED,