summaryrefslogtreecommitdiff
path: root/emulators
diff options
context:
space:
mode:
authorhasso <hasso@pkgsrc.org>2009-08-31 10:18:49 +0000
committerhasso <hasso@pkgsrc.org>2009-08-31 10:18:49 +0000
commit1d2f4066d7dcbafca8712accd3dce249ec409e52 (patch)
treee20d832bf5c2731c5731af61630a43b795a47f38 /emulators
parente76fcf60527551a60ca04aad756767d539526459 (diff)
downloadpkgsrc-1d2f4066d7dcbafca8712accd3dce249ec409e52.tar.gz
Update to 0.10.6. Tested on DragonFly only.
version 0.10.6: - e1000: ignore reset command (Kevin Wolf) - fix VNC memory allocation (Stefan Weil) - fix raw_pread_aligned return value (Christoph Hellwig) - allow monitor interaction when using -incoming exec: (Chris Lalancette) - fix -net socket,listen (Jan Kiszka) - live migration: don't send gratuitous packets all at once (Gleb Natapov) - serial: fix lost characters after sysrq (Jason Wessel) - Fix prototype of zfree (Stefan Weil) - Handle EINTR with exec: migration (Uri Lublin) - Delete io-handler before closing fd after migration (Uri Lublin) - Fix qemu_aio_flush (Andrea Arcangeli) - lsi53c895a: Implement additional registers (Sebastian Herbszt) - virtio-blk: fix warning (Gerd Hoffman) - i386: fix cpu reset (Nitin Kamble) - kvm: fix irq injection into full queue (Jan Kiszka) - Prevent CD-ROM eject while device is locked (Mark McLoughlin) - Fix screen dump with blank screen (Eduardo Habkost) - Fix memory leak with cpu_unregister_map_client (Isaku Yamahata) - Fix memory leak in SDL (Jan Kiszka) - Fix build on OS X 10.4 (John Arbuckle) - Fix leak of vlan clients after hot remove (Mark McLoughlin) - Fix migration after hot remove with eepro100 (Mark McLoughlin) - Don't start a VM after failed migration if stopped (Anthony Liguori) - Fix live migration under heavy IO load (Glauber Costa) - Honor -S on incoming migration (Paolo Bonzini) - Reset HPET config register on reset (Beth Kon) - Reset PS2 keyboard/mouse on reset (Dinesh Subraveti) version 0.10.5: - kvm: trim unsupported cpu features from cpuid (Avi Kivity) - kvm: provide a better error message for -smp > 1 (Mark McLoughlin) - Remove initrd printfs (Richard Jones) - Initial variables found by valgrind (Jean-Christophe Dubois) - Fix -initrd with > 4GB guests (Glauber Costa) - Fix busy loop on live migration for certain platforms (Uri Lublin) - Remove GCC 3.x requirements from docs (Hollis Blanchard) - ETRAX: fixes for kernel command line, ethernet address, bmi (Edgar Iglesias) - CRIS: Fix bmi (Edgar Iglesias) - Fix bounce buffer errors (Avi Kivity) - Fix regression in -kernel (Anthony Liguori) version 0.10.4: - Improve block range checks to remove integer overflow (Kevin Wolf) - e1000: do not re-init PCI config space 0 (Amit Shah) - fix AIO deletion race (Alex Graf) - reset option roms on reboot (Glauber Costa) - fix qcow2 corruption in cluster freeing (Gleb Natapov) - Enable power button event generation (Gleb Natapov) version 0.10.3: - fix AIO cancellations (Avi Kivity) - fix live migration error path on incoming - avoid SEGV on pci hotplug failure (Chris Wright) - fix serial option in -drive - support DDIM for option roms (Glauber Costa) - avoid fork/exec on pre-2.6.27 kernels with KVM (Jan Kiszka) - block-vpc: don't silently create smaller images than requested (Kevin Wolf) - Fix non-ACPI timer interrupt routing (Beth Kon) - hpet: fix emulation of HPET_TN_SETVAL (Jan Kiszka) - kvm: fix cpuid initialization (Jan Kiszka) - qcow2: fix corruption on little endian hosts (Kevin Wolf) - avoid leaing memory on hot unplug (Mark McLoughlin) - fix savevm/migration after hot unplug (Mark McLoughlin) - Fix keyboard mapping on newer Xords with non-default keymaps (balrog) - Make PCI config status register read-only (Anthony Liguori) - Fix crash on resolution change -> screen dump -> vga redraw (Avi Kivity) version 0.10.2: - fix savevm/loadvm (Anthony Liguori) - live migration: fix dirty tracking windows (Glauber Costa) - live migration: improve error propogation (Glauber Costa) - qcow2: fix image creation for > ~2TB images (Chris Wright) - hotplug: fix error handling for if= parameter (Eduardo Habkost) - qcow2: fix data corruption (Nolan Leake) - virtio: fix guest oops with 2.6.25 kernels (Rusty Russell) - SH4: add support for -kernel (Takashi Yoshii, Aurelien Jarno) - hotplug: fix closing of char devices (Jan Kiszka) - hotplug: remove incorrect check for device name (Eduardo Habkost) - enable -k on win32 (Herve Poussineau) - configure: use LANG=C for grep (Andreas Faerber) - fix VGA regression (malc) version 0.10.1: - virtio-net: allow masking of notifications on empty queue (Alex Williamson) - e1000: fix rx descriptor low threshold logic (Alex Willaimson) - x86 tcg: add NULL checks to lsl instruction (Jan Kiszka) - kvm vga: fix screen corruption with -std-vga and Windows (Avi Kivity) - kvm vga: fix screen corruption with Ubuntu installations (Glauber Costa) - virtio-net: check right return size on sg list (Alex Williamson) - Make qemu_announce_self handle holes (live migration after hotplug) (Marcelo Tosatti) - Revert r6804-r6808 (qcow2 allocation info). This series of changes added a high cost to startup for large qcow2 images (Anthony Liguori) - qemu-img: fix help message (Aurelien Jarno) - Fix build for non-default installs of SDL (Anthony Liguori) - Fix race condition in env->interrupt_request. When using TCG and a dynticks host timer, this condition could cause TCG to get stuck in an infinite loop (Aurelien Jarno) - Fix reading encrypted hard disk passwords during early startup (Jan Kiszka) - Fix encrypted disk reporting in 'info block' (Jan Kiszka) - Fix console size with tiny displays (MusicPal) (Jan Kiszka) - Improve error handling in bdrv_open2 (Jan Kiszka) - Avoid leaking data in mux'ed character devices (Jan Kiszka) - Fix initial character device reset (no banner in monitor) (Jan Kiszka) - Fix cpuid KVM crash on i386 host (Lubomir Rintel) - Fix SLES10sp2 installation by adding ISTAT1 register to LSI SCSI emulation (Ryan Harper) version 0.10.0: - TCG support (No longer requires GCC 3.x) - Kernel Virtual Machine acceleration support - BSD userspace emulation - Bluetooth emulation and host passthrough support - GDB XML register description support - Intel e1000 emulation - HPET emulation - VirtIO paravirtual device support - Marvell 88w8618 / MusicPal emulation - Nokia N-series tablet emulation / OMAP2 processor emulation - PCI hotplug support - Live migration and new save/restore formats - Curses display support - qemu-nbd utility to mount supported block formats - Altivec support in PPC emulation and new firmware (OpenBIOS) - Multiple VNC clients are now supported - TLS encryption is now supported in VNC - MIPS Magnum R4000 machine (Hervé Poussineau) - Braille support (Samuel Thibault) - Freecom MusicPal system emulation (Jan Kiszka) - OMAP242x and Nokia N800, N810 machines (Andrzej Zaborowski) - EsounD audio driver (Frederick Reeve) - Gravis Ultrasound GF1 sound card (Tibor "TS" Schütz) - Many, many, bug fixes and new features
Diffstat (limited to 'emulators')
-rw-r--r--emulators/qemu/Makefile42
-rw-r--r--emulators/qemu/PLIST8
-rw-r--r--emulators/qemu/distinfo32
-rw-r--r--emulators/qemu/patches/patch-aa26
-rw-r--r--emulators/qemu/patches/patch-ab26
-rw-r--r--emulators/qemu/patches/patch-ac73
-rw-r--r--emulators/qemu/patches/patch-ad15
-rw-r--r--emulators/qemu/patches/patch-ae12
-rw-r--r--emulators/qemu/patches/patch-ag77
-rw-r--r--emulators/qemu/patches/patch-ak57
-rw-r--r--emulators/qemu/patches/patch-am13
-rw-r--r--emulators/qemu/patches/patch-aw24
-rw-r--r--emulators/qemu/patches/patch-ax24
-rw-r--r--emulators/qemu/patches/patch-ay92
-rw-r--r--emulators/qemu/patches/patch-da13
-rw-r--r--emulators/qemu/patches/patch-db32
-rw-r--r--emulators/qemu/patches/patch-dc15
-rw-r--r--emulators/qemu/patches/patch-dd29
-rw-r--r--emulators/qemu/patches/patch-de13
-rw-r--r--emulators/qemu/patches/patch-df13
-rw-r--r--emulators/qemu/patches/patch-dg22
-rw-r--r--emulators/qemu/patches/patch-dh58
-rw-r--r--emulators/qemu/patches/patch-di13
-rw-r--r--emulators/qemu/patches/patch-dj43
-rw-r--r--emulators/qemu/patches/patch-dk33
-rw-r--r--emulators/qemu/patches/patch-dl29
-rw-r--r--emulators/qemu/patches/patch-dm13
27 files changed, 364 insertions, 483 deletions
diff --git a/emulators/qemu/Makefile b/emulators/qemu/Makefile
index 0924bb74e77..3c508285cbd 100644
--- a/emulators/qemu/Makefile
+++ b/emulators/qemu/Makefile
@@ -1,13 +1,12 @@
-# $NetBSD: Makefile,v 1.56 2009/05/13 19:02:18 kefren Exp $
+# $NetBSD: Makefile,v 1.57 2009/08/31 10:18:49 hasso Exp $
#
-DISTNAME= qemu-0.9.1
-PKGREVISION= 1
+DISTNAME= qemu-0.10.6
CATEGORIES= emulators
-MASTER_SITES= http://bellard.org/qemu/
+MASTER_SITES= http://download.savannah.gnu.org/releases/qemu/
MAINTAINER= pkgsrc-users@NetBSD.org
-HOMEPAGE= http://bellard.org/qemu/
+HOMEPAGE= http://www.nongnu.org/qemu/
COMMENT= CPU emulator using dynamic translation
PKG_DESTDIR_SUPPORT= user-destdir
@@ -22,16 +21,10 @@ BUILD_DEPENDS+= texi2html-[0-9]*:../../textproc/texi2html
# Workaround for PR/41007 - ensure WRKSRC comes before any buildlinked
# directories so we pickup our audio/audio.h. Cannot use CPPFLAGS for this
-CFLAGS+= -I${WRKSRC}
+CFLAGS+= -I${WRKSRC} -I${WRKSRC}/slirp
.include "../../mk/bsd.prefs.mk"
-GCC_REQD+= 3.0
-
-.if !empty(MACHINE_PLATFORM:MNetBSD-[4-9]*)
-USE_PKGSRC_GCC= yes
-.endif
-
CONFIGURE_ENV+= PKGMANDIR=${PKGMANDIR}
CONFIGURE_ARGS+= --prefix=${PREFIX:Q}
CONFIGURE_ARGS+= --interp-prefix=${PREFIX:Q}/share/qemu
@@ -56,27 +49,20 @@ SUBST_FILES.smbd= vl.c
SUBST_SED.smbd= -e s,/usr/sbin/smbd,${PREFIX:Q}/sbin/smbd,g
SUBST_MESSAGE.smbd= Fixing hardcoded paths.
-REPLACE_PERL+= texi2pod.pl
+pre-patch:
+ mv ${WRKSRC}/audio/audio.h ${WRKSRC}/audio/qaudio.h
+
+SUBST_CLASSES+= qaudio
+SUBST_STAGE.qaudio= pre-configure
+SUBST_FILES.qaudio= *.c audio/*.c hw/*.c
+SUBST_SED.qaudio= -e s,audio.h\",qaudio.h\",g
+SUBST_MESSAGE.qaudio= Fixing audio.h confusion
-# Remove -march/-mcpu from CFLAGS, otherwise it will fail
-# to build in the SSE code.
-BUILDLINK_TRANSFORM+= rm-optarg:-march rm-optarg:-mcpu rm:-msse rm:-msse2
+REPLACE_PERL+= texi2pod.pl
BUILDLINK_PASSTHRU_DIRS+= /usr/lib
BUILDLINK_PASSTHRU_RPATHDIRS+= /usr/lib
-# Does not build with the stack protector
-.if ${OPSYS} == "DragonFly"
-CFLAGS+= -fno-stack-protector
-.endif
-
-.include "../../mk/compiler.mk"
-
-.if !empty(CC_VERSION:Mgcc-4*)
-CONFIGURE_ARGS+= --disable-gcc-check
-.endif
-
-
INSTALLATION_DIRS= ${PKGMANDIR}/man1 share/doc/qemu
post-install:
diff --git a/emulators/qemu/PLIST b/emulators/qemu/PLIST
index 9016764d24b..3b441965057 100644
--- a/emulators/qemu/PLIST
+++ b/emulators/qemu/PLIST
@@ -1,6 +1,7 @@
-@comment $NetBSD: PLIST,v 1.18 2009/06/14 17:51:07 joerg Exp $
+@comment $NetBSD: PLIST,v 1.19 2009/08/31 10:18:49 hasso Exp $
bin/qemu
bin/qemu-img
+bin/qemu-sparc64
bin/qemu-system-arm
bin/qemu-system-cris
bin/qemu-system-m68k
@@ -17,9 +18,11 @@ bin/qemu-system-sparc
bin/qemu-system-x86_64
man/man1/qemu-img.1
man/man1/qemu.1
+man/man8/qemu-nbd.8
share/doc/qemu/Makefile.multinode-NetBSD
share/doc/qemu/qemu-doc.html
share/doc/qemu/qemu-tech.html
+share/qemu/bamboo.dtb
share/qemu/bios.bin
share/qemu/keymaps/ar
share/qemu/keymaps/common
@@ -56,8 +59,11 @@ share/qemu/keymaps/sl
share/qemu/keymaps/sv
share/qemu/keymaps/th
share/qemu/keymaps/tr
+share/qemu/openbios-ppc
share/qemu/openbios-sparc32
+share/qemu/openbios-sparc64
share/qemu/ppc_rom.bin
+share/qemu/pxe-e1000.bin
share/qemu/pxe-ne2k_pci.bin
share/qemu/pxe-pcnet.bin
share/qemu/pxe-rtl8139.bin
diff --git a/emulators/qemu/distinfo b/emulators/qemu/distinfo
index cd4beecc2a4..c72b8eaf13f 100644
--- a/emulators/qemu/distinfo
+++ b/emulators/qemu/distinfo
@@ -1,20 +1,22 @@
-$NetBSD: distinfo,v 1.42 2009/05/13 19:02:18 kefren Exp $
+$NetBSD: distinfo,v 1.43 2009/08/31 10:18:49 hasso Exp $
-SHA1 (qemu-0.9.1.tar.gz) = 630ea20b5989f0df00128de7f7be661c573ed041
-RMD160 (qemu-0.9.1.tar.gz) = ee7bdb55a4540df2082d4bde9ebfd2f4e6f201a5
-Size (qemu-0.9.1.tar.gz) = 2804104 bytes
-SHA1 (patch-aa) = 455575215bad8864da285e1979da9ff7d8476a24
-SHA1 (patch-ab) = ba77da578f528ca549c48336b40378dcbb2a2fbb
-SHA1 (patch-ac) = 3d73b46db4f824d16d40472cc3bd516599469966
-SHA1 (patch-ad) = ac69a03e4945e8c8fd5aadca070b876d0970910d
-SHA1 (patch-ae) = a82f6c1a02c6bc03f4da9bc2b52f817b260ced8a
-SHA1 (patch-ag) = 3469af1ec2a4f95c09a67c16b1071f0ec27dab74
-SHA1 (patch-ak) = ed5766e36d5a192cf4559142e6ef9e0287e61b43
-SHA1 (patch-am) = a22a3b23284c377afa8113768d68c8ef40c514f9
+SHA1 (qemu-0.10.6.tar.gz) = 9432738ba513e07c981097468945b2e3ad9cb81e
+RMD160 (qemu-0.10.6.tar.gz) = 1321a10777d2e0c6b53887d0525a28cc1b36ec9b
+Size (qemu-0.10.6.tar.gz) = 3664559 bytes
SHA1 (patch-ao) = e515093b6ea99f9cba665de022fd62f3be911569
SHA1 (patch-au) = 2892cae63796c76014288f4a700acbee5aadc529
SHA1 (patch-av) = 715e9680d70c1aa1c83bda0270125144a26d6140
-SHA1 (patch-aw) = f3bc77cdec3a876fa69406c91590d02161e80753
-SHA1 (patch-ax) = 66b060005ecbf9fd0451f7960e81eccbabf959ca
-SHA1 (patch-ay) = f41e230bd0fef6437aa187b346fc06ef4f32a31c
SHA1 (patch-ba) = 7c5043a39405f52b512e479a46fc76108580b7bc
+SHA1 (patch-da) = 994eb51de1e7398acf95189da182f755f2ca65e1
+SHA1 (patch-db) = 7e729851615598646aa3f2d7278147198d0a7a45
+SHA1 (patch-dc) = 508d40a99242ba025ade0d067e6d44d3a8a4f0cc
+SHA1 (patch-dd) = 98133e7526441ddea5647c006f146474fcd59826
+SHA1 (patch-de) = b06cb5d29069ebbbc7e78c35798332493c8c9143
+SHA1 (patch-df) = f21a7832e2cc94dbe76626b74455d33f5ca50ee5
+SHA1 (patch-dg) = f315471d1353504e8bb0032cdf019634c3ce88a5
+SHA1 (patch-dh) = c4c1882c81cdbe9d98fc50e8f60f8d233a7882c5
+SHA1 (patch-di) = 96552e11794deb726cc027c41e06a378510ef534
+SHA1 (patch-dj) = 78b2cc5ba2360a7237de2207365547b84867d070
+SHA1 (patch-dk) = e8fe4d8435ed8865ab74f231e9c1dc91dab629ce
+SHA1 (patch-dl) = 9141ded6d9440863ffa0772b639f2c76b3320e4a
+SHA1 (patch-dm) = 3786ee9dfa46648f773f06c683bccd574c5ee2cb
diff --git a/emulators/qemu/patches/patch-aa b/emulators/qemu/patches/patch-aa
deleted file mode 100644
index 108f238991c..00000000000
--- a/emulators/qemu/patches/patch-aa
+++ /dev/null
@@ -1,26 +0,0 @@
-$NetBSD: patch-aa,v 1.3 2004/12/14 01:02:19 dbj Exp $
-
---- bswap.h.orig Sun Nov 14 15:51:33 2004
-+++ bswap.h
-@@ -5,6 +5,12 @@
-
- #include <inttypes.h>
-
-+#ifdef HAVE_MACHINE_BSWAP_H
-+#include <sys/endian.h>
-+#include <sys/types.h>
-+#include <machine/bswap.h>
-+#else
-+
- #ifdef HAVE_BYTESWAP_H
- #include <byteswap.h>
- #else
-@@ -57,6 +63,8 @@ static inline uint64_t bswap64(uint64_t
- {
- return bswap_64(x);
- }
-+
-+#endif /* ! HAVE_MACHINE_BSWAP_H */
-
- static inline void bswap16s(uint16_t *s)
- {
diff --git a/emulators/qemu/patches/patch-ab b/emulators/qemu/patches/patch-ab
deleted file mode 100644
index d0a033f0119..00000000000
--- a/emulators/qemu/patches/patch-ab
+++ /dev/null
@@ -1,26 +0,0 @@
-$NetBSD: patch-ab,v 1.9 2009/01/22 07:27:28 jmmv Exp $
-
---- Makefile.target.orig 2008-01-06 20:38:41.000000000 +0100
-+++ Makefile.target
-@@ -115,6 +115,10 @@ OP_CFLAGS+=$(call cc-option, -fno-align-
- OP_CFLAGS+=$(call cc-option, -fno-align-functions, $(call cc-option, -malign-functions=0, ""))
- OP_CFLAGS+=$(call cc-option, -fno-section-anchors, "")
-
-+ifdef STACK_PROTECTOR_PRESENT
-+OP_CFLAGS+=$(call cc-option, -fno-stack-protector, "")
-+endif
-+
- ifeq ($(ARCH),i386)
- HELPER_CFLAGS+=-fomit-frame-pointer
- OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer
-@@ -537,7 +541,9 @@ endif
- ifndef CONFIG_DARWIN
- ifndef CONFIG_WIN32
- ifndef CONFIG_SOLARIS
--VL_LIBS+=-lutil
-+ifndef CONFIG_DRAGONFLY
-+VL_LIBS+=-lutil -lrt
-+endif
- endif
- endif
- endif
diff --git a/emulators/qemu/patches/patch-ac b/emulators/qemu/patches/patch-ac
deleted file mode 100644
index d737c1e4ee2..00000000000
--- a/emulators/qemu/patches/patch-ac
+++ /dev/null
@@ -1,73 +0,0 @@
-$NetBSD: patch-ac,v 1.11 2009/05/13 19:02:18 kefren Exp $
-
---- vl.c.orig 2008-01-06 21:38:42.000000000 +0200
-+++ vl.c 2009-05-13 21:49:15.000000000 +0300
-@@ -61,7 +61,7 @@
- #include <arpa/inet.h>
- #ifdef _BSD
- #include <sys/stat.h>
--#ifndef __APPLE__
-+#ifndef _BSD
- #include <libutil.h>
- #endif
- #elif defined (__GLIBC__) && defined (__FreeBSD_kernel__)
-@@ -2385,6 +2385,9 @@
-
- static int pp_ioctl(CharDriverState *chr, int cmd, void *arg)
- {
-+#ifdef __NetBSD__
-+ return ENOTSUP;
-+#endif
- ParallelCharDriver *drv = chr->opaque;
- int fd = drv->fd;
- uint8_t b;
-@@ -2473,6 +2476,9 @@
-
- static CharDriverState *qemu_chr_open_pp(const char *filename)
- {
-+#ifdef __NetBSD__
-+ return ENOTSUP;
-+#endif
- CharDriverState *chr;
- ParallelCharDriver *drv;
- int fd;
-@@ -4877,13 +4883,14 @@
- int bus_id, unit_id;
- int cyls, heads, secs, translation;
- BlockDriverState *bdrv;
-+ BlockDriver *drv = NULL;
- int max_devs;
- int index;
- int cache;
- int bdrv_flags;
- char *params[] = { "bus", "unit", "if", "index", "cyls", "heads",
- "secs", "trans", "media", "snapshot", "file",
-- "cache", NULL };
-+ "cache", "format", NULL };
-
- if (check_params(buf, sizeof(buf), params, str) < 0) {
- fprintf(stderr, "qemu: unknowm parameter '%s' in '%s'\n",
-@@ -5051,6 +5058,14 @@
- }
- }
-
-+ if (get_param_value(buf, sizeof(buf), "format", str)) {
-+ drv = bdrv_find_format(buf);
-+ if (!drv) {
-+ fprintf(stderr, "qemu: '%s' invalid format\n", buf);
-+ return -1;
-+ }
-+ }
-+
- get_param_value(file, sizeof(file), "file", str);
-
- /* compute bus and unit according index */
-@@ -5150,7 +5165,7 @@
- bdrv_flags |= BDRV_O_SNAPSHOT;
- if (!cache)
- bdrv_flags |= BDRV_O_DIRECT;
-- if (bdrv_open(bdrv, file, bdrv_flags) < 0 || qemu_key_check(bdrv, file)) {
-+ if (bdrv_open2(bdrv, file, bdrv_flags, drv) < 0 || qemu_key_check(bdrv, file)) {
- fprintf(stderr, "qemu: could not open disk image %s\n",
- file);
- return -1;
diff --git a/emulators/qemu/patches/patch-ad b/emulators/qemu/patches/patch-ad
deleted file mode 100644
index 5335c36a228..00000000000
--- a/emulators/qemu/patches/patch-ad
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-ad,v 1.3 2007/12/30 17:12:45 joerg Exp $
-
---- block.c.orig 2007-02-05 23:01:54 +0000
-+++ block.c
-@@ -29,8 +29,10 @@
- #include <sys/stat.h>
- #include <sys/ioctl.h>
- #include <sys/queue.h>
-+#ifndef __DragonFly__
- #include <sys/disk.h>
- #endif
-+#endif
-
- #define SECTOR_BITS 9
- #define SECTOR_SIZE (1 << SECTOR_BITS)
diff --git a/emulators/qemu/patches/patch-ae b/emulators/qemu/patches/patch-ae
deleted file mode 100644
index 79da278f935..00000000000
--- a/emulators/qemu/patches/patch-ae
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-ae,v 1.4 2009/01/22 07:27:28 jmmv Exp $
-
---- osdep.h.orig 2008-01-06 20:38:42.000000000 +0100
-+++ osdep.h
-@@ -1,6 +1,7 @@
- #ifndef QEMU_OSDEP_H
- #define QEMU_OSDEP_H
-
-+#include <sys/types.h>
- #include <stdarg.h>
-
- #ifndef glue
diff --git a/emulators/qemu/patches/patch-ag b/emulators/qemu/patches/patch-ag
deleted file mode 100644
index 5d741e301b6..00000000000
--- a/emulators/qemu/patches/patch-ag
+++ /dev/null
@@ -1,77 +0,0 @@
-$NetBSD: patch-ag,v 1.12 2009/01/22 07:27:28 jmmv Exp $
-
---- configure.orig 2008-01-06 20:38:42.000000000 +0100
-+++ configure
-@@ -44,7 +44,7 @@ case "$cpu" in
- alpha)
- cpu="alpha"
- ;;
-- "Power Macintosh"|ppc|ppc64)
-+ "Power Macintosh"|ppc|ppc64|powerpc)
- cpu="powerpc"
- ;;
- mips)
-@@ -136,6 +136,12 @@ if [ "$cpu" = "i386" -o "$cpu" = "x86_64
- kqemu="yes"
- fi
- ;;
-+DragonFly)
-+bsd="yes"
-+oss="yes"
-+dragonfly="yes"
-+;;
-+
- NetBSD)
- bsd="yes"
- oss="yes"
-@@ -478,6 +484,16 @@ EOF
- fi
- fi
-
-+# Check for stack protector
-+cat > $TMPC <<EOF
-+extern int foo;
-+EOF
-+if "$cc" -o $TMPE $TMPC -fno-stack-protector 2> /dev/null ; then
-+ stack_protector_present="yes"
-+else
-+ stack_protector_present="no"
-+fi
-+
- #
- # Solaris specific configure tool chain decisions
- #
-@@ -680,7 +696,7 @@ else
- if test -z "$prefix" ; then
- prefix="/usr/local"
- fi
-- mansuffix="/share/man"
-+ mansuffix="/$PKGMANDIR"
- datasuffix="/share/qemu"
- docsuffix="/share/doc/qemu"
- binsuffix="/bin"
-@@ -848,8 +864,13 @@ int main(void) { return bswap_32(0); }
- EOF
- if $cc -o $TMPE $TMPC 2> /dev/null ; then
- echo "#define HAVE_BYTESWAP_H 1" >> $config_h
-+ elif test -f "/usr/include/machine/bswap.h" ; then
-+ echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_h
- fi
- fi
-+if test "$dragonfly" = "yes" ; then
-+ echo "CONFIG_DRAGONFLY=yes" >> $config_mak
-+fi
- if test "$darwin" = "yes" ; then
- echo "CONFIG_DARWIN=yes" >> $config_mak
- echo "#define CONFIG_DARWIN 1" >> $config_h
-@@ -960,6 +981,10 @@ if [ "$bsd" = "yes" ] ; then
- echo "#define _BSD 1" >> $config_h
- fi
-
-+if [ "$stack_protector_present" = "yes" ] ; then
-+ echo "STACK_PROTECTOR_PRESENT=yes" >> $config_mak
-+fi
-+
- echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
-
- tools=
diff --git a/emulators/qemu/patches/patch-ak b/emulators/qemu/patches/patch-ak
deleted file mode 100644
index 1f3c20fb67b..00000000000
--- a/emulators/qemu/patches/patch-ak
+++ /dev/null
@@ -1,57 +0,0 @@
-$NetBSD: patch-ak,v 1.13 2009/01/22 07:27:28 jmmv Exp $
-
---- Makefile.orig 2008-01-06 20:38:41.000000000 +0100
-+++ Makefile
-@@ -16,6 +16,15 @@ BASE_LDFLAGS += $(OS_LDFLAGS) $(ARCH_LDF
- CPPFLAGS += -I. -I$(SRC_PATH) -MMD -MP
- CPPFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
- LIBS=
-+ifndef CONFIG_DARWIN
-+ifndef CONFIG_WIN32
-+ifndef CONFIG_SOLARIS
-+ifndef CONFIG_DRAGONFLY
-+LIBS+=-lrt
-+endif
-+endif
-+endif
-+endif
- ifdef CONFIG_STATIC
- BASE_LDFLAGS += -static
- endif
-@@ -164,28 +173,28 @@ ar de en-us fi fr-be hr
- common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
-
- install-doc: $(DOCS)
-- mkdir -p "$(DESTDIR)$(docdir)"
-- $(INSTALL) -m 644 qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)"
-+ $(BSD_INSTALL_MAN_DIR) $(DESTDIR)$(docdir)
-+ $(BSD_INSTALL_DATA) qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)"
- ifndef CONFIG_WIN32
- mkdir -p "$(DESTDIR)$(mandir)/man1"
- $(INSTALL) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
- endif
-
- install: all $(if $(BUILD_DOCS),install-doc)
-- mkdir -p "$(DESTDIR)$(bindir)"
-+ $(BSD_INSTALL_PROGRAM_DIR) $(DESTDIR)$(bindir)
- ifneq ($(TOOLS),)
-- $(INSTALL) -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)"
-+ $(BSD_INSTALL_PROGRAM) $(TOOLS) "$(DESTDIR)$(bindir)"
- endif
-- mkdir -p "$(DESTDIR)$(datadir)"
-+ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(datadir)
- for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
- video.x openbios-sparc32 pxe-ne2k_pci.bin \
- pxe-rtl8139.bin pxe-pcnet.bin; do \
-- $(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
-+ $(BSD_INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
- done
- ifndef CONFIG_WIN32
-- mkdir -p "$(DESTDIR)$(datadir)/keymaps"
-+ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(datadir)/keymaps
- for x in $(KEYMAPS); do \
-- $(INSTALL) -m 644 $(SRC_PATH)/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
-+ $(BSD_INSTALL_DATA) $(SRC_PATH)/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
- done
- endif
- for d in $(TARGET_DIRS); do \
diff --git a/emulators/qemu/patches/patch-am b/emulators/qemu/patches/patch-am
deleted file mode 100644
index af730b64475..00000000000
--- a/emulators/qemu/patches/patch-am
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-am,v 1.2 2006/01/01 13:48:45 xtraeme Exp $
-
---- audio/ossaudio.c.orig 2005-12-19 17:51:53.000000000 -0500
-+++ audio/ossaudio.c
-@@ -229,7 +229,7 @@ static int oss_open (int in, struct oss_
- goto err;
- }
-
-- if (ioctl (fd, SNDCTL_DSP_NONBLOCK)) {
-+ if (ioctl (fd, SNDCTL_DSP_NONBLOCK, NULL)) {
- oss_logerr2 (errno, typ, "Failed to set non-blocking mode\n");
- goto err;
- }
diff --git a/emulators/qemu/patches/patch-aw b/emulators/qemu/patches/patch-aw
deleted file mode 100644
index b03fe11d0e3..00000000000
--- a/emulators/qemu/patches/patch-aw
+++ /dev/null
@@ -1,24 +0,0 @@
-$NetBSD: patch-aw,v 1.3 2009/01/22 07:27:28 jmmv Exp $
-
-Workaround for x86_64 target, patch from Hubert Feyrer.
-
---- dyngen.c.orig 2008-01-06 20:38:42.000000000 +0100
-+++ dyngen.c
-@@ -1738,6 +1738,7 @@ void gen_code(const char *name, host_ulo
- if(!sym_name)
- continue;
- if (*sym_name &&
-+ !strstart(sym_name, "bswap64", NULL) && /* HF hack */
- !strstart(sym_name, "__op_param", NULL) &&
- !strstart(sym_name, "__op_jmp", NULL) &&
- !strstart(sym_name, "__op_gen_label", NULL)) {
-@@ -1762,6 +1763,9 @@ void gen_code(const char *name, host_ulo
- */
- fprintf(outfile, " extern char %s;\n",
- sym_name);
-+#elif defined(HOST_PPC)
-+ if(strcmp("bswap32", sym_name))
-+ fprintf(outfile, "extern char %s;\n", sym_name);
- #else
- fprintf(outfile, "extern char %s;\n", sym_name);
- #endif
diff --git a/emulators/qemu/patches/patch-ax b/emulators/qemu/patches/patch-ax
deleted file mode 100644
index 37a30212fae..00000000000
--- a/emulators/qemu/patches/patch-ax
+++ /dev/null
@@ -1,24 +0,0 @@
-$NetBSD: patch-ax,v 1.3 2006/01/06 09:17:03 xtraeme Exp $
-
---- target-i386/op.c.orig 2006-01-06 05:10:30.000000000 +0100
-+++ target-i386/op.c
-@@ -2099,14 +2099,17 @@ void OPPROTO op_fdivr_STN_ST0(void)
- }
-
- /* misc FPU operations */
-+
-+void fchs_dummy() {ST0 = floatx_chs(ST0);}
- void OPPROTO op_fchs_ST0(void)
- {
-- ST0 = floatx_chs(ST0);
-+ fchs_dummy();
- }
-
-+void fabs_dummy() {ST0 = floatx_abs(ST0);}
- void OPPROTO op_fabs_ST0(void)
- {
-- ST0 = floatx_abs(ST0);
-+ fabs_dummy();
- }
-
- void OPPROTO op_fxam_ST0(void)
diff --git a/emulators/qemu/patches/patch-ay b/emulators/qemu/patches/patch-ay
deleted file mode 100644
index ce697b3a956..00000000000
--- a/emulators/qemu/patches/patch-ay
+++ /dev/null
@@ -1,92 +0,0 @@
-$NetBSD: patch-ay,v 1.9 2009/01/23 08:15:28 jmmv Exp $
-
---- block-raw-posix.c.orig 2008-01-06 20:38:42.000000000 +0100
-+++ block-raw-posix.c
-@@ -28,7 +28,9 @@
- #endif
- #include "block_int.h"
- #include <assert.h>
-+#ifdef _POSIX_ASYNCHRONOUS_IO
- #include <aio.h>
-+#endif
-
- #ifdef CONFIG_COCOA
- #include <paths.h>
-@@ -230,6 +232,7 @@ label__raw_write__success:
- return ret;
- }
-
-+#ifdef _POSIX_ASYNCHRONOUS_IO
- /***********************************************************/
- /* Unix AIO using POSIX AIO */
-
-@@ -455,6 +458,7 @@ static void raw_aio_cancel(BlockDriverAI
- pacb = &acb->next;
- }
- }
-+#endif
-
- static void raw_close(BlockDriverState *bs)
- {
-@@ -545,6 +549,35 @@ static void raw_flush(BlockDriverState *
- fsync(s->fd);
- }
-
-+#ifndef _POSIX_ASYNCHRONOUS_IO
-+void qemu_aio_init(void)
-+{
-+}
-+
-+void qemu_aio_poll(void)
-+{
-+}
-+
-+void qemu_aio_flush(void)
-+{
-+}
-+
-+void qemu_aio_wait_start(void)
-+{
-+}
-+
-+void qemu_aio_wait(void)
-+{
-+#ifndef QEMU_IMG
-+ qemu_bh_poll();
-+#endif
-+}
-+
-+void qemu_aio_wait_end(void)
-+{
-+}
-+#endif
-+
- BlockDriver bdrv_raw = {
- "raw",
- sizeof(BDRVRawState),
-@@ -556,10 +589,12 @@ BlockDriver bdrv_raw = {
- raw_create,
- raw_flush,
-
-+#ifdef _POSIX_ASYNCHRONOUS_IO
- .bdrv_aio_read = raw_aio_read,
- .bdrv_aio_write = raw_aio_write,
- .bdrv_aio_cancel = raw_aio_cancel,
- .aiocb_size = sizeof(RawAIOCB),
-+#endif
- .protocol_name = "file",
- .bdrv_pread = raw_pread,
- .bdrv_pwrite = raw_pwrite,
-@@ -908,10 +943,12 @@ BlockDriver bdrv_host_device = {
- NULL,
- raw_flush,
-
-+#ifdef _POSIX_ASYNCHRONOUS_IO
- .bdrv_aio_read = raw_aio_read,
- .bdrv_aio_write = raw_aio_write,
- .bdrv_aio_cancel = raw_aio_cancel,
- .aiocb_size = sizeof(RawAIOCB),
-+#endif
- .bdrv_pread = raw_pread,
- .bdrv_pwrite = raw_pwrite,
- .bdrv_getlength = raw_getlength,
diff --git a/emulators/qemu/patches/patch-da b/emulators/qemu/patches/patch-da
new file mode 100644
index 00000000000..331815944b3
--- /dev/null
+++ b/emulators/qemu/patches/patch-da
@@ -0,0 +1,13 @@
+$NetBSD: patch-da,v 1.1 2009/08/31 10:18:49 hasso Exp $
+
+--- audio/sdlaudio.c.orig 2009-08-30 08:33:14 +0300
++++ audio/sdlaudio.c 2009-08-30 08:41:26 +0300
+@@ -29,7 +29,7 @@
+ #ifndef _WIN32
+ #ifdef __sun__
+ #define _POSIX_PTHREAD_SEMANTICS 1
+-#elif defined(__OpenBSD__) || defined(__FreeBSD__)
++#elif defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
+ #include <pthread.h>
+ #endif
+ #include <signal.h>
diff --git a/emulators/qemu/patches/patch-db b/emulators/qemu/patches/patch-db
new file mode 100644
index 00000000000..424dae2094a
--- /dev/null
+++ b/emulators/qemu/patches/patch-db
@@ -0,0 +1,32 @@
+$NetBSD: patch-db,v 1.1 2009/08/31 10:18:49 hasso Exp $
+
+--- block-raw-posix.c.orig 2009-07-17 03:56:22 +0300
++++ block-raw-posix.c 2009-08-30 15:51:48 +0300
+@@ -63,6 +63,11 @@
+ #include <sys/dkio.h>
+ #endif
+
++#ifdef __DragonFly__
++#include <sys/ioctl.h>
++#include <sys/diskslice.h>
++#endif
++
+ //#define DEBUG_FLOPPY
+
+ //#define DEBUG_BLOCK
+@@ -766,6 +771,15 @@ static int64_t raw_getlength(BlockDrive
+ if (!fstat(fd, &sb) && (S_IFCHR & sb.st_mode)) {
+ #ifdef DIOCGMEDIASIZE
+ if (ioctl(fd, DIOCGMEDIASIZE, (off_t *)&size))
++#elif defined(DIOCGPART)
++ {
++ struct partinfo pi;
++ if (ioctl(fd, DIOCGPART, &pi) == 0)
++ size = pi.media_size;
++ else
++ size = 0;
++ }
++ if (size == 0)
+ #endif
+ #ifdef CONFIG_COCOA
+ size = LONG_LONG_MAX;
diff --git a/emulators/qemu/patches/patch-dc b/emulators/qemu/patches/patch-dc
new file mode 100644
index 00000000000..14084102579
--- /dev/null
+++ b/emulators/qemu/patches/patch-dc
@@ -0,0 +1,15 @@
+$NetBSD: patch-dc,v 1.1 2009/08/31 10:18:49 hasso Exp $
+
+--- block.c.orig 2009-07-17 03:56:22 +0300
++++ block.c 2009-08-30 15:53:21 +0300
+@@ -35,8 +35,10 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/ioctl.h>
++#ifndef __DragonFly__
+ #include <sys/disk.h>
+ #endif
++#endif
+
+ #define SECTOR_BITS 9
+ #define SECTOR_SIZE (1 << SECTOR_BITS)
diff --git a/emulators/qemu/patches/patch-dd b/emulators/qemu/patches/patch-dd
new file mode 100644
index 00000000000..0e98e3077a0
--- /dev/null
+++ b/emulators/qemu/patches/patch-dd
@@ -0,0 +1,29 @@
+$NetBSD: patch-dd,v 1.1 2009/08/31 10:18:49 hasso Exp $
+
+--- configure.orig 2009-07-17 03:56:22 +0300
++++ configure 2009-08-30 19:37:40 +0300
+@@ -228,6 +228,15 @@ if [ "$cpu" = "i386" -o "$cpu" = "x86_64
+ kqemu="yes"
+ fi
+ ;;
++DragonFly)
++bsd="yes"
++audio_drv_list="oss"
++audio_possible_drivers="oss sdl esd pa"
++if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
++ kqemu="yes"
++fi
++aio="no"
++;;
+ NetBSD)
+ bsd="yes"
+ audio_drv_list="oss"
+@@ -1102,7 +1111,7 @@ else
+ if test -z "$prefix" ; then
+ prefix="/usr/local"
+ fi
+- mansuffix="/share/man"
++ mansuffix="/man"
+ datasuffix="/share/qemu"
+ docsuffix="/share/doc/qemu"
+ binsuffix="/bin"
diff --git a/emulators/qemu/patches/patch-de b/emulators/qemu/patches/patch-de
new file mode 100644
index 00000000000..4c7156193de
--- /dev/null
+++ b/emulators/qemu/patches/patch-de
@@ -0,0 +1,13 @@
+$NetBSD: patch-de,v 1.1 2009/08/31 10:18:49 hasso Exp $
+
+--- exec.c.orig 2009-07-17 03:56:22 +0300
++++ exec.c 2009-08-30 15:57:26 +0300
+@@ -454,7 +454,7 @@ static void code_gen_alloc(unsigned long
+ exit(1);
+ }
+ }
+-#elif defined(__FreeBSD__)
++#elif defined(__FreeBSD__) || defined(__DragonFly__)
+ {
+ int flags;
+ void *addr = NULL;
diff --git a/emulators/qemu/patches/patch-df b/emulators/qemu/patches/patch-df
new file mode 100644
index 00000000000..74c94e49cf5
--- /dev/null
+++ b/emulators/qemu/patches/patch-df
@@ -0,0 +1,13 @@
+$NetBSD: patch-df,v 1.1 2009/08/31 10:18:49 hasso Exp $
+
+--- net.c.orig 2009-08-30 08:33:13 +0300
++++ net.c 2009-08-30 15:58:08 +0300
+@@ -59,7 +59,7 @@
+ #include <sys/select.h>
+ #ifdef _BSD
+ #include <sys/stat.h>
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__DragonFly__)
+ #include <libutil.h>
+ #else
+ #include <util.h>
diff --git a/emulators/qemu/patches/patch-dg b/emulators/qemu/patches/patch-dg
new file mode 100644
index 00000000000..3a7c293a33c
--- /dev/null
+++ b/emulators/qemu/patches/patch-dg
@@ -0,0 +1,22 @@
+$NetBSD: patch-dg,v 1.1 2009/08/31 10:18:49 hasso Exp $
+
+--- osdep.c.orig 2009-07-17 03:56:24 +0300
++++ osdep.c 2009-08-30 15:59:25 +0300
+@@ -90,7 +90,7 @@ static void *kqemu_vmalloc(size_t size)
+ void *ptr;
+
+ /* no need (?) for a dummy file on OpenBSD/FreeBSD */
+-#if defined(__OpenBSD__) || defined(__FreeBSD__)
++#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
+ int map_anon = MAP_ANON;
+ #else
+ int map_anon = 0;
+@@ -157,7 +157,7 @@ static void *kqemu_vmalloc(size_t size)
+ }
+ size = (size + 4095) & ~4095;
+ ftruncate(phys_ram_fd, phys_ram_size + size);
+-#endif /* !(__OpenBSD__ || __FreeBSD__) */
++#endif /* !(__OpenBSD__ || __FreeBSD__ || __DragonFly__) */
+ ptr = mmap(NULL,
+ size,
+ PROT_WRITE | PROT_READ, map_anon | MAP_SHARED,
diff --git a/emulators/qemu/patches/patch-dh b/emulators/qemu/patches/patch-dh
new file mode 100644
index 00000000000..6e8ead2be7c
--- /dev/null
+++ b/emulators/qemu/patches/patch-dh
@@ -0,0 +1,58 @@
+$NetBSD: patch-dh,v 1.1 2009/08/31 10:18:49 hasso Exp $
+
+--- qemu-char.c.orig 2009-07-17 03:56:24 +0300
++++ qemu-char.c 2009-08-30 16:00:34 +0300
+@@ -66,6 +66,10 @@
+ #include <libutil.h>
+ #include <dev/ppbus/ppi.h>
+ #include <dev/ppbus/ppbconf.h>
++#elif defined(__DragonFly__)
++#include <libutil.h>
++#include <dev/misc/ppi/ppi.h>
++#include <bus/ppbus/ppbconf.h>
+ #else
+ #include <util.h>
+ #endif
+@@ -798,7 +802,7 @@ void cfmakeraw (struct termios *termios_
+ #endif
+
+ #if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
+- || defined(__NetBSD__) || defined(__OpenBSD__)
++ || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
+
+ typedef struct {
+ int fd;
+@@ -928,7 +932,7 @@ static CharDriverState *qemu_chr_open_pt
+ PtyCharDriver *s;
+ struct termios tty;
+ int slave_fd, len;
+-#if defined(__OpenBSD__)
++#if defined(__OpenBSD__) || defined(__DragonFly__)
+ char pty_name[PATH_MAX];
+ #define q_ptsname(x) pty_name
+ #else
+@@ -1274,7 +1278,7 @@ static CharDriverState *qemu_chr_open_pp
+ }
+ #endif /* __linux__ */
+
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__DragonFly__)
+ static int pp_ioctl(CharDriverState *chr, int cmd, void *arg)
+ {
+ int fd = (int)chr->opaque;
+@@ -2162,13 +2166,13 @@ CharDriverState *qemu_chr_open(const cha
+ if (strstart(filename, "/dev/parport", NULL)) {
+ chr = qemu_chr_open_pp(filename);
+ } else
+-#elif defined(__FreeBSD__)
++#elif defined(__FreeBSD__) || defined(__DragonFly__)
+ if (strstart(filename, "/dev/ppi", NULL)) {
+ chr = qemu_chr_open_pp(filename);
+ } else
+ #endif
+ #if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
+- || defined(__NetBSD__) || defined(__OpenBSD__)
++ || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
+ if (strstart(filename, "/dev/", NULL)) {
+ chr = qemu_chr_open_tty(filename);
+ } else
diff --git a/emulators/qemu/patches/patch-di b/emulators/qemu/patches/patch-di
new file mode 100644
index 00000000000..3be9b78ce6a
--- /dev/null
+++ b/emulators/qemu/patches/patch-di
@@ -0,0 +1,13 @@
+$NetBSD: patch-di,v 1.1 2009/08/31 10:18:49 hasso Exp $
+
+--- savevm.c.orig 2009-08-30 08:33:14 +0300
++++ savevm.c 2009-08-30 16:01:20 +0300
+@@ -63,7 +63,7 @@
+ #include <sys/select.h>
+ #ifdef _BSD
+ #include <sys/stat.h>
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__DragonFly__)
+ #include <libutil.h>
+ #else
+ #include <util.h>
diff --git a/emulators/qemu/patches/patch-dj b/emulators/qemu/patches/patch-dj
new file mode 100644
index 00000000000..6b9705cb0ae
--- /dev/null
+++ b/emulators/qemu/patches/patch-dj
@@ -0,0 +1,43 @@
+$NetBSD: patch-dj,v 1.1 2009/08/31 10:18:49 hasso Exp $
+
+--- usb-bsd.c.orig 2009-07-17 03:56:26 +0300
++++ usb-bsd.c 2009-08-30 16:01:57 +0300
+@@ -34,7 +34,11 @@
+ #undef USB_SPEED_LOW
+
+ #include <sys/ioctl.h>
++#ifndef __DragonFly__
+ #include <dev/usb/usb.h>
++#else
++#include <bus/usb/usb.h>
++#endif
+ #include <signal.h>
+
+ /* This value has maximum potential at 16.
+@@ -68,7 +72,7 @@ static int ensure_ep_open(USBHostDevice
+ ep = UE_GET_ADDR(ep);
+
+ if (dev->ep_fd[ep] < 0) {
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__DragonFly__)
+ snprintf(buf, sizeof(buf) - 1, "%s.%d", dev->devpath, ep);
+ #else
+ snprintf(buf, sizeof(buf) - 1, "%s.%02d", dev->devpath, ep);
+@@ -321,7 +325,7 @@ USBDevice *usb_host_device_open(const ch
+ return NULL;
+ }
+
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__DragonFly__)
+ snprintf(ctlpath, PATH_MAX, "/dev/%s", bus_info.udi_devnames[0]);
+ #else
+ snprintf(ctlpath, PATH_MAX, "/dev/%s.00", bus_info.udi_devnames[0]);
+@@ -411,7 +415,7 @@ static int usb_host_scan(void *opaque, U
+ if (strncmp(bus_info.udi_devnames[0], "ugen", 4) != 0)
+ continue;
+
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__DragonFly__)
+ snprintf(devbuf, sizeof(devbuf) - 1, "/dev/%s", bus_info.udi_devnames[0]);
+ #else
+ snprintf(devbuf, sizeof(devbuf) - 1, "/dev/%s.00", bus_info.udi_devnames[0]);
diff --git a/emulators/qemu/patches/patch-dk b/emulators/qemu/patches/patch-dk
new file mode 100644
index 00000000000..9b8d906f6bf
--- /dev/null
+++ b/emulators/qemu/patches/patch-dk
@@ -0,0 +1,33 @@
+$NetBSD: patch-dk,v 1.1 2009/08/31 10:18:49 hasso Exp $
+
+--- vl.c.orig 2009-08-30 08:33:14 +0300
++++ vl.c 2009-08-30 16:02:53 +0300
+@@ -74,7 +74,7 @@
+ #include <sys/select.h>
+ #ifdef _BSD
+ #include <sys/stat.h>
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__DragonFly__)
+ #include <libutil.h>
+ #else
+ #include <util.h>
+@@ -755,7 +755,8 @@ static int use_rt_clock;
+ static void init_get_clock(void)
+ {
+ use_rt_clock = 0;
+-#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000)
++#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000) \
++ || defined(__DragonFly__)
+ {
+ struct timespec ts;
+ if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) {
+@@ -767,7 +768,8 @@ static void init_get_clock(void)
+
+ static int64_t get_clock(void)
+ {
+-#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000)
++#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000) \
++ || defined(__DragonFly__)
+ if (use_rt_clock) {
+ struct timespec ts;
+ clock_gettime(CLOCK_MONOTONIC, &ts);
diff --git a/emulators/qemu/patches/patch-dl b/emulators/qemu/patches/patch-dl
new file mode 100644
index 00000000000..3adffc6a8a5
--- /dev/null
+++ b/emulators/qemu/patches/patch-dl
@@ -0,0 +1,29 @@
+$NetBSD: patch-dl,v 1.1 2009/08/31 10:18:49 hasso Exp $
+
+--- cpu-exec.c.orig 2009-08-31 11:06:51 +0300
++++ cpu-exec.c 2009-08-31 11:18:49 +0300
+@@ -1156,6 +1156,12 @@ static inline int handle_cpu_signal(unsi
+ # define EIP_sig(context) (*((unsigned long*)&(context)->uc_mcontext->ss.eip))
+ # define TRAP_sig(context) ((context)->uc_mcontext->es.trapno)
+ # define ERROR_sig(context) ((context)->uc_mcontext->es.err)
++#elif defined (__FreeBSD__) || (__DragonFly__)
++# include <ucontext.h>
++
++# define EIP_sig(context) (*((unsigned long*)&(context)->uc_mcontext.mc_eip))
++# define TRAP_sig(context) ((context)->uc_mcontext.mc_trapno)
++# define ERROR_sig(context) ((context)->uc_mcontext.mc_err)
+ #else
+ # define EIP_sig(context) ((context)->uc_mcontext.gregs[REG_EIP])
+ # define TRAP_sig(context) ((context)->uc_mcontext.gregs[REG_TRAPNO])
+@@ -1166,7 +1172,11 @@ int cpu_signal_handler(int host_signum,
+ void *puc)
+ {
+ siginfo_t *info = pinfo;
++#if defined (__FreeBSD__) || (__DragonFly__)
++ ucontext_t *uc = puc;
++#else
+ struct ucontext *uc = puc;
++#endif
+ unsigned long pc;
+ int trapno;
+
diff --git a/emulators/qemu/patches/patch-dm b/emulators/qemu/patches/patch-dm
new file mode 100644
index 00000000000..0539fdb0368
--- /dev/null
+++ b/emulators/qemu/patches/patch-dm
@@ -0,0 +1,13 @@
+$NetBSD: patch-dm,v 1.1 2009/08/31 10:18:49 hasso Exp $
+
+--- exec-all.h.orig 2009-08-31 11:12:02 +0300
++++ exec-all.h 2009-08-31 11:12:15 +0300
+@@ -35,7 +35,7 @@
+ typedef struct TranslationBlock TranslationBlock;
+
+ /* XXX: make safe guess about sizes */
+-#define MAX_OP_PER_INSTR 64
++#define MAX_OP_PER_INSTR 128
+ /* A Call op needs up to 6 + 2N parameters (N = number of arguments). */
+ #define MAX_OPC_PARAM 10
+ #define OPC_BUF_SIZE 512