54b840b37a
port that now also works for the 32 bit "qemu" executable on amd64 (if you build with the KQEMU knob on, you have to deinstall the old kqemu-kmod first if it is installed) - Add an ALL_TARGETS knob that, if turned off, omits the remaining dyngen targets, eliminating the need for gcc 3.4 (everything but ppc and sh4 has been converted to tcg in this snapshot) - Add tcg fixes for amd64 guests on i386 hosts (two of three have been committed to qemu svn in the meantime) [1] - Update the pkg-message about kqemu on amd64, and add a note about using nfs with slirp, the latter [2] - Homepage now at http://bellard.org/qemu/ - update links Submitted by: nox [1] Submitted by: joerg [2]
43 lines
866 B
C
43 lines
866 B
C
Index: qemu/osdep.c
|
|
@@ -68,7 +68,9 @@
|
|
|
|
#if defined(USE_KQEMU)
|
|
|
|
+#ifndef __FreeBSD__
|
|
#include <sys/vfs.h>
|
|
+#endif
|
|
#include <sys/mman.h>
|
|
#include <fcntl.h>
|
|
|
|
@@ -79,6 +81,7 @@
|
|
const char *tmpdir;
|
|
char phys_ram_file[1024];
|
|
void *ptr;
|
|
+#ifndef __FreeBSD__
|
|
#ifdef HOST_SOLARIS
|
|
struct statvfs stfs;
|
|
#else
|
|
@@ -138,7 +141,9 @@
|
|
}
|
|
unlink(phys_ram_file);
|
|
}
|
|
+#endif
|
|
size = (size + 4095) & ~4095;
|
|
+#ifndef __FreeBSD__
|
|
ftruncate(phys_ram_fd, phys_ram_size + size);
|
|
ptr = mmap(NULL,
|
|
size,
|
|
@@ -148,6 +153,13 @@
|
|
fprintf(stderr, "Could not map physical memory\n");
|
|
exit(1);
|
|
}
|
|
+#else
|
|
+ ptr = malloc(size);
|
|
+ if (ptr == NULL) {
|
|
+ fprintf(stderr, "Could not allocate physical memory\n");
|
|
+ exit(1);
|
|
+ }
|
|
+#endif
|
|
phys_ram_size += size;
|
|
return ptr;
|
|
}
|