ports/emulators/qemu/files/patch-osdep.c
Juergen Lock 3c8cb897ad Update to 2007-02-03 snapshot:
- Fix `could not open hard disk image '/dev/ad0'' (e.g.) when open(2)
fails with EPERM instead of EACCES for ro devices.
- PIIX4 support, by Aurelien Jarno.
- Gallileo GT64xxx support, by Aurelien Jarno.
- MIPS Malta system and devices support, by Aurelien Jarno and Stefan Weil.
- ARM ELF loader.
- Improved console handling, thanks Stefan Weil.
- Disable Malta floppy controller for now, by Aurelien Jarno.
- Big endian support for Gallileo, by Aurelien Jarno.
- Add more ATAPI CDROM DMA support, by Juergen Keil.
- Add ARM Angel semihosting to system emulation.
- Don't resume guest when gdb connection terminates and -S specified.
- mips: Implementing dmfc/dmtc.
- Fix DMA timeouts on FreeBSD, by Carlo Marcelo Arenas Belon.
- New multiple snapshot support for VMDK, by Igor Lvovsky.
- Add support for 82371FB (Step A1) and Improved support for 82371SB
(Function 1), by Carlo Marcelo Arenas Belon.
- Accept -help.
- Accept --foo as an alias for -foo.
- Add nodelay option for TCP character devices.
- Use standard character device interface for gdbstub.
- GDB hosted syscalls.
- Upgrade the apic version_id, by Don Laor.
- Save some vm space for the regular program loading zone, by
Pierre d'Herbemont
- script=no for the TUN/TAP net option, by Jean-Christian de Rivaz
- Sparc arm/mips/sparc register patch, by Martin Bochnig.
- PIIX4 SMBus host, EEPROM device emulation, by Ed Swierk.
- sem* and msg* for qemu, by Kirill Shutemov.
- And some more bugfixes.

Approved by:	miwi (mentor, implicit)
2007-02-03 22:15:28 +00:00

40 lines
915 B
C

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);