Changes 1.6.0: Block devices * New device "nvme" provides a PCI device that implements the NVMe standard. * Fix for a possible data loss on crashes with IDE disks (due to mishandling of FLUSH requests) Device assignment * Legacy PCI assignment supports CPU affinity for MSI interrupts. USB * The XHCI (USB 3.0) controller supports live migration. PCI * ACPI hotplug of devices behind a PCI bridge is supported. ARM * The 32-bit ARMv8 LDA/STL instructions for load-acquire/store-release are supported (only with -cpu any); the remainder of the new v8 instructions will follow in a future release. * The vexpress-a9 and vexpress-a15 boards have experimental support for virtio devices via a virtio-mmio transport. Note that the virtio command lines used with x86 systems won't work as they will create PCI virtio devices; use the devices "virtio-blk-device", "virtio-net-device", etc instead. Note that this functionality may change in future releases. * The -initrd option now accepts ramdisks with a U-Boot header. * A model of the Calxeda ECX-2000 / Midway system is now supported ("midway"). PPC * Mac OS X guests supported (10.2-10.4 for PPC, 10.4 for PPC64) * pSeries guests support live migration and savevm. s390x * If the kernel supports it, virtio-ccw supports ioeventfd and vhost when running on KVM. * The dump-guest-memory command is supported. SPARC * Sun4c and Sun4d architectures and related CPUs were not fully implemented and have been removed. * 24-bit display mode works x86 * Firmware can be exposed to the guest as a flash device (using -pflash) also when running on KVM. * In addition to the "xenfv" machine type, which is kept for backwards compatibility, Xen can now use the pc machine type (including versioned machine types) using "-M pc -machine accel=xen". Note that using PV-on-HVM drivers requires "-M pc -machine accel=xen -device xen-platform". * QEMU can expose the full set of ACPI tables to the guest: See Features/ACPITableGeneration * Conroe, Penryn and Nehalem CPUs have had their CPUID values fixed * "-M isapc" now works on KVM too. * -pflash can be used with KVM too. more...diff -r1.112 -r1.113 pkgsrc/emulators/qemu/Makefile
(adam)
@@ -1,48 +1,48 @@ | @@ -1,48 +1,48 @@ | |||
1 | # $NetBSD: Makefile,v 1.112 2013/07/29 13:10:26 adam Exp $ | 1 | # $NetBSD: Makefile,v 1.113 2013/08/16 21:20:11 adam Exp $ | |
2 | 2 | |||
3 | DISTNAME= qemu-1.5.2 | 3 | DISTNAME= qemu-1.6.0 | |
4 | CATEGORIES= emulators | 4 | CATEGORIES= emulators | |
5 | MASTER_SITES= http://wiki.qemu.org/download/ | 5 | MASTER_SITES= http://wiki.qemu.org/download/ | |
6 | EXTRACT_SUFX= .tar.bz2 | 6 | EXTRACT_SUFX= .tar.bz2 | |
7 | 7 | |||
8 | MAINTAINER= pkgsrc-users@NetBSD.org | 8 | MAINTAINER= pkgsrc-users@NetBSD.org | |
9 | HOMEPAGE= http://www.qemu.org/ | 9 | HOMEPAGE= http://www.qemu.org/ | |
10 | COMMENT= CPU emulator using dynamic translation | 10 | COMMENT= CPU emulator using dynamic translation | |
11 | LICENSE= gnu-gpl-v2 AND gnu-lgpl-v2.1 AND mit AND modified-bsd | 11 | LICENSE= gnu-gpl-v2 AND gnu-lgpl-v2.1 AND mit AND modified-bsd | |
12 | 12 | |||
13 | CONFLICTS+= qemu-bin-[0-9]* | 13 | CONFLICTS+= qemu-bin-[0-9]* | |
14 | NOT_FOR_PLATFORM= NetBSD-1.[0-6]*-* | 14 | NOT_FOR_PLATFORM= NetBSD-1.[0-6]*-* | |
15 | # qemu 1 does not work on NetBSD-5; see http://gnats.netbsd.org/46565. | 15 | # qemu 1 does not work on NetBSD-5; see http://gnats.netbsd.org/46565. | |
16 | # As a workaround, use emulators/qemu0. | 16 | # As a workaround, use emulators/qemu0. | |
17 | NOT_FOR_PLATFORM= NetBSD-5*-* | 17 | NOT_FOR_PLATFORM= NetBSD-5*-* | |
18 | 18 | |||
19 | USE_TOOLS+= gmake makeinfo perl:build pkg-config | 19 | USE_TOOLS+= gmake makeinfo perl:build pkg-config | |
20 | UNLIMIT_RESOURCES= datasize | 20 | UNLIMIT_RESOURCES= datasize | |
21 | HAS_CONFIGURE= yes | 21 | HAS_CONFIGURE= yes | |
22 | 22 | |||
23 | BUILD_DEPENDS+= texi2html-[0-9]*:../../textproc/texi2html | 23 | BUILD_DEPENDS+= texi2html-[0-9]*:../../textproc/texi2html | |
24 | 24 | |||
25 | .include "options.mk" | 25 | .include "options.mk" | |
26 | 26 | |||
27 | .include "../../mk/bsd.prefs.mk" | 27 | .include "../../mk/bsd.prefs.mk" | |
28 | 28 | |||
29 | CONFIGURE_ENV+= mansuffix=/${PKGMANDIR} | |||
30 | CONFIGURE_ARGS+= --prefix=${PREFIX} | 29 | CONFIGURE_ARGS+= --prefix=${PREFIX} | |
31 | CONFIGURE_ARGS+= --interp-prefix=${PREFIX}/share/qemu | 30 | CONFIGURE_ARGS+= --interp-prefix=${PREFIX}/share/qemu | |
32 | CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR} | 31 | CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR} | |
33 | CONFIGURE_ARGS+= --python=${PYTHONBIN} | 32 | CONFIGURE_ARGS+= --python=${PYTHONBIN} | |
34 | CONFIGURE_ARGS+= --smbd=${PREFIX}/sbin/smbd | 33 | CONFIGURE_ARGS+= --smbd=${PREFIX}/sbin/smbd | |
35 | CONFIGURE_ARGS+= --mandir=${PREFIX}/${PKGMANDIR} | 34 | CONFIGURE_ARGS+= --mandir=${PREFIX}/${PKGMANDIR} | |
35 | CONFIGURE_ENV+= mansuffix=/${PKGMANDIR} | |||
36 | 36 | |||
37 | CONF_FILES= ${EGDIR}/target-x86_64.conf \ | 37 | CONF_FILES= ${EGDIR}/target-x86_64.conf \ | |
38 | ${PKG_SYSCONFDIR}/target-x86_64.conf | 38 | ${PKG_SYSCONFDIR}/target-x86_64.conf | |
39 | EGDIR= ${PREFIX}/share/examples/qemu | 39 | EGDIR= ${PREFIX}/share/examples/qemu | |
40 | INSTALL_MAKE_FLAGS= egdir=${EGDIR} | 40 | INSTALL_MAKE_FLAGS= egdir=${EGDIR} | |
41 | PKG_SYSCONFSUBDIR= qemu | 41 | PKG_SYSCONFSUBDIR= qemu | |
42 | 42 | |||
43 | REPLACE_PERL+= scripts/texi2pod.pl | 43 | REPLACE_PERL+= scripts/texi2pod.pl | |
44 | 44 | |||
45 | BUILDLINK_PASSTHRU_DIRS+= /usr/lib | 45 | BUILDLINK_PASSTHRU_DIRS+= /usr/lib | |
46 | BUILDLINK_PASSTHRU_RPATHDIRS+= /usr/lib | 46 | BUILDLINK_PASSTHRU_RPATHDIRS+= /usr/lib | |
47 | 47 | |||
48 | INSTALLATION_DIRS= ${PKGMANDIR}/man1 share/doc/qemu | 48 | INSTALLATION_DIRS= ${PKGMANDIR}/man1 share/doc/qemu |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | @comment $NetBSD: PLIST,v 1.35 2013/07/09 17:00:58 tsutsui Exp $ | 1 | @comment $NetBSD: PLIST,v 1.36 2013/08/16 21:20:11 adam Exp $ | |
2 | ${PLIST.alpha}bin/qemu-alpha | 2 | ${PLIST.alpha}bin/qemu-alpha | |
3 | ${PLIST.arm}bin/qemu-arm | 3 | ${PLIST.arm}bin/qemu-arm | |
4 | ${PLIST.armeb}bin/qemu-armeb | 4 | ${PLIST.armeb}bin/qemu-armeb | |
5 | ${PLIST.cris}bin/qemu-cris | 5 | ${PLIST.cris}bin/qemu-cris | |
6 | bin/qemu-ga | 6 | bin/qemu-ga | |
7 | ${PLIST.i386}bin/qemu-i386 | 7 | ${PLIST.i386}bin/qemu-i386 | |
8 | bin/qemu-img | 8 | bin/qemu-img | |
9 | bin/qemu-io | 9 | bin/qemu-io | |
10 | ${PLIST.m68k}bin/qemu-m68k | 10 | ${PLIST.m68k}bin/qemu-m68k | |
11 | ${PLIST.microblaze}bin/qemu-microblaze | 11 | ${PLIST.microblaze}bin/qemu-microblaze | |
12 | ${PLIST.microblazeel}bin/qemu-microblazeel | 12 | ${PLIST.microblazeel}bin/qemu-microblazeel | |
13 | ${PLIST.mips}bin/qemu-mips | 13 | ${PLIST.mips}bin/qemu-mips | |
14 | ${PLIST.mipsel}bin/qemu-mipsel | 14 | ${PLIST.mipsel}bin/qemu-mipsel | |
@@ -112,23 +112,24 @@ share/qemu/openbios-sparc32 | @@ -112,23 +112,24 @@ share/qemu/openbios-sparc32 | |||
112 | share/qemu/openbios-sparc64 | 112 | share/qemu/openbios-sparc64 | |
113 | share/qemu/palcode-clipper | 113 | share/qemu/palcode-clipper | |
114 | share/qemu/petalogix-ml605.dtb | 114 | share/qemu/petalogix-ml605.dtb | |
115 | share/qemu/petalogix-s3adsp1800.dtb | 115 | share/qemu/petalogix-s3adsp1800.dtb | |
116 | share/qemu/ppc_rom.bin | 116 | share/qemu/ppc_rom.bin | |
117 | share/qemu/pxe-e1000.rom | 117 | share/qemu/pxe-e1000.rom | |
118 | share/qemu/pxe-eepro100.rom | 118 | share/qemu/pxe-eepro100.rom | |
119 | share/qemu/pxe-ne2k_pci.rom | 119 | share/qemu/pxe-ne2k_pci.rom | |
120 | share/qemu/pxe-pcnet.rom | 120 | share/qemu/pxe-pcnet.rom | |
121 | share/qemu/pxe-rtl8139.rom | 121 | share/qemu/pxe-rtl8139.rom | |
122 | share/qemu/pxe-virtio.rom | 122 | share/qemu/pxe-virtio.rom | |
123 | share/qemu/q35-acpi-dsdt.aml | 123 | share/qemu/q35-acpi-dsdt.aml | |
124 | share/qemu/qemu-icon.bmp | 124 | share/qemu/qemu-icon.bmp | |
125 | share/qemu/qemu_logo_no_text.svg | |||
125 | share/qemu/s390-ccw.img | 126 | share/qemu/s390-ccw.img | |
126 | share/qemu/s390-zipl.rom | 127 | share/qemu/s390-zipl.rom | |
127 | share/qemu/sgabios.bin | 128 | share/qemu/sgabios.bin | |
128 | share/qemu/slof.bin | 129 | share/qemu/slof.bin | |
129 | share/qemu/spapr-rtas.bin | 130 | share/qemu/spapr-rtas.bin | |
130 | share/qemu/vgabios-cirrus.bin | 131 | share/qemu/vgabios-cirrus.bin | |
131 | share/qemu/vgabios-qxl.bin | 132 | share/qemu/vgabios-qxl.bin | |
132 | share/qemu/vgabios-stdvga.bin | 133 | share/qemu/vgabios-stdvga.bin | |
133 | share/qemu/vgabios-vmware.bin | 134 | share/qemu/vgabios-vmware.bin | |
134 | share/qemu/vgabios.bin | 135 | share/qemu/vgabios.bin |
@@ -1,18 +1,15 @@ | @@ -1,18 +1,15 @@ | |||
1 | $NetBSD: distinfo,v 1.86 2013/07/29 13:10:26 adam Exp $ | 1 | $NetBSD: distinfo,v 1.87 2013/08/16 21:20:11 adam Exp $ | |
2 | 2 | |||
3 | SHA1 (qemu-1.5.2.tar.bz2) = 932c04cdb227e1553c79a43bbf7552a433c815a9 | 3 | SHA1 (qemu-1.6.0.tar.bz2) = 5f754fc128aaafd0c7aee2204d453f4be1ac859e | |
4 | RMD160 (qemu-1.5.2.tar.bz2) = db8509d58d1cc461cca28f35e69efd7c0143be07 | 4 | RMD160 (qemu-1.6.0.tar.bz2) = e9cd36df6cba757a37dd34b7889f3190e7b6f222 | |
5 | Size (qemu-1.5.2.tar.bz2) = 11932902 bytes | 5 | Size (qemu-1.6.0.tar.bz2) = 12040196 bytes | |
6 | SHA1 (patch-ef) = 871ccf29463dec1bd56d7f7808248c5b1af4d4d6 | 6 | SHA1 (patch-ef) = 871ccf29463dec1bd56d7f7808248c5b1af4d4d6 | |
7 | SHA1 (patch-et) = bc96fbe2869042f9a77716cfe3c5342262e7b489 | 7 | SHA1 (patch-et) = 8c876c7ba134345c51f139fa93ea95bcd5146f5d | |
8 | SHA1 (patch-hw_display_omap__dss.c) = af89754a9a078a5b52240473d85351bd447623c0 | 8 | SHA1 (patch-hw_display_omap__dss.c) = af89754a9a078a5b52240473d85351bd447623c0 | |
9 | SHA1 (patch-hw_net_etraxfs__eth.c) = a6ac71e3a2a605bbabc52792db1d063dcb7764c2 | 9 | SHA1 (patch-hw_net_etraxfs__eth.c) = 444c6f8a8ad26d9762bfc8a0672afbc7b858fc9d | |
10 | SHA1 (patch-hw_net_xilinx__axienet.c) = 02461c2cd2985c352626e46ba93844606783460e | 10 | SHA1 (patch-hw_net_xilinx__axienet.c) = 02461c2cd2985c352626e46ba93844606783460e | |
11 | SHA1 (patch-include_qemu_thread-posix.h) = 7722055df516a8bcd01d36ea0474d2bbfbe27eaa | 11 | SHA1 (patch-memory.c) = 4b0452da427c52c17ff4b9c38d2caace1c9ce939 | |
12 | SHA1 (patch-ioport.c) = a1bb22c6e22c0b0f3acacfa2023f7b45463e0041 | 12 | SHA1 (patch-net_tap-bsd.c) = b87c2af1e63fe7a345bff117ef58fc311763338c | |
13 | SHA1 (patch-memory.c) = b18fa7273a52e387943062e03c90501c4d9b30f4 | |||
14 | SHA1 (patch-net_tap-bsd.c) = 8f97df5f23212d6b748786a4ab417520abc6b066 | |||
15 | SHA1 (patch-slirp_tcp__subr.c) = 430157ea8a92fe1d6fc4f1f22ea5530641315fe1 | 13 | SHA1 (patch-slirp_tcp__subr.c) = 430157ea8a92fe1d6fc4f1f22ea5530641315fe1 | |
16 | SHA1 (patch-user-exec.c) = 41f8bfdd86cbaa974ceb91571a2b2293b9df5153 | 14 | SHA1 (patch-user-exec.c) = ba20197b7c1209357568817cc56d31f8aa5b1905 | |
17 | SHA1 (patch-util_hbitmap.c) = 372fcbad5272205cd354bc7760ead77e017b07d1 | 15 | SHA1 (patch-util_hbitmap.c) = 372fcbad5272205cd354bc7760ead77e017b07d1 | |
18 | SHA1 (patch-util_qemu-thread-posix.c) = 0f3ce555b4d1328a869a374bf58eee3bda320cc2 |
@@ -1,16 +1,16 @@ | @@ -1,16 +1,16 @@ | |||
1 | $NetBSD: patch-et,v 1.8 2013/07/09 17:00:58 tsutsui Exp $ | 1 | $NetBSD: patch-et,v 1.9 2013/08/16 21:20:11 adam Exp $ | |
2 | 2 | |||
3 | --- Makefile.orig 2013-06-26 21:47:29.000000000 +0000 | 3 | --- Makefile.orig 2013-08-15 19:56:23.000000000 +0000 | |
4 | +++ Makefile | 4 | +++ Makefile | |
5 | @@ -324,8 +324,9 @@ install-datadir: | 5 | @@ -329,8 +329,9 @@ endif | |
6 | install-confdir: | 6 | install-confdir: | |
7 | $(INSTALL_DIR) "$(DESTDIR)$(qemu_confdir)" | 7 | $(INSTALL_DIR) "$(DESTDIR)$(qemu_confdir)" | |
8 | 8 | |||
9 | -install-sysconfig: install-datadir install-confdir | 9 | -install-sysconfig: install-datadir install-confdir | |
10 | - $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(qemu_confdir)" | 10 | - $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(qemu_confdir)" | |
11 | +install-sysconfig: | 11 | +install-sysconfig: | |
12 | + $(INSTALL_DIR) "$(DESTDIR)$(egdir)" | 12 | + $(INSTALL_DIR) "$(DESTDIR)$(egdir)" | |
13 | + $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(egdir)" | 13 | + $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(egdir)" | |
14 | 14 | |||
15 | install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig install-datadir | 15 | install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig \ | |
16 | $(INSTALL_DIR) "$(DESTDIR)$(bindir)" | 16 | install-datadir install-localstatedir |
@@ -1,25 +1,25 @@ | @@ -1,25 +1,25 @@ | |||
1 | $NetBSD: patch-hw_net_etraxfs__eth.c,v 1.1 2013/07/09 17:00:58 tsutsui Exp $ | 1 | $NetBSD: patch-hw_net_etraxfs__eth.c,v 1.2 2013/08/16 21:20:11 adam Exp $ | |
2 | 2 | |||
3 | Avoid conflicts with SSP read() macro in NetBSD's <ssp/unistd.h> | 3 | Avoid conflicts with SSP read() macro in NetBSD's <ssp/unistd.h> | |
4 | (PR lib/43832: ssp causes common names to be defines) | 4 | (PR lib/43832: ssp causes common names to be defines) | |
5 | 5 | |||
6 | --- hw/net/etraxfs_eth.c.orig 2013-06-26 21:47:29.000000000 +0000 | 6 | --- hw/net/etraxfs_eth.c.orig 2013-06-26 21:47:29.000000000 +0000 | |
7 | +++ hw/net/etraxfs_eth.c | 7 | +++ hw/net/etraxfs_eth.c | |
8 | @@ -185,7 +185,7 @@ static void mdio_read_req(struct qemu_md | 8 | @@ -185,7 +185,7 @@ static void mdio_read_req(struct qemu_md | |
9 | 9 | |||
10 | phy = bus->devs[bus->addr]; | 10 | phy = bus->devs[bus->addr]; | |
11 | if (phy && phy->read) { | 11 | if (phy && phy->read) { | |
12 | - bus->data = phy->read(phy, bus->req); | 12 | - bus->data = phy->read(phy, bus->req); | |
13 | + bus->data = (*phy->read)(phy, bus->req); | 13 | + bus->data = (*phy->read)(phy, bus->req); | |
14 | } else { | 14 | } else { | |
15 | bus->data = 0xffff; | 15 | bus->data = 0xffff; | |
16 | } | 16 | } | |
17 | @@ -359,7 +359,7 @@ static void eth_validate_duplex(struct f | 17 | @@ -364,7 +364,7 @@ static void eth_validate_duplex(struct f | |
18 | int new_mm = 0; | 18 | int new_mm = 0; | |
19 | 19 | |||
20 | phy = eth->mdio_bus.devs[eth->phyaddr]; | 20 | phy = eth->mdio_bus.devs[eth->phyaddr]; | |
21 | - phy_duplex = !!(phy->read(phy, 18) & (1 << 11)); | 21 | - phy_duplex = !!(phy->read(phy, 18) & (1 << 11)); | |
22 | + phy_duplex = !!((*phy->read)(phy, 18) & (1 << 11)); | 22 | + phy_duplex = !!((*phy->read)(phy, 18) & (1 << 11)); | |
23 | mac_duplex = !!(eth->regs[RW_REC_CTRL] & 128); | 23 | mac_duplex = !!(eth->regs[RW_REC_CTRL] & 128); | |
24 | 24 | |||
25 | if (mac_duplex != phy_duplex) { | 25 | if (mac_duplex != phy_duplex) { |
@@ -1,32 +1,16 @@ | @@ -1,32 +1,16 @@ | |||
1 | $NetBSD: patch-memory.c,v 1.5 2013/07/09 17:00:58 tsutsui Exp $ | 1 | $NetBSD: patch-memory.c,v 1.6 2013/08/16 21:20:11 adam Exp $ | |
2 | 2 | |||
3 | Avoid conflicts with SSP read() macro in NetBSD's <ssp/unistd.h> | 3 | Avoid conflicts with SSP read() macro in NetBSD's <ssp/unistd.h> | |
4 | (PR lib/43832: ssp causes common names to be defines) | 4 | (PR lib/43832: ssp causes common names to be defines) | |
5 | 5 | |||
6 | --- memory.c.orig 2013-06-26 21:47:29.000000000 +0000 | 6 | --- memory.c.orig 2013-08-15 19:56:23.000000000 +0000 | |
7 | +++ memory.c | 7 | +++ memory.c | |
8 | @@ -313,7 +313,7 @@ static void memory_region_read_accessor( | 8 | @@ -404,7 +404,7 @@ static void memory_region_read_accessor( | |
9 | if (mr->flush_coalesced_mmio) { | 9 | if (mr->flush_coalesced_mmio) { | |
10 | qemu_flush_coalesced_mmio_buffer(); | 10 | qemu_flush_coalesced_mmio_buffer(); | |
11 | } | 11 | } | |
12 | - tmp = mr->ops->read(mr->opaque, addr, size); | 12 | - tmp = mr->ops->read(mr->opaque, addr, size); | |
13 | + tmp = (*mr->ops->read)(mr->opaque, addr, size); | 13 | + tmp = (*mr->ops->read)(mr->opaque, addr, size); | |
14 | trace_memory_region_ops_read(mr, addr, tmp, size); | |||
14 | *value |= (tmp & mask) << shift; | 15 | *value |= (tmp & mask) << shift; | |
15 | } | 16 | } | |
16 | ||||
17 | @@ -396,12 +396,12 @@ static void memory_region_iorange_read(I | |||
18 | ||||
19 | *data = ((uint64_t)1 << (width * 8)) - 1; | |||
20 | if (mrp) { | |||
21 | - *data = mrp->read(mr->opaque, offset); | |||
22 | + *data = (*mrp->read)(mr->opaque, offset); | |||
23 | } else if (width == 2) { | |||
24 | mrp = find_portio(mr, offset - mrio->offset, 1, false); | |||
25 | assert(mrp); | |||
26 | - *data = mrp->read(mr->opaque, offset) | | |||
27 | - (mrp->read(mr->opaque, offset + 1) << 8); | |||
28 | + *data = (*mrp->read)(mr->opaque, offset) | | |||
29 | + ((*mrp->read)(mr->opaque, offset + 1) << 8); | |||
30 | } | |||
31 | return; | |||
32 | } |
@@ -1,15 +1,14 @@ | @@ -1,15 +1,14 @@ | |||
1 | $NetBSD: patch-net_tap-bsd.c,v 1.4 2013/07/09 17:00:58 tsutsui Exp $ | 1 | $NetBSD: patch-net_tap-bsd.c,v 1.5 2013/08/16 21:20:11 adam Exp $ | |
2 | 2 | |||
3 | Make it understand "-net tap,ifname=tap3" on NetBSD. | 3 | Make it understand "-net tap,ifname=tap3" on NetBSD. | |
4 | 4 | |||
5 | --- net/tap-bsd.c.orig 2013-06-26 21:47:29.000000000 +0000 | 5 | --- net/tap-bsd.c.orig 2013-08-15 19:56:23.000000000 +0000 | |
6 | +++ net/tap-bsd.c | 6 | +++ net/tap-bsd.c | |
7 | @@ -44,7 +44,7 @@ int tap_open(char *ifname, int ifname_si | 7 | @@ -45,6 +45,7 @@ int tap_open(char *ifname, int ifname_si | |
8 | struct stat s; | |||
9 | #endif | 8 | #endif | |
10 | 9 | |||
11 | -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) | 10 | #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ | |
12 | +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__NetBSD__) | 11 | + defined(__NetBSD__) || \ | |
12 | defined(__OpenBSD__) || defined(__APPLE__) | |||
13 | /* if no ifname is given, always start the search from tap0/tun0. */ | 13 | /* if no ifname is given, always start the search from tap0/tun0. */ | |
14 | int i; | 14 | int i; | |
15 | char dname[100]; |
@@ -1,20 +1,20 @@ | @@ -1,20 +1,20 @@ | |||
1 | $NetBSD: patch-user-exec.c,v 1.2 2013/07/09 17:00:58 tsutsui Exp $ | 1 | $NetBSD: patch-user-exec.c,v 1.3 2013/08/16 21:20:11 adam Exp $ | |
2 | 2 | |||
3 | Add OS dependent code for NetBSD/arm. | 3 | Add OS dependent code for NetBSD/arm. | |
4 | 4 | |||
5 | --- user-exec.c.orig 2013-06-26 21:47:30.000000000 +0000 | 5 | --- user-exec.c.orig 2013-08-15 19:56:23.000000000 +0000 | |
6 | +++ user-exec.c | 6 | +++ user-exec.c | |
7 | @@ -428,19 +428,31 @@ int cpu_signal_handler(int host_signum, | 7 | @@ -434,19 +434,31 @@ int cpu_signal_handler(int host_signum, | |
8 | 8 | |||
9 | #elif defined(__arm__) | 9 | #elif defined(__arm__) | |
10 | 10 | |||
11 | +#if defined(__NetBSD__) | 11 | +#if defined(__NetBSD__) | |
12 | +#include <ucontext.h> | 12 | +#include <ucontext.h> | |
13 | +#endif | 13 | +#endif | |
14 | + | 14 | + | |
15 | int cpu_signal_handler(int host_signum, void *pinfo, | 15 | int cpu_signal_handler(int host_signum, void *pinfo, | |
16 | void *puc) | 16 | void *puc) | |
17 | { | 17 | { | |
18 | siginfo_t *info = pinfo; | 18 | siginfo_t *info = pinfo; | |
19 | +#if defined(__NetBSD__) | 19 | +#if defined(__NetBSD__) | |
20 | + ucontext_t *uc = puc; | 20 | + ucontext_t *uc = puc; | |
@@ -23,16 +23,16 @@ Add OS dependent code for NetBSD/arm. | @@ -23,16 +23,16 @@ Add OS dependent code for NetBSD/arm. | |||
23 | +#endif | 23 | +#endif | |
24 | unsigned long pc; | 24 | unsigned long pc; | |
25 | int is_write; | 25 | int is_write; | |
26 | 26 | |||
27 | +#if defined(__NetBSD__) | 27 | +#if defined(__NetBSD__) | |
28 | + pc = uc->uc_mcontext.__gregs[_REG_R15]; | 28 | + pc = uc->uc_mcontext.__gregs[_REG_R15]; | |
29 | +#else | 29 | +#else | |
30 | #if defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3)) | 30 | #if defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3)) | |
31 | pc = uc->uc_mcontext.gregs[R15]; | 31 | pc = uc->uc_mcontext.gregs[R15]; | |
32 | #else | 32 | #else | |
33 | pc = uc->uc_mcontext.arm_pc; | 33 | pc = uc->uc_mcontext.arm_pc; | |
34 | #endif | 34 | #endif | |
35 | +#endif | 35 | +#endif | |
36 | /* XXX: compute is_write */ | 36 | ||
37 | is_write = 0; | 37 | /* error_code is the FSR value, in which bit 11 is WnR (assuming a v6 or | |
38 | return handle_cpu_signal(pc, (unsigned long)info->si_addr, | 38 | * later processor; on v5 we will always report this as a read). |