freebsd-ports/emulators/qemu-devel/files/patch-exec.c
Juergen Lock 54b840b37a - Update to 20080620 svn snapshot, which uses the new kqemu-kmod-devel
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]
2008-07-08 18:42:09 +00:00

30 lines
1,001 B
C

Index: qemu/exec.c
@@ -405,6 +405,28 @@
exit(1);
}
}
+#elif defined(__FreeBSD__)
+ {
+ int flags;
+ void *addr = NULL;
+ flags = MAP_PRIVATE | MAP_ANONYMOUS;
+#if defined(__x86_64__)
+ /* FreeBSD doesn't have MAP_32BIT, use MAP_FIXED and assume
+ * 0x40000000 is free */
+ flags |= MAP_FIXED;
+ addr = (void *)0x40000000;
+ /* Cannot map more than that */
+ if (code_gen_buffer_size > (800 * 1024 * 1024))
+ code_gen_buffer_size = (800 * 1024 * 1024);
+#endif
+ code_gen_buffer = mmap(addr, code_gen_buffer_size,
+ PROT_WRITE | PROT_READ | PROT_EXEC,
+ flags, -1, 0);
+ if (code_gen_buffer == MAP_FAILED) {
+ fprintf(stderr, "Could not allocate dynamic translator buffer\n");
+ exit(1);
+ }
+ }
#else
code_gen_buffer = qemu_malloc(code_gen_buffer_size);
if (!code_gen_buffer) {