[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] FreeBSD Support
From: |
Juergen Lock |
Subject: |
Re: [Qemu-devel] FreeBSD Support |
Date: |
Sat, 24 Feb 2007 20:08:40 +0100 (CET) |
In article <address@hidden> you write:
>-=-=-=-=-=-
>
>Ok FreeBSD Support round one..
>
>Be gentle this is my first attempt at working with the rest of this
>community..
>
>Files it modifies and the reasons are as follows
>
>configure - Adds HOST_FREEBSD type to alter included libraries FreeBSD does
>not need -ltr
>Makefile.target - Once again uses HOST_FREEBSD to avoid including -ltr
>
>osdeps.c - FreeBSD does not have /dev/shm so it uses /tmp for kqemu_valloc
>also sys/vfs.h is not part of freebsd stat information is part of
>mount.h/param.h
>...
Actually the port simply uses mmap MAP_PRIVATE|MAP_ANON, so no
tempfile is used at all (this is files/patch-osdep.c in the port):
Index: qemu/osdep.c
@@ -79,7 +79,9 @@
#if defined(USE_KQEMU)
+#ifndef __FreeBSD__
#include <sys/vfs.h>
+#endif
#include <sys/mman.h>
#include <fcntl.h>
@@ -90,6 +92,7 @@
const char *tmpdir;
char phys_ram_file[1024];
void *ptr;
+#ifndef __FreeBSD__
#ifdef HOST_SOLARIS
struct statvfs stfs;
#else
@@ -151,12 +154,20 @@
}
unlink(phys_ram_file);
}
+#endif
size = (size + 4095) & ~4095;
+#ifndef __FreeBSD__
ftruncate(phys_ram_fd, phys_ram_size + size);
ptr = mmap(NULL,
size,
PROT_WRITE | PROT_READ, MAP_SHARED,
phys_ram_fd, phys_ram_size);
+#else
+ ptr = mmap(NULL,
+ size,
+ PROT_WRITE | PROT_READ, MAP_PRIVATE|MAP_ANON,
+ -1, 0);
+#endif
if (ptr == MAP_FAILED) {
fprintf(stderr, "Could not map physical memory\n");
exit(1);
- Re: [Qemu-devel] QEMU: VNC, (continued)
- Re: [Qemu-devel] QEMU: VNC, Anthony Liguori, 2007/02/19
- Re: [Qemu-devel] QEMU: VNC, Christopher Olsen, 2007/02/19
- Re: [Qemu-devel] QEMU: VNC, Daniel P. Berrange, 2007/02/19
- Re: [Qemu-devel] QEMU: VNC, Johannes Schindelin, 2007/02/19
- Re: [Qemu-devel] QEMU: VNC, Christopher Olsen, 2007/02/19
- [Qemu-devel] FreeBSD Support, Christopher Olsen, 2007/02/19
- Re: [Qemu-devel] FreeBSD Support, Paul Brook, 2007/02/19
- Re: [Qemu-devel] FreeBSD Support, Christopher Olsen, 2007/02/19
- Re: [Qemu-devel] FreeBSD Support, Paul Brook, 2007/02/19
- [Qemu-devel] FreeBSD Support, Christopher Olsen, 2007/02/19
- Re: [Qemu-devel] FreeBSD Support,
Juergen Lock <=
- Re: [Qemu-devel] FreeBSD Support, Leonardo Reiter, 2007/02/24
- Re: [Qemu-devel] FreeBSD Support, andrzej zaborowski, 2007/02/25
- Re: [Qemu-devel] QEMU: VNC, Johannes Schindelin, 2007/02/19
Re: [Qemu-devel] QEMU: VNC, Johannes Schindelin, 2007/02/18
[Qemu-devel] QEMU: VNC, Luke-Jr, 2007/02/22