summaryrefslogtreecommitdiff
path: root/emulators/qemu-devel/files/patch-exec.c
diff options
context:
space:
mode:
authorJuergen Lock <nox@FreeBSD.org>2008-07-08 18:42:09 +0000
committerJuergen Lock <nox@FreeBSD.org>2008-07-08 18:42:09 +0000
commit54b840b37a44ced448a8ad0f47740ce08278f643 (patch)
treed4801d39b61ef12632cbef1176de598a3d1658c2 /emulators/qemu-devel/files/patch-exec.c
parent- New port: plt-scheme (diff)
- 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]
Notes
Notes: svn path=/head/; revision=216547
Diffstat (limited to 'emulators/qemu-devel/files/patch-exec.c')
-rw-r--r--emulators/qemu-devel/files/patch-exec.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/emulators/qemu-devel/files/patch-exec.c b/emulators/qemu-devel/files/patch-exec.c
new file mode 100644
index 000000000000..64fc4723e24b
--- /dev/null
+++ b/emulators/qemu-devel/files/patch-exec.c
@@ -0,0 +1,30 @@
+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) {