aboutsummaryrefslogtreecommitdiff
path: root/emulators/qemu
diff options
context:
space:
mode:
authorJuergen Lock <nox@FreeBSD.org>2008-01-20 17:16:05 +0000
committerJuergen Lock <nox@FreeBSD.org>2008-01-20 17:16:05 +0000
commit12150beb719bbd8c1dd486b0551cfe68d9ba7bc4 (patch)
treef55296d64823143f8ab9751ceed1b7c1586a2cea /emulators/qemu
parentf632dada472c0283e00359ce2afc1e575410dcbf (diff)
downloadports-12150beb719bbd8c1dd486b0551cfe68d9ba7bc4.tar.gz
ports-12150beb719bbd8c1dd486b0551cfe68d9ba7bc4.zip
Notes
Diffstat (limited to 'emulators/qemu')
-rw-r--r--emulators/qemu/Makefile24
-rw-r--r--emulators/qemu/distinfo9
-rw-r--r--emulators/qemu/files/patch-90_security107
-rw-r--r--emulators/qemu/files/patch-Makefile15
-rw-r--r--emulators/qemu/files/patch-Makefile.target37
-rw-r--r--emulators/qemu/files/patch-ac12
-rw-r--r--emulators/qemu/files/patch-bd18
-rw-r--r--emulators/qemu/files/patch-be12
-rw-r--r--emulators/qemu/files/patch-bg6
-rw-r--r--emulators/qemu/files/patch-bk16
-rw-r--r--emulators/qemu/files/patch-bsdusb.patch23
-rw-r--r--emulators/qemu/files/patch-bt40
-rw-r--r--emulators/qemu/files/patch-fbsd15
-rw-r--r--emulators/qemu/files/patch-fpu-softfloat-native.c2
-rw-r--r--emulators/qemu/files/patch-hw-eepro100.c50
-rw-r--r--emulators/qemu/files/patch-hw-vmware_vga.c12
-rw-r--r--emulators/qemu/files/patch-qemu-img.c8
-rw-r--r--emulators/qemu/files/patch-qemu-img.texi6
-rw-r--r--emulators/qemu/files/patch-vl.c51
-rw-r--r--emulators/qemu/files/patch-vl.c-nographic4
-rw-r--r--emulators/qemu/files/patch-vl.c-ppbus13
-rw-r--r--emulators/qemu/pkg-message12
-rw-r--r--emulators/qemu/pkg-plist9
23 files changed, 280 insertions, 221 deletions
diff --git a/emulators/qemu/Makefile b/emulators/qemu/Makefile
index 8cadd3d041ec..9a7cfa653992 100644
--- a/emulators/qemu/Makefile
+++ b/emulators/qemu/Makefile
@@ -6,19 +6,12 @@
#
PORTNAME= qemu
-PORTVERSION= 0.9.0
-PORTREVISION= 4
+PORTVERSION= 0.9.1
CATEGORIES= emulators
MASTER_SITES= http://fabrice.bellard.free.fr/qemu/:release \
http://qemu.org/:release \
- http://qemu-forum.ipi.fi/qemu-snapshots/:snapshot \
- http://people.fruitsalad.org/nox/qemu/:snapshot \
- http://www.volny.cz/xnavara/qemu/:snapshot \
- http://people.brandeis.edu/~jcoiner/qemu_idedma/:idedma \
- http://people.freebsd.org/~maho/qemu/:misc \
- http://people.freebsd.org/~jkim/:bios
-DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:release \
- qemu-bios.bin:bios
+ http://people.freebsd.org/~maho/qemu/:misc
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:release
DIST_SUBDIR= qemu
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
@@ -30,7 +23,7 @@ USE_GMAKE= yes
USE_GETOPT_LONG= yes
USE_PERL5= yes
USE_GCC= 3.4
-PATCH_STRIP= -p1
+PATCH_STRIP= -lp1
CONFIGURE_ARGS+= --prefix=${PREFIX} --cc=${CC}
MAKE_ENV+= BSD_MAKE="${MAKE}" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
MAN1= qemu.1 qemu-img.1
@@ -46,7 +39,14 @@ OPTIONS= KQEMU "Build with (alpha!) accelerator module" Off \
.include <bsd.port.pre.mk>
+.if ${OSVERSION} < 600000
+# 5.x base gcc segfaults in target-mips/op_mem.c
+BUILD_DEPENDS+= gcc34:${PORTSDIR}/lang/gcc34
+CC= gcc34
+.endif
+
WITHOUT_CPU_CFLAGS=yes #to avoid problems with register allocation
+CFLAGS:= ${CFLAGS:C/-fno-tree-vrp//}
.if defined(WITHOUT_SDL)
CONFIGURE_ARGS+= --disable-sdl --disable-gfx-check
@@ -64,7 +64,6 @@ RUN_DEPENDS+= ${LOCALBASE}/sbin/smbd:${PORTSDIR}/net/samba3
.if defined(WITH_KQEMU)
BUILD_DEPENDS+= kqemu-kmod>=1.3.0pre5:${PORTSDIR}/emulators/kqemu-kmod
-CONFIGURE_ARGS+= --enable-kqemu
.else
CONFIGURE_ARGS+= --disable-kqemu
.endif
@@ -83,7 +82,6 @@ post-extract:
@${MKDIR} ${WRKSRC}/kqemu
@${TOUCH} ${WRKSRC}/kqemu/Makefile
@${ECHO} all: > ${WRKSRC}/kqemu/Makefile.freebsd
- @${CP} -p ${_DISTDIR}/qemu-bios.bin ${WRKSRC}/pc-bios/bios.bin
pre-patch:
@for A in ${ONLY_FOR_ARCHS}; do \
diff --git a/emulators/qemu/distinfo b/emulators/qemu/distinfo
index c0f25c774916..48e6e01d2c0c 100644
--- a/emulators/qemu/distinfo
+++ b/emulators/qemu/distinfo
@@ -1,9 +1,6 @@
-MD5 (qemu/qemu-0.9.0.tar.gz) = ab11a03ba30cf4a70641f0f170473d69
-SHA256 (qemu/qemu-0.9.0.tar.gz) = 491facf9335654967ee53d8fb3540a274bfcbdcc225506bd38c4ee8e9ab405c1
-SIZE (qemu/qemu-0.9.0.tar.gz) = 1901741
-MD5 (qemu/qemu-bios.bin) = 173e256f17b4ac1f6e3249c83071e8f5
-SHA256 (qemu/qemu-bios.bin) = 452d863ec8ac9e2246950ac204410e847cdeba880d7bec2aeb79c4f2fbb0ad17
-SIZE (qemu/qemu-bios.bin) = 131072
+MD5 (qemu/qemu-0.9.1.tar.gz) = 6591df8e9270eb358c881de4ebea1262
+SHA256 (qemu/qemu-0.9.1.tar.gz) = 4756d0b4a4dc7dd88354bc6b37d381e4462dd328d0feef94803e90c0455835a5
+SIZE (qemu/qemu-0.9.1.tar.gz) = 2804104
MD5 (qemu/patch3_cirrus) = ebe7ed9fce804c49e024bc93bfdfc810
SHA256 (qemu/patch3_cirrus) = e862371834b7d895a896fbdb84fd9f70d17b5729a6f6789a48a61504fc941e11
SIZE (qemu/patch3_cirrus) = 8817
diff --git a/emulators/qemu/files/patch-90_security b/emulators/qemu/files/patch-90_security
index 6795825fa016..8de4cb5949f3 100644
--- a/emulators/qemu/files/patch-90_security
+++ b/emulators/qemu/files/patch-90_security
@@ -1,7 +1,4 @@
Index: qemu-0.8.2/hw/cirrus_vga.c
-===================================================================
---- qemu-0.8.2.orig/hw/cirrus_vga.c 2007-04-20 06:05:59.000000000 +0300
-+++ qemu-0.8.2/hw/cirrus_vga.c 2007-04-20 06:05:59.000000000 +0300
@@ -217,6 +217,20 @@
#define CIRRUS_HOOK_NOT_HANDLED 0
#define CIRRUS_HOOK_HANDLED 1
@@ -23,7 +20,7 @@ Index: qemu-0.8.2/hw/cirrus_vga.c
struct CirrusVGAState;
typedef void (*cirrus_bitblt_rop_t) (struct CirrusVGAState *s,
uint8_t * dst, const uint8_t * src,
-@@ -589,7 +603,7 @@ static void cirrus_invalidate_region(Cir
+@@ -636,7 +650,7 @@
for (y = 0; y < lines; y++) {
off_cur = off_begin;
@@ -32,20 +29,20 @@ Index: qemu-0.8.2/hw/cirrus_vga.c
off_cur &= TARGET_PAGE_MASK;
while (off_cur < off_cur_end) {
cpu_physical_memory_set_dirty(s->vram_offset + off_cur);
-@@ -604,7 +618,11 @@ static int cirrus_bitblt_common_patternc
+@@ -651,7 +665,11 @@
{
uint8_t *dst;
- dst = s->vram_ptr + s->cirrus_blt_dstaddr;
+ dst = s->vram_ptr + (s->cirrus_blt_dstaddr & s->cirrus_addr_mask);
-+
++
+ if (BLTUNSAFE(s))
+ return 0;
+
(*s->cirrus_rop) (s, dst, src,
s->cirrus_blt_dstpitch, 0,
s->cirrus_blt_width, s->cirrus_blt_height);
-@@ -620,8 +638,11 @@ static int cirrus_bitblt_solidfill(Cirru
+@@ -667,8 +685,11 @@
{
cirrus_fill_t rop_func;
@@ -58,7 +55,7 @@ Index: qemu-0.8.2/hw/cirrus_vga.c
s->cirrus_blt_dstpitch,
s->cirrus_blt_width, s->cirrus_blt_height);
cirrus_invalidate_region(s, s->cirrus_blt_dstaddr,
-@@ -640,8 +661,8 @@ static int cirrus_bitblt_solidfill(Cirru
+@@ -687,8 +708,8 @@
static int cirrus_bitblt_videotovideo_patterncopy(CirrusVGAState * s)
{
return cirrus_bitblt_common_patterncopy(s,
@@ -69,9 +66,9 @@ Index: qemu-0.8.2/hw/cirrus_vga.c
}
static void cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h)
-@@ -691,8 +712,10 @@ static void cirrus_do_copy(CirrusVGAStat
+@@ -738,8 +759,10 @@
if (notify)
- video_hw_update();
+ vga_hw_update();
- (*s->cirrus_rop) (s, s->vram_ptr + s->cirrus_blt_dstaddr,
- s->vram_ptr + s->cirrus_blt_srcaddr,
@@ -82,7 +79,7 @@ Index: qemu-0.8.2/hw/cirrus_vga.c
s->cirrus_blt_dstpitch, s->cirrus_blt_srcpitch,
s->cirrus_blt_width, s->cirrus_blt_height);
-@@ -718,8 +741,14 @@ static int cirrus_bitblt_videotovideo_co
+@@ -765,8 +788,14 @@
s->cirrus_blt_srcaddr - s->start_addr,
s->cirrus_blt_width, s->cirrus_blt_height);
} else {
@@ -99,7 +96,7 @@ Index: qemu-0.8.2/hw/cirrus_vga.c
s->cirrus_blt_dstpitch, s->cirrus_blt_srcpitch,
s->cirrus_blt_width, s->cirrus_blt_height);
-@@ -751,8 +780,9 @@ static void cirrus_bitblt_cputovideo_nex
+@@ -798,8 +827,9 @@
} else {
/* at least one scan line */
do {
@@ -111,7 +108,7 @@ Index: qemu-0.8.2/hw/cirrus_vga.c
cirrus_invalidate_region(s, s->cirrus_blt_dstaddr, 0,
s->cirrus_blt_width, 1);
s->cirrus_blt_dstaddr += s->cirrus_blt_dstpitch;
-@@ -1852,7 +1882,7 @@ static void cirrus_mem_writeb_mode4and5_
+@@ -1917,7 +1947,7 @@
unsigned val = mem_value;
uint8_t *dst;
@@ -120,7 +117,7 @@ Index: qemu-0.8.2/hw/cirrus_vga.c
for (x = 0; x < 8; x++) {
if (val & 0x80) {
*dst = s->cirrus_shadow_gr1;
-@@ -1875,7 +1905,7 @@ static void cirrus_mem_writeb_mode4and5_
+@@ -1940,7 +1970,7 @@
unsigned val = mem_value;
uint8_t *dst;
@@ -166,69 +163,20 @@ Index: qemu-0.8.2/hw/dma.c
}
Index: qemu-0.8.2/hw/fdc.c
-===================================================================
---- qemu-0.8.2.orig/hw/fdc.c 2006-07-22 20:23:34.000000000 +0300
-+++ qemu-0.8.2/hw/fdc.c 2007-04-20 06:05:59.000000000 +0300
-@@ -1110,8 +1110,13 @@ static uint32_t fdctrl_read_data (fdctrl
+@@ -1247,7 +1247,12 @@
len = fdctrl->data_len - fdctrl->data_pos;
if (len > FD_SECTOR_LEN)
len = FD_SECTOR_LEN;
-- bdrv_read(cur_drv->bs, fd_sector(cur_drv),
-- fdctrl->fifo, len);
+- bdrv_read(cur_drv->bs, fd_sector(cur_drv), fdctrl->fifo, 1);
+ if (cur_drv->bs) {
-+ bdrv_read(cur_drv->bs, fd_sector(cur_drv),
-+ fdctrl->fifo, len);
++ bdrv_read(cur_drv->bs, fd_sector(cur_drv), fdctrl->fifo, 1);
+ } else {
+ FLOPPY_ERROR("can't read data from drive\n");
+ return 0;
-+ }
++ }
}
}
retval = fdctrl->fifo[pos];
-Index: qemu-0.8.2/hw/i8259.c
-===================================================================
---- qemu-0.8.2.orig/hw/i8259.c 2006-07-22 20:23:34.000000000 +0300
-+++ qemu-0.8.2/hw/i8259.c 2007-04-20 06:05:59.000000000 +0300
-@@ -292,9 +292,11 @@ static void pic_ioport_write(void *opaqu
- s->init_state = 1;
- s->init4 = val & 1;
- if (val & 0x02)
-- hw_error("single mode not supported");
-+ /* hw_error("single mode not supported"); */
-+ return;
- if (val & 0x08)
-- hw_error("level sensitive irq not supported");
-+ /* hw_error("level sensitive irq not supported"); */
-+ return;
- } else if (val & 0x08) {
- if (val & 0x04)
- s->poll = 1;
-Index: qemu-0.8.2/hw/ne2000.c
-===================================================================
---- qemu-0.8.2.orig/hw/ne2000.c 2007-04-20 06:05:59.000000000 +0300
-+++ qemu-0.8.2/hw/ne2000.c 2007-04-20 06:05:59.000000000 +0300
-@@ -230,7 +230,7 @@ static void ne2000_receive(void *opaque,
- {
- NE2000State *s = opaque;
- uint8_t *p;
-- int total_len, next, avail, len, index, mcast_idx;
-+ unsigned int total_len, next, avail, len, index, mcast_idx;
- uint8_t buf1[60];
- static const uint8_t broadcast_macaddr[6] =
- { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
-@@ -299,7 +299,11 @@ static void ne2000_receive(void *opaque,
-
- /* write packet data */
- while (size > 0) {
-- avail = s->stop - index;
-+ /* taviso: this can wrap, so check its okay. */
-+ if (index <= s->stop)
-+ avail = s->stop - index;
-+ else
-+ avail = 0;
- len = size;
- if (len > avail)
- len = avail;
Index: qemu-0.8.2/hw/pc.c
===================================================================
--- qemu-0.8.2.orig/hw/pc.c 2007-04-20 06:05:58.000000000 +0300
@@ -290,20 +238,6 @@ Index: qemu-0.8.2/target-i386/translate.c
===================================================================
--- qemu-0.8.2.orig/target-i386/translate.c 2006-07-22 20:23:34.000000000 +0300
+++ qemu-0.8.2/target-i386/translate.c 2007-04-20 06:05:59.000000000 +0300
-@@ -5244,7 +5244,12 @@ static target_ulong disas_insn(DisasCont
- if (CODE64(s))
- goto illegal_op;
- val = ldub_code(s->pc++);
-- gen_op_aam(val);
-+ /* taviso: operand can be zero */
-+ if (val) {
-+ gen_op_aam(val);
-+ } else {
-+ gen_exception(s, EXCP00_DIVZ, s->pc - s->cs_base);
-+ }
- s->cc_op = CC_OP_LOGICB;
- break;
- case 0xd5: /* aad */
@@ -5292,6 +5297,7 @@ static target_ulong disas_insn(DisasCont
gen_jmp_im(pc_start - s->cs_base);
gen_op_into(s->pc - pc_start);
@@ -379,3 +313,14 @@ Index: qemu/block.c
}
if (drv->bdrv_pwrite) {
int ret, len;
+Index: qemu/hw/i8259.c
+@@ -302,7 +302,8 @@
+ s->init4 = val & 1;
+ s->single_mode = val & 2;
+ if (val & 0x08)
+- hw_error("level sensitive irq not supported");
++ /* hw_error("level sensitive irq not supported"); */
++ return;
+ } else if (val & 0x08) {
+ if (val & 0x04)
+ s->poll = 1;
diff --git a/emulators/qemu/files/patch-Makefile b/emulators/qemu/files/patch-Makefile
index 58defdea2eac..effe2d44222c 100644
--- a/emulators/qemu/files/patch-Makefile
+++ b/emulators/qemu/files/patch-Makefile
@@ -1,6 +1,6 @@
Index: qemu/Makefile
-@@ -20,6 +20,10 @@
- LDFLAGS+=-static
+@@ -19,7 +19,11 @@
+ BASE_LDFLAGS += -static
endif
ifdef BUILD_DOCS
+ifdef NOPORTDOCS
@@ -10,17 +10,8 @@ Index: qemu/Makefile
+endif
else
DOCS=
-@@ -28,7 +28,8 @@
- ifndef CONFIG_DARWIN
- ifndef CONFIG_WIN32
- ifndef CONFIG_SOLARIS
--LIBS+=-lrt
-+# XXX need ifndef CONFIG_BSD
-+# LIBS+=-lrt
- endif
- endif
endif
-@@ -72,8 +75,10 @@
+@@ -60,8 +64,10 @@
common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
install-doc: $(DOCS)
diff --git a/emulators/qemu/files/patch-Makefile.target b/emulators/qemu/files/patch-Makefile.target
new file mode 100644
index 000000000000..601f15c2e495
--- /dev/null
+++ b/emulators/qemu/files/patch-Makefile.target
@@ -0,0 +1,37 @@
+Index: qemu/Makefile.target
+@@ -139,11 +139,11 @@
+ endif
+ endif
+
+-ifeq ($(ARCH),x86_64)
+- ifneq ($(CONFIG_SOLARIS),yes)
+- BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
+- endif
+-endif
++#ifeq ($(ARCH),x86_64)
++# ifneq ($(CONFIG_SOLARIS),yes)
++# BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
++# endif
++#endif
+
+ ifeq ($(ARCH),ppc)
+ CPPFLAGS+= -D__powerpc__
+@@ -560,12 +560,12 @@
+ endif
+ endif
+
+-ifeq ($(ARCH),x86_64)
+- VL_LDFLAGS+=-m64
+- ifneq ($(CONFIG_SOLARIS),yes)
+- VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
+- endif
+-endif
++#ifeq ($(ARCH),x86_64)
++# VL_LDFLAGS+=-m64
++# ifneq ($(CONFIG_SOLARIS),yes)
++# VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
++# endif
++#endif
+
+ ifdef CONFIG_WIN32
+ SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
diff --git a/emulators/qemu/files/patch-ac b/emulators/qemu/files/patch-ac
index 8adf3dbd9637..99821158695d 100644
--- a/emulators/qemu/files/patch-ac
+++ b/emulators/qemu/files/patch-ac
@@ -1,10 +1,10 @@
Index: qemu/configure
-@@ -204,7 +204,7 @@
+@@ -540,7 +540,7 @@
+ sdl_too_old=no
if test -z "$sdl" ; then
-
--sdl_config="sdl-config"
-+sdl_config="${SDL_CONFIG}"
- sdl=no
- sdl_static=no
+- sdl_config="sdl-config"
++ sdl_config="${SDL_CONFIG}"
+ sdl=no
+ sdl_static=no
diff --git a/emulators/qemu/files/patch-bd b/emulators/qemu/files/patch-bd
index 3f85d63c03a1..b8b49a136432 100644
--- a/emulators/qemu/files/patch-bd
+++ b/emulators/qemu/files/patch-bd
@@ -1,10 +1,10 @@
Index: qemu/configure
-@@ -286,7 +286,7 @@
- if test -z "$prefix" ; then
- prefix="/usr/local"
- fi
--mandir="$prefix/share/man"
-+mandir="$prefix/man"
- datadir="$prefix/share/qemu"
- docdir="$prefix/share/doc/qemu"
- bindir="$prefix/bin"
+@@ -570,7 +570,7 @@
+ 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/files/patch-be b/emulators/qemu/files/patch-be
index 71753fa84dfe..a8a5ba663df3 100644
--- a/emulators/qemu/files/patch-be
+++ b/emulators/qemu/files/patch-be
@@ -1,15 +1,3 @@
-Index: qemu/Makefile.target
-@@ -404,7 +404,9 @@
- ifndef CONFIG_DARWIN
- ifndef CONFIG_WIN32
- ifndef CONFIG_SOLARIS
--VL_LIBS=-lutil -lrt
-+#VL_LIBS=-lutil -lrt
-+# XXX this cant be just merged back...
-+VL_LIBS=-lutil
- endif
- endif
- endif
Index: qemu/vl.c
@@ -541,7 +541,7 @@
static void init_get_clock(void)
diff --git a/emulators/qemu/files/patch-bg b/emulators/qemu/files/patch-bg
index d93e26741ce8..eaa753d13cb4 100644
--- a/emulators/qemu/files/patch-bg
+++ b/emulators/qemu/files/patch-bg
@@ -9,11 +9,11 @@ Index: qemu/Makefile.target
ifndef CONFIG_USER_ONLY
LIBS+=-lz
Index: qemu/vl.c
-@@ -89,10 +89,12 @@
- #include "exec-all.h"
+@@ -133,10 +133,12 @@
#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
-+#ifndef SMBD_COMMAND
+ #define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
++#ifndef SMBD_COMMAND
#ifdef __sun__
#define SMBD_COMMAND "/usr/sfw/sbin/smbd"
#else
diff --git a/emulators/qemu/files/patch-bk b/emulators/qemu/files/patch-bk
index 09281f31aef2..07ddb13c2629 100644
--- a/emulators/qemu/files/patch-bk
+++ b/emulators/qemu/files/patch-bk
@@ -97,7 +97,7 @@ Index: qemu/slirp/bootp.c
- dprintf("bootp packet op=%d msgtype=%d\n", bp->bp_op, dhcp_msg_type);
+ dhcp_decode(bp->bp_vend, DHCP_OPT_LEN, &dhcp_msg_type,&reqaddr);
+ dprintf("bootp packet op=%d msgtype=%d reqaddr=%x\n", bp->bp_op, dhcp_msg_type,ntohl(reqaddr.sin_addr.s_addr));
-
+
if (dhcp_msg_type == 0)
dhcp_msg_type = DHCPREQUEST; /* Force reply for old BOOTP clients */
@@ -152,21 +185,18 @@
@@ -122,14 +122,14 @@ Index: qemu/slirp/bootp.c
+ bc=NULL;
+ daddr.sin_addr.s_addr=htonl(0L);
+ if (dhcp_msg_type == DHCPREQUEST) {
-+ if (reqaddr.sin_addr.s_addr != htonl(0L))
-+ bc = find_reqaddr(&daddr.sin_addr, &reqaddr.sin_addr, bp->bp_hwaddr);
-+ else
-+ bc = find_addr(&daddr.sin_addr, bp->bp_hwaddr);
++ if (reqaddr.sin_addr.s_addr != htonl(0L))
++ bc = find_reqaddr(&daddr.sin_addr, &reqaddr.sin_addr, bp->bp_hwaddr);
++ else
++ bc = find_addr(&daddr.sin_addr, bp->bp_hwaddr);
+ }
+ else if (dhcp_msg_type == DHCPDISCOVER) {
-+ bc = find_addr(&daddr.sin_addr, bp->bp_hwaddr);
-+ if (!bc)
++ bc = find_addr(&daddr.sin_addr, bp->bp_hwaddr);
++ if (!bc)
+ bc = get_new_addr(&daddr.sin_addr);
}
dprintf("offered addr=%08x\n", ntohl(daddr.sin_addr.s_addr));
@@ -165,7 +165,7 @@ Index: qemu/slirp/bootp.c
- *q++ = DHCPACK;
- }
+ *q++ = replytype;
-
+
- if (dhcp_msg_type == DHCPDISCOVER ||
- dhcp_msg_type == DHCPREQUEST) {
+ if ((dhcp_msg_type == DHCPDISCOVER ||
diff --git a/emulators/qemu/files/patch-bsdusb.patch b/emulators/qemu/files/patch-bsdusb.patch
index ce1686004eaa..e51144070a1d 100644
--- a/emulators/qemu/files/patch-bsdusb.patch
+++ b/emulators/qemu/files/patch-bsdusb.patch
@@ -35,16 +35,16 @@ Index: qemu/configure
for target in $target_list; do
target_dir="$target"
-Index: qemu/Makefile.target
-@@ -329,7 +329,7 @@
- VL_OBJS+= scsi-disk.o cdrom.o lsi53c895a.o
+Index: qemu/Makefile
+@@ -61,7 +61,7 @@
+ OBJS+=ssd0303.o ssd0323.o ads7846.o stellaris_input.o
+ OBJS+=scsi-disk.o cdrom.o
+ OBJS+=scsi-generic.o
+-OBJS+=usb.o usb-hub.o usb-linux.o usb-hid.o usb-msd.o usb-wacom.o
++OBJS+=usb.o usb-hub.o usb-$(HOST_USB).o usb-hid.o usb-msd.o usb-wacom.o
+ OBJS+=sd.o ssi-sd.o
- # USB layer
--VL_OBJS+= usb.o usb-hub.o usb-linux.o usb-hid.o usb-ohci.o usb-msd.o
-+VL_OBJS+= usb.o usb-hub.o usb-$(HOST_USB).o usb-hid.o usb-ohci.o usb-msd.o
-
- # PCI network cards
- VL_OBJS+= ne2000.o rtl8139.o pcnet.o
+ ifdef CONFIG_WIN32
Index: qemu/usb-stub.c
@@ -0,0 +1,11 @@
+#include "vl.h"
@@ -59,7 +59,7 @@ Index: qemu/usb-stub.c
+ return NULL;
+}
Index: qemu/usb-bsd.c
-@@ -0,0 +1,600 @@
+@@ -0,0 +1,601 @@
+/*
+ * BSD host USB redirector
+ *
@@ -86,7 +86,8 @@ Index: qemu/usb-bsd.c
+ * THE SOFTWARE.
+ */
+
-+#include "vl.h"
++#include "qemu-common.h"
++#include "hw/usb.h"
+
+/* usb.h declares these */
+#undef USB_SPEED_HIGH
diff --git a/emulators/qemu/files/patch-bt b/emulators/qemu/files/patch-bt
index 62e8924722b3..1280458f2c16 100644
--- a/emulators/qemu/files/patch-bt
+++ b/emulators/qemu/files/patch-bt
@@ -1,15 +1,17 @@
Index: qemu/vl.c
-@@ -43,6 +43,9 @@
- #ifndef __APPLE__
- #include <libutil.h>
+@@ -76,6 +76,11 @@
+ #endif
+ #endif
#endif
+#ifdef __FreeBSD__
++#include <sys/param.h>
+#include <sys/module.h>
++#include <sys/linker.h>
+#endif
- #else
- #include <linux/if.h>
- #include <linux/if_tun.h>
-@@ -1059,6 +1062,34 @@
+
+ #if defined(CONFIG_SLIRP)
+ #include "libslirp.h"
+@@ -3407,6 +3410,34 @@
#endif /* CONFIG_SLIRP */
@@ -42,9 +44,9 @@ Index: qemu/vl.c
+#endif
+
#if !defined(_WIN32)
- #ifdef _BSD
- static int tun_open(char *ifname, int ifname_size)
-@@ -1067,11 +1098,55 @@
+
+ typedef struct TAPState {
+@@ -3470,11 +3501,59 @@
char *dev;
struct stat s;
@@ -61,12 +63,14 @@ Index: qemu/vl.c
+ i = 0;
+#endif
+ for (; i < 10; i++) {
-+ if (i == -1)
-+ strcpy(dname, "/dev/tap");
++ if (*ifname)
++ snprintf(dname, sizeof dname, "/dev/%s", ifname);
++ else if (i == -1)
++ strcpy(dname, "/dev/tap");
+ else
-+ snprintf(dname, sizeof dname, "%s%d",
-+ "/dev/tap", i);
-+ fd = open(dname, O_RDWR);
++ snprintf(dname, sizeof dname, "%s%d",
++ "/dev/tap", i);
++ TFR(fd = open(dname, O_RDWR));
+ if (fd >= 0)
+ break;
+ else if (errno == ENXIO || errno == ENOENT) {
@@ -81,17 +85,19 @@ Index: qemu/vl.c
+ }
+ if (errno != ENOENT || ++enoentcount > 3) {
+ err = errno;
-+ break;
++ break;
+ }
+ } else
+ err = errno;
++ if (*ifname)
++ break;
+ }
+ if (fd < 0) {
+ fprintf(stderr, "warning: could not open %s (%s): no virtual network emulation\n", dname, strerror(err));
+ return -1;
+ }
+#else
- fd = open("/dev/tap", O_RDWR);
+ TFR(fd = open("/dev/tap", O_RDWR));
if (fd < 0) {
- fprintf(stderr, "warning: could not open /dev/tap: no virtual network emulation\n");
+ fprintf(stderr, "warning: could not open /dev/tap (%s): no virtual network emulation\n", strerror(errno));
diff --git a/emulators/qemu/files/patch-fbsd b/emulators/qemu/files/patch-fbsd
index 7195d62837b8..9fe09215c144 100644
--- a/emulators/qemu/files/patch-fbsd
+++ b/emulators/qemu/files/patch-fbsd
@@ -20,17 +20,16 @@ Index: qemu/Makefile
rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~
$(MAKE) -C tests clean
Index: qemu/Makefile.target
-@@ -391,8 +391,8 @@
- VL_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
+@@ -571,7 +571,7 @@
+ SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
endif
--$(QEMU_SYSTEM): $(VL_OBJS) libqemu.a
-- $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS)
-+$(QEMU_SYSTEM): $(VL_OBJS) libqemu.a ../bsd/libmath.a
-+ $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS) ../bsd/libmath.a
+-$(QEMU_SYSTEM): $(VL_OBJS) ../libqemu_common.a libqemu.a
+- $(CC) $(VL_LDFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS)
++$(QEMU_SYSTEM): $(VL_OBJS) ../libqemu_common.a libqemu.a ../bsd/libmath.a
++ $(CC) $(VL_LDFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS) ../bsd/libmath.a
- cocoa.o: cocoa.m
- $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
+ depend: $(SRCS)
Index: qemu/fpu/softfloat-native.c
@@ -2,11 +2,16 @@
context is supported */
diff --git a/emulators/qemu/files/patch-fpu-softfloat-native.c b/emulators/qemu/files/patch-fpu-softfloat-native.c
index 0a7f3018835c..7e2662eb7457 100644
--- a/emulators/qemu/files/patch-fpu-softfloat-native.c
+++ b/emulators/qemu/files/patch-fpu-softfloat-native.c
@@ -14,4 +14,4 @@ Index: qemu/fpu/softfloat-native.c
+#endif
}
- float64 float64_round_to_int( float64 a STATUS_PARAM ) \ No newline at end of file
+ float64 float64_round_to_int( float64 a STATUS_PARAM )
diff --git a/emulators/qemu/files/patch-hw-eepro100.c b/emulators/qemu/files/patch-hw-eepro100.c
new file mode 100644
index 000000000000..79337757bde1
--- /dev/null
+++ b/emulators/qemu/files/patch-hw-eepro100.c
@@ -0,0 +1,50 @@
+Index: qemu/hw/eepro100.c
+@@ -729,6 +729,7 @@
+ logout
+ ("TBD (simplified mode): buffer address 0x%08x, size 0x%04x\n",
+ tx_buffer_address, tx_buffer_size);
++ assert(size + tx_buffer_size <= sizeof(buf));
+ cpu_physical_memory_read(tx_buffer_address, &buf[size],
+ tx_buffer_size);
+ size += tx_buffer_size;
+@@ -749,9 +750,13 @@
+ logout
+ ("TBD (extended mode): buffer address 0x%08x, size 0x%04x\n",
+ tx_buffer_address, tx_buffer_size);
+- cpu_physical_memory_read(tx_buffer_address, &buf[size],
+- tx_buffer_size);
+- size += tx_buffer_size;
++ if (size + tx_buffer_size > sizeof(buf)) {
++ logout("bad extended TCB with size 0x%04x\n", tx_buffer_size);
++ } else {
++ cpu_physical_memory_read(tx_buffer_address, &buf[size],
++ tx_buffer_size);
++ size += tx_buffer_size;
++ }
+ if (tx_buffer_el & 1) {
+ break;
+ }
+@@ -766,14 +771,20 @@
+ logout
+ ("TBD (flexible mode): buffer address 0x%08x, size 0x%04x\n",
+ tx_buffer_address, tx_buffer_size);
+- cpu_physical_memory_read(tx_buffer_address, &buf[size],
+- tx_buffer_size);
+- size += tx_buffer_size;
++ if (size + tx_buffer_size > sizeof(buf)) {
++ logout("bad flexible TCB with size 0x%04x\n", tx_buffer_size);
++ } else {
++ cpu_physical_memory_read(tx_buffer_address, &buf[size],
++ tx_buffer_size);
++ size += tx_buffer_size;
++ }
+ if (tx_buffer_el & 1) {
+ break;
+ }
+ }
+ }
++ logout("%p sending frame, len=%d,%s\n", s, size, nic_dump(buf, size));
++ assert(size <= sizeof(buf));
+ qemu_send_packet(s->vc, buf, size);
+ s->statistics.tx_good_frames++;
+ /* Transmit with bad status would raise an CX/TNO interrupt.
diff --git a/emulators/qemu/files/patch-hw-vmware_vga.c b/emulators/qemu/files/patch-hw-vmware_vga.c
new file mode 100644
index 000000000000..83273bf17c9a
--- /dev/null
+++ b/emulators/qemu/files/patch-hw-vmware_vga.c
@@ -0,0 +1,12 @@
+Index: qemu/hw/vmware_vga.c
+@@ -26,8 +26,8 @@
+ #define VERBOSE
+ #define EMBED_STDVGA
+ #undef DIRECT_VRAM
+-#define HW_RECT_ACCEL
+-#define HW_FILL_ACCEL
++/* #define HW_RECT_ACCEL */
++/* #define HW_FILL_ACCEL */
+ #define HW_MOUSE_ACCEL
+
+ #ifdef EMBED_STDVGA
diff --git a/emulators/qemu/files/patch-qemu-img.c b/emulators/qemu/files/patch-qemu-img.c
index b525b50a3bcb..ff80ba070532 100644
--- a/emulators/qemu/files/patch-qemu-img.c
+++ b/emulators/qemu/files/patch-qemu-img.c
@@ -1,10 +1,10 @@
Index: qemu/qemu-img.c
-@@ -134,7 +134,7 @@
+@@ -90,7 +90,7 @@
"Command syntax:\n"
- " create [-e] [-b base_image] [-f fmt] filename [size]\n"
+ " create [-e] [-6] [-b base_image] [-f fmt] filename [size]\n"
" commit [-f fmt] filename\n"
-- " convert [-c] [-e] [-f fmt] filename [-O output_fmt] output_filename\n"
-+ " convert [-c] [-e] [-f fmt] [-O output_fmt] filename output_filename\n"
+- " convert [-c] [-e] [-6] [-f fmt] filename [filename2 [...]] [-O output_fmt] output_filename\n"
++ " convert [-c] [-e] [-6] [-f fmt] [-O output_fmt] filename [filename2 [...]] output_filename\n"
" info [-f fmt] filename\n"
"\n"
"Command parameters:\n"
diff --git a/emulators/qemu/files/patch-qemu-img.texi b/emulators/qemu/files/patch-qemu-img.texi
index 79693026dd2d..f89d1ea66664 100644
--- a/emulators/qemu/files/patch-qemu-img.texi
+++ b/emulators/qemu/files/patch-qemu-img.texi
@@ -1,10 +1,10 @@
Index: qemu/qemu-img.texi
@@ -10,7 +10,7 @@
@table @option
- @item create [-e] [-b @var{base_image}] [-f @var{fmt}] @var{filename} [@var{size}]
+ @item create [-e] [-6] [-b @var{base_image}] [-f @var{fmt}] @var{filename} [@var{size}]
@item commit [-f @var{fmt}] @var{filename}
--@item convert [-c] [-e] [-f @var{fmt}] @var{filename} [-O @var{output_fmt}] @var{output_filename}
-+@item convert [-c] [-e] [-f @var{fmt}] [-O @var{output_fmt}] @var{filename} @var{output_filename}
+-@item convert [-c] [-e] [-6] [-f @var{fmt}] @var{filename} [-O @var{output_fmt}] @var{output_filename}
++@item convert [-c] [-e] [-6] [-f @var{fmt}] [-O @var{output_fmt}] @var{filename} @var{output_filename}
@item info [-f @var{fmt}] @var{filename}
@end table
diff --git a/emulators/qemu/files/patch-vl.c b/emulators/qemu/files/patch-vl.c
index 437dafe471b2..8f920b047bed 100644
--- a/emulators/qemu/files/patch-vl.c
+++ b/emulators/qemu/files/patch-vl.c
@@ -1,21 +1,4 @@
Index: qemu/vl.c
-@@ -1510,7 +1510,7 @@
- return chr;
- }
-
--#if defined(__linux__)
-+#if defined(__linux__) || defined(__FreeBSD__)
- static CharDriverState *qemu_chr_open_pty(void)
- {
- struct termios tty;
-@@ -1665,6 +1665,7 @@
- return chr;
- }
-
-+#if defined(__linux__)
- static int pp_ioctl(CharDriverState *chr, int cmd, void *arg)
- {
- int fd = (int)chr->opaque;
@@ -1727,6 +1728,7 @@
chr->chr_ioctl = pp_ioctl;
return chr;
@@ -24,3 +7,37 @@ Index: qemu/vl.c
#else
CharDriverState *qemu_chr_open_pty(void)
+@@ -1771,14 +1771,14 @@
+ return chr;
+ }
+
+-#if defined(__linux__) || defined(__sun__)
++#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__)
+ static CharDriverState *qemu_chr_open_pty(void)
+ {
+ struct termios tty;
+ char slave_name[1024];
+ int master_fd, slave_fd;
+
+-#if defined(__linux__)
++#if defined(__linux__) || defined(__FreeBSD__)
+ /* Not satisfying */
+ if (openpty(&master_fd, &slave_fd, slave_name, NULL, NULL) < 0) {
+ return NULL;
+@@ -3036,7 +3036,7 @@
+ return qemu_chr_open_pp(filename);
+ } else
+ #endif
+-#if defined(__linux__) || defined(__sun__)
++#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__)
+ if (strstart(filename, "/dev/", NULL)) {
+ return qemu_chr_open_tty(filename);
+ } else
+@@ -8784,6 +8784,7 @@
+ #ifdef TARGET_ARM
+ case QEMU_OPTION_old_param:
+ old_param = 1;
++ break;
+ #endif
+ case QEMU_OPTION_clock:
+ configure_alarms(optarg);
diff --git a/emulators/qemu/files/patch-vl.c-nographic b/emulators/qemu/files/patch-vl.c-nographic
index be2f002c4920..eafbd45705af 100644
--- a/emulators/qemu/files/patch-vl.c-nographic
+++ b/emulators/qemu/files/patch-vl.c-nographic
@@ -1,8 +1,8 @@
Index: qemu/vl.c
-@@ -4668,6 +4668,7 @@
+@@ -7131,6 +7131,7 @@
case QEMU_OPTION_nographic:
- pstrcpy(monitor_device, sizeof(monitor_device), "stdio");
pstrcpy(serial_devices[0], sizeof(serial_devices[0]), "stdio");
+ pstrcpy(monitor_device, sizeof(monitor_device), "stdio");
+ pstrcpy(parallel_devices[0], sizeof(parallel_devices[0]), "null");
nographic = 1;
break;
diff --git a/emulators/qemu/files/patch-vl.c-ppbus b/emulators/qemu/files/patch-vl.c-ppbus
index d0b46abcbcb4..28cf485493d2 100644
--- a/emulators/qemu/files/patch-vl.c-ppbus
+++ b/emulators/qemu/files/patch-vl.c-ppbus
@@ -1,20 +1,21 @@
---- vl.c.orig Mon Aug 21 23:06:11 2006
-+++ vl.c Mon Aug 21 23:04:49 2006
-@@ -48,6 +48,8 @@
+Index: qemu/vl.c
+@@ -78,8 +78,10 @@
#endif
#ifdef __FreeBSD__
+ #include <sys/param.h>
#include <sys/module.h>
+ #include <sys/linker.h>
+#include <dev/ppbus/ppi.h>
+#include <dev/ppbus/ppbconf.h>
#endif
- #else
- #ifndef __sun__
+
+ #if defined(CONFIG_SLIRP)
@@ -1728,7 +1730,64 @@
chr->chr_ioctl = pp_ioctl;
return chr;
}
-#endif /* defined(__linux__) */
-+#elif defined(__FreeBSD__)
++#if defined(__FreeBSD__)
+static int pp_ioctl(CharDriverState *chr, int cmd, void *arg)
+{
+ int fd = (int)chr->opaque;
diff --git a/emulators/qemu/pkg-message b/emulators/qemu/pkg-message
index acdc84aa3e13..ec55725696fa 100644
--- a/emulators/qemu/pkg-message
+++ b/emulators/qemu/pkg-message
@@ -55,7 +55,10 @@ use qemu -net nic,model=rtl8139 -net user or tap ... enable the emulated
rtl8139 timer by building the port with RTL8139_TIMER enabled.
(the rtl8139c+ that model=rtl8139 emulates needs less cpu than qemu's
default ne2k nic which is driven by ed(4), it has not been made default
-only because it may not work with all guests yet.)
+only because it may not work with all guests yet. btw qemu now also can
+emulate a few intel eepro100 nics which seem to be a tad more efficient
+even, and at least i82557b works without tweaks for FreeBSD guests - driven
+by fxp(4) - and Linux guests too.)
- if you get repeated `atapi_poll called!' console messages with FreeBSD
guests or other weird cdrom problems then thats probably because the guest
has atapicam loaded, which for reasons still to be determined has problems
@@ -69,6 +72,13 @@ you please use tuntap for now. Scott Robbins posted a tap howto for
http://forums.bsdnexus.com/viewtopic.php?id=1563
and one for 6 and 5(?) is here:
http://acidos.bandwidth-junkies.net/index.php?Sect=qemu
+- perhaps it should be noted that if you want to use qemu with -m 512
+or larger on i386 hosts you need to increase the kern.maxdsiz tunable
+in loader.conf(5) since the default is 512 MB, and qemu needs memory for
+itself also.
+- kqemu seems to be broken on amd64 SMP hosts atm (causing the host
+to panic), if this affects you you can either use an UP host kernel as a
+workaround or disable kqemu.
- qemu now uses aio at least for ide dma, so if you get `Invalid system call'
crashes that is because aio is not (kld)loaded.
====
diff --git a/emulators/qemu/pkg-plist b/emulators/qemu/pkg-plist
index 30b74b1c2e0b..2df1145002d5 100644
--- a/emulators/qemu/pkg-plist
+++ b/emulators/qemu/pkg-plist
@@ -1,16 +1,23 @@
bin/qemu
bin/qemu-img
bin/qemu-system-arm
+bin/qemu-system-cris
+bin/qemu-system-m68k
bin/qemu-system-mips
+bin/qemu-system-mips64
+bin/qemu-system-mips64el
bin/qemu-system-mipsel
bin/qemu-system-ppc
+bin/qemu-system-ppc64
+bin/qemu-system-ppcemb
+bin/qemu-system-sh4
+bin/qemu-system-sh4eb
bin/qemu-system-sparc
bin/qemu-system-x86_64
%%PORTDOCS%%%%DOCSDIR%%/qemu-doc.html
%%PORTDOCS%%%%DOCSDIR%%/qemu-tech.html
%%PORTDOCS%%@dirrm %%DOCSDIR%%
%%DATADIR%%/bios.bin
-%%DATADIR%%/linux_boot.bin
%%DATADIR%%/vgabios.bin
%%DATADIR%%/vgabios-cirrus.bin
%%DATADIR%%/ppc_rom.bin