diff options
author | Pav Lucistnik <pav@FreeBSD.org> | 2005-05-05 12:41:10 +0000 |
---|---|---|
committer | Pav Lucistnik <pav@FreeBSD.org> | 2005-05-05 12:41:10 +0000 |
commit | 8ca48ff8979e6c7a1377bf6d55a9dc0a230c29c5 (patch) | |
tree | 3916ca087ea065ad456125c7b5bc216c73253ce6 /emulators/qemu/files/patch-osdep.c | |
parent | - update to 1.29 (diff) |
- Update to 2005-05-02 snapshot
- Add kqemu support
PR: ports/80595
Submitted by: Juergen Lock <nox@jelal.kn-bremen.de> (maintainer)
Diffstat (limited to 'emulators/qemu/files/patch-osdep.c')
-rw-r--r-- | emulators/qemu/files/patch-osdep.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/emulators/qemu/files/patch-osdep.c b/emulators/qemu/files/patch-osdep.c new file mode 100644 index 000000000000..3d5382b50c51 --- /dev/null +++ b/emulators/qemu/files/patch-osdep.c @@ -0,0 +1,40 @@ +Index: qemu/osdep.c +@@ -323,7 +323,9 @@ + + #elif defined(USE_KQEMU) + ++#ifndef __FreeBSD__ + #include <sys/vfs.h> ++#endif + #include <sys/mman.h> + #include <fcntl.h> + +@@ -334,6 +336,7 @@ + const char *tmpdir; + char phys_ram_file[1024]; + void *ptr; ++#ifndef __FreeBSD__ + struct statfs stfs; + + if (phys_ram_fd < 0) { +@@ -389,12 +392,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); |