Index: Makefile =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/Makefile,v retrieving revision 1.75 diff -u -r1.75 Makefile --- Makefile 13 Dec 2007 01:10:52 -0000 1.75 +++ Makefile 7 Jan 2008 20:44:59 -0000 @@ -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_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 @@ -47,6 +40,7 @@ .include 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 +58,6 @@ .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 +76,6 @@ @${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 \ Index: distinfo =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/distinfo,v retrieving revision 1.41 diff -u -r1.41 distinfo --- distinfo 6 Feb 2007 23:49:01 -0000 1.41 +++ distinfo 7 Jan 2008 20:36:05 -0000 @@ -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 Index: pkg-plist =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/pkg-plist,v retrieving revision 1.18 diff -u -r1.18 pkg-plist --- pkg-plist 12 Jan 2007 00:13:58 -0000 1.18 +++ pkg-plist 5 Jan 2008 17:57:53 -0000 @@ -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 Index: files/patch-90_security =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/files/patch-90_security,v retrieving revision 1.1 diff -u -r1.1 patch-90_security --- files/patch-90_security 2 May 2007 19:54:05 -0000 1.1 +++ files/patch-90_security 5 Jan 2008 17:06:40 -0000 @@ -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 @@ 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 @@ 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 @@ 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 @@ } 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 @@ 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 @@ 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 @@ 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 @@ 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/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 @@ =================================================================== --- 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 @@ } 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; Index: files/patch-Makefile =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/files/patch-Makefile,v retrieving revision 1.2 diff -u -r1.2 patch-Makefile --- files/patch-Makefile 4 Nov 2006 18:29:35 -0000 1.2 +++ files/patch-Makefile 5 Jan 2008 16:52:26 -0000 @@ -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 @@ +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) Index: files/patch-PRId64 =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/files/patch-PRId64,v retrieving revision 1.1 diff -u -r1.1 patch-PRId64 --- files/patch-PRId64 21 Aug 2006 23:02:01 -0000 1.1 +++ files/patch-PRId64 5 Jan 2008 19:25:05 -0000 @@ -1,113 +0,0 @@ -Index: qemu/vl.h -@@ -30,6 +30,12 @@ - #include - #include - #include -+#ifndef PRId64 -+#define PRId64 "lld" /* int64_t */ -+#define PRIo64 "llo" /* int64_t */ -+#define PRIx64 "llx" /* int64_t */ -+#define PRIu64 "llu" /* int64_t */ -+#endif - #include - #include - #include -Index: qemu/dis-asm.h -@@ -13,6 +13,12 @@ - #include - #include - #include -+#ifndef PRId64 -+#define PRId64 "lld" /* int64_t */ -+#define PRIo64 "llo" /* int64_t */ -+#define PRIx64 "llx" /* int64_t */ -+#define PRIu64 "llu" /* int64_t */ -+#endif - - #define PARAMS(x) x - typedef void *PTR; -Index: qemu/kqemu.c -@@ -33,6 +33,12 @@ - #include - #include - #include -+#ifndef PRId64 -+#define PRId64 "lld" /* int64_t */ -+#define PRIo64 "llo" /* int64_t */ -+#define PRIx64 "llx" /* int64_t */ -+#define PRIu64 "llu" /* int64_t */ -+#endif - - #include "cpu.h" - #include "exec-all.h" -Index: qemu/translate-all.c -@@ -22,6 +22,12 @@ - #include - #include - #include -+#ifndef PRId64 -+#define PRId64 "lld" /* int64_t */ -+#define PRIo64 "llo" /* int64_t */ -+#define PRIx64 "llx" /* int64_t */ -+#define PRIu64 "llu" /* int64_t */ -+#endif - - #include "config.h" - -Index: qemu/target-i386/helper.c -@@ -21,6 +21,13 @@ - - //#define DEBUG_PCALL - -+#ifndef PRId64 -+#define PRId64 "lld" /* int64_t */ -+#define PRIo64 "llo" /* int64_t */ -+#define PRIx64 "llx" /* int64_t */ -+#define PRIu64 "llu" /* int64_t */ -+#endif -+ - #if 0 - #define raise_exception_err(a, b)\ - do {\ -Index: qemu/target-i386/helper2.c -@@ -22,6 +22,12 @@ - #include - #include - #include -+#ifndef PRId64 -+#define PRId64 "lld" /* int64_t */ -+#define PRIo64 "llo" /* int64_t */ -+#define PRIx64 "llx" /* int64_t */ -+#define PRIu64 "llu" /* int64_t */ -+#endif - #include - #include - -Index: qemu/target-ppc/translate.c -@@ -22,6 +22,12 @@ - #include - #include - #include -+#ifndef PRId64 -+#define PRId64 "lld" /* int64_t */ -+#define PRIo64 "llo" /* int64_t */ -+#define PRIx64 "llx" /* int64_t */ -+#define PRIu64 "llu" /* int64_t */ -+#endif - - #include "cpu.h" - #include "exec-all.h" -Index: qemu/target-sparc/helper.c -@@ -22,6 +22,12 @@ - #include - #include - #include -+#ifndef PRId64 -+#define PRId64 "lld" /* int64_t */ -+#define PRIo64 "llo" /* int64_t */ -+#define PRIx64 "llx" /* int64_t */ -+#define PRIu64 "llu" /* int64_t */ -+#endif - #include - #include - Index: files/patch-ac =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/files/patch-ac,v retrieving revision 1.2 diff -u -r1.2 patch-ac --- files/patch-ac 1 May 2005 07:39:11 -0000 1.2 +++ files/patch-ac 5 Jan 2008 16:52:26 -0000 @@ -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 Index: files/patch-audio::ossaudio.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/files/patch-audio::ossaudio.c,v retrieving revision 1.1 diff -u -r1.1 patch-audio::ossaudio.c --- files/patch-audio::ossaudio.c 17 Nov 2004 09:47:38 -0000 1.1 +++ files/patch-audio::ossaudio.c 7 Jan 2008 20:38:51 -0000 @@ -1,11 +0,0 @@ -Index: qemu/audio/ossaudio.c -@@ -21,8 +21,8 @@ - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ --#include - #include -+#include - #include - #include - #include Index: files/patch-bd =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/files/patch-bd,v retrieving revision 1.1 diff -u -r1.1 patch-bd --- files/patch-bd 3 Jun 2004 02:12:52 -0000 1.1 +++ files/patch-bd 5 Jan 2008 16:52:26 -0000 @@ -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" Index: files/patch-be =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/files/patch-be,v retrieving revision 1.4 diff -u -r1.4 patch-be --- files/patch-be 21 Aug 2006 23:02:01 -0000 1.4 +++ files/patch-be 5 Jan 2008 16:52:26 -0000 @@ -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) Index: files/patch-bg =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/files/patch-bg,v retrieving revision 1.5 diff -u -r1.5 patch-bg --- files/patch-bg 12 Jan 2007 00:13:58 -0000 1.5 +++ files/patch-bg 5 Jan 2008 17:11:15 -0000 @@ -9,11 +9,11 @@ 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 Index: files/patch-bh =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/files/patch-bh,v retrieving revision 1.3 diff -u -r1.3 patch-bh --- files/patch-bh 1 May 2005 07:39:11 -0000 1.3 +++ files/patch-bh 7 Jan 2008 20:38:51 -0000 @@ -1,26 +0,0 @@ -Index: qemu/dyngen-exec.h -=================================================================== -RCS file: /cvsroot/qemu/qemu/dyngen-exec.h,v -retrieving revision 1.12 -diff -w -u -d -r1.12 dyngen-exec.h ---- dyngen-exec.h 12 May 2004 19:32:15 -0000 1.12 -+++ dyngen-exec.h 21 May 2004 15:00:41 -0000 -@@ -21,6 +21,8 @@ - #define __DYNGEN_EXEC_H__ - - #include -+#include -+#include "config.h" - - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; -@@ -54,9 +56,6 @@ - #define UINT32_MAX (4294967295U) - #define UINT64_MAX ((uint64_t)(18446744073709551615)) - --typedef struct FILE FILE; --extern int fprintf(FILE *, const char *, ...); --extern int printf(const char *, ...); - #undef NULL - #define NULL 0 - #ifdef _BSD Index: files/patch-bk =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/files/patch-bk,v retrieving revision 1.3 diff -u -r1.3 patch-bk --- files/patch-bk 25 Oct 2004 14:57:30 -0000 1.3 +++ files/patch-bk 5 Jan 2008 16:52:26 -0000 @@ -97,7 +97,7 @@ - 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 @@ + 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 @@ - *q++ = DHCPACK; - } + *q++ = replytype; - + - if (dhcp_msg_type == DHCPDISCOVER || - dhcp_msg_type == DHCPREQUEST) { + if ((dhcp_msg_type == DHCPDISCOVER || Index: files/patch-block-qcow2.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/files/patch-block-qcow2.c,v retrieving revision 1.1 diff -u -r1.1 patch-block-qcow2.c --- files/patch-block-qcow2.c 26 May 2007 16:08:17 -0000 1.1 +++ files/patch-block-qcow2.c 7 Jan 2008 20:38:51 -0000 @@ -1,25 +0,0 @@ -Index: qemu/block-qcow2.c -@@ -1886,6 +1886,8 @@ - int64_t table_offset; - uint64_t data64; - uint32_t data32; -+ int old_table_size; -+ int64_t old_table_offset; - - if (min_size <= s->refcount_table_size) - return 0; -@@ -1931,10 +1933,14 @@ - &data32, sizeof(data32)) != sizeof(data32)) - goto fail; - qemu_free(s->refcount_table); -+ old_table_offset = s->refcount_table_offset; -+ old_table_size = s->refcount_table_size; - s->refcount_table = new_table; - s->refcount_table_size = new_table_size; -+ s->refcount_table_offset = table_offset; - - update_refcount(bs, table_offset, new_table_size2, 1); -+ free_clusters(bs, old_table_offset, old_table_size * sizeof(uint64_t)); - return 0; - fail: - free_clusters(bs, table_offset, new_table_size2); Index: files/patch-block-raw.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/files/patch-block-raw.c,v retrieving revision 1.4 diff -u -r1.4 patch-block-raw.c --- files/patch-block-raw.c 12 Jan 2007 00:13:58 -0000 1.4 +++ files/patch-block-raw.c 5 Jan 2008 19:25:10 -0000 @@ -1,51 +0,0 @@ -Index: qemu/block-raw.c -@@ -51,7 +51,10 @@ - #include - #include - #endif - #ifdef __FreeBSD__ -+#include -+#endif -+#if defined(__FreeBSD__) && __FreeBSD__ > 4 - #include - #endif - -@@ -167,9 +167,20 @@ - static int aio_sig_num = SIGUSR2; - static RawAIOCB *first_aio; /* AIO issued */ - static int aio_initialized = 0; -+// FreeBSD 4.x doesn't have sigwait -+#if defined(__FreeBSD__) && __FreeBSD__ <= 4 -+static int sigaio_dont = 0; -+#endif - - static void aio_signal_handler(int signum) - { -+// FreeBSD 4.x doesn't have sigwait -+#if defined(__FreeBSD__) && __FreeBSD__ <= 4 -+ if (sigaio_dont) { -+ --sigaio_dont; -+ return; -+ } -+#endif - #ifndef QEMU_TOOL - CPUState *env = cpu_single_env; - if (env) { -@@ -284,9 +295,17 @@ - if (qemu_bh_poll()) - return; - #endif -+// FreeBSD 4.x doesn't have sigwait -+#if defined(__FreeBSD__) && __FreeBSD__ <= 4 -+ ++sigaio_dont; -+ do -+ sigsuspend(&wait_oset); -+ while (sigaio_dont); -+#else - sigemptyset(&set); - sigaddset(&set, aio_sig_num); - sigwait(&set, &nb_sigs); -+#endif - qemu_aio_poll(); - } - Index: files/patch-bsdusb.patch =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/files/patch-bsdusb.patch,v retrieving revision 1.7 diff -u -r1.7 patch-bsdusb.patch --- files/patch-bsdusb.patch 3 Feb 2007 22:15:28 -0000 1.7 +++ files/patch-bsdusb.patch 5 Jan 2008 17:38:57 -0000 @@ -35,16 +35,16 @@ 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 @@ + return NULL; +} Index: qemu/usb-bsd.c -@@ -0,0 +1,600 @@ +@@ -0,0 +1,601 @@ +/* + * BSD host USB redirector + * @@ -86,7 +86,8 @@ + * THE SOFTWARE. + */ + -+#include "vl.h" ++#include "qemu-common.h" ++#include "hw/usb.h" + +/* usb.h declares these */ +#undef USB_SPEED_HIGH Index: files/patch-bt =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/files/patch-bt,v retrieving revision 1.3 diff -u -r1.3 patch-bt --- files/patch-bt 11 Jul 2004 11:41:06 -0000 1.3 +++ files/patch-bt 5 Jan 2008 16:52:26 -0000 @@ -1,15 +1,17 @@ Index: qemu/vl.c -@@ -43,6 +43,9 @@ - #ifndef __APPLE__ - #include +@@ -76,6 +76,11 @@ + #endif + #endif #endif +#ifdef __FreeBSD__ ++#include +#include ++#include +#endif - #else - #include - #include -@@ -1059,6 +1062,34 @@ + + #if defined(CONFIG_SLIRP) + #include "libslirp.h" +@@ -3407,6 +3410,34 @@ #endif /* CONFIG_SLIRP */ @@ -42,9 +44,9 @@ +#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 @@ + 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 @@ + } + 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)); Index: files/patch-fbsd =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/files/patch-fbsd,v retrieving revision 1.8 diff -u -r1.8 patch-fbsd --- files/patch-fbsd 7 Aug 2006 16:10:27 -0000 1.8 +++ files/patch-fbsd 5 Jan 2008 17:22:01 -0000 @@ -20,17 +20,16 @@ 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 */ Index: files/patch-fpu-softfloat-native.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/files/patch-fpu-softfloat-native.c,v retrieving revision 1.1 diff -u -r1.1 patch-fpu-softfloat-native.c --- files/patch-fpu-softfloat-native.c 4 Nov 2006 18:29:35 -0000 1.1 +++ files/patch-fpu-softfloat-native.c 5 Jan 2008 16:52:26 -0000 @@ -14,4 +14,4 @@ +#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 ) Index: files/patch-qemu-img.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/files/patch-qemu-img.c,v retrieving revision 1.1 diff -u -r1.1 patch-qemu-img.c --- files/patch-qemu-img.c 3 Dec 2005 03:18:40 -0000 1.1 +++ files/patch-qemu-img.c 5 Jan 2008 17:24:50 -0000 @@ -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" Index: files/patch-qemu-img.texi =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/files/patch-qemu-img.texi,v retrieving revision 1.1 diff -u -r1.1 patch-qemu-img.texi --- files/patch-qemu-img.texi 3 Dec 2005 03:18:40 -0000 1.1 +++ files/patch-qemu-img.texi 5 Jan 2008 17:30:08 -0000 @@ -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 Index: files/patch-tlb-vuln =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/files/patch-tlb-vuln,v retrieving revision 1.1 diff -u -r1.1 patch-tlb-vuln --- files/patch-tlb-vuln 13 Dec 2007 01:10:52 -0000 1.1 +++ files/patch-tlb-vuln 5 Jan 2008 19:25:21 -0000 @@ -1,92 +0,0 @@ -Index: qemu/cpu-exec.c -diff -u qemu/cpu-exec.c:1.128 qemu/cpu-exec.c:1.129 ---- qemu/cpu-exec.c:1.128 Sun Dec 2 06:18:23 2007 -+++ qemu/cpu-exec.c Tue Dec 11 19:35:45 2007 -@@ -133,7 +133,7 @@ - tb->tc_ptr = tc_ptr; - tb->cs_base = cs_base; - tb->flags = flags; -- cpu_gen_code(env, tb, CODE_GEN_MAX_SIZE, &code_gen_size); -+ cpu_gen_code(env, tb, &code_gen_size); - code_gen_ptr = (void *)(((unsigned long)code_gen_ptr + code_gen_size + CODE_GEN_ALIGN - 1) & ~(CODE_GEN_ALIGN - 1)); - - /* check next page if needed */ -Index: qemu/exec-all.h -diff -u qemu/exec-all.h:1.72 qemu/exec-all.h:1.73 ---- qemu/exec-all.h:1.72 Mon Nov 19 00:38:33 2007 -+++ qemu/exec-all.h Tue Dec 11 19:35:45 2007 -@@ -64,8 +64,9 @@ - int gen_intermediate_code(CPUState *env, struct TranslationBlock *tb); - int gen_intermediate_code_pc(CPUState *env, struct TranslationBlock *tb); - void dump_ops(const uint16_t *opc_buf, const uint32_t *opparam_buf); -+unsigned long code_gen_max_block_size(void); - int cpu_gen_code(CPUState *env, struct TranslationBlock *tb, -- int max_code_size, int *gen_code_size_ptr); -+ int *gen_code_size_ptr); - int cpu_restore_state(struct TranslationBlock *tb, - CPUState *env, unsigned long searched_pc, - void *puc); -@@ -94,7 +95,6 @@ - return tlb_set_page_exec(env, vaddr, paddr, prot, mmu_idx, is_softmmu); - } - --#define CODE_GEN_MAX_SIZE 65536 - #define CODE_GEN_ALIGN 16 /* must be >= of the size of a icache line */ - - #define CODE_GEN_PHYS_HASH_BITS 15 -Index: qemu/exec.c -diff -u qemu/exec.c:1.117 qemu/exec.c:1.118 ---- qemu/exec.c:1.117 Sun Dec 9 02:22:56 2007 -+++ qemu/exec.c Tue Dec 11 19:35:45 2007 -@@ -56,7 +56,7 @@ - #endif - - /* threshold to flush the translated code buffer */ --#define CODE_GEN_BUFFER_MAX_SIZE (CODE_GEN_BUFFER_SIZE - CODE_GEN_MAX_SIZE) -+#define CODE_GEN_BUFFER_MAX_SIZE (CODE_GEN_BUFFER_SIZE - code_gen_max_block_size()) - - #define SMC_BITMAP_USE_THRESHOLD 10 - -@@ -622,7 +622,7 @@ - tb->cs_base = cs_base; - tb->flags = flags; - tb->cflags = cflags; -- cpu_gen_code(env, tb, CODE_GEN_MAX_SIZE, &code_gen_size); -+ cpu_gen_code(env, tb, &code_gen_size); - code_gen_ptr = (void *)(((unsigned long)code_gen_ptr + code_gen_size + CODE_GEN_ALIGN - 1) & ~(CODE_GEN_ALIGN - 1)); - - /* check next page if needed */ -Index: qemu/translate-all.c -diff -u qemu/translate-all.c:1.23 qemu/translate-all.c:1.24 ---- qemu/translate-all.c:1.23 Sun Dec 2 06:10:02 2007 -+++ qemu/translate-all.c Tue Dec 11 19:35:45 2007 -@@ -132,14 +132,27 @@ - } - } - -+unsigned long code_gen_max_block_size(void) -+{ -+ static unsigned long max; -+ -+ if (max == 0) { -+#define DEF(s, n, copy_size) max = copy_size > max? copy_size : max; -+#include "opc.h" -+#undef DEF -+ max *= OPC_MAX_SIZE; -+ } -+ -+ return max; -+} -+ - /* return non zero if the very first instruction is invalid so that - the virtual CPU can trigger an exception. - - '*gen_code_size_ptr' contains the size of the generated code (host - code). - */ --int cpu_gen_code(CPUState *env, TranslationBlock *tb, -- int max_code_size, int *gen_code_size_ptr) -+int cpu_gen_code(CPUState *env, TranslationBlock *tb, int *gen_code_size_ptr) - { - uint8_t *gen_code_buf; - int gen_code_size; Index: files/patch-vl.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/files/patch-vl.c,v retrieving revision 1.5 diff -u -r1.5 patch-vl.c --- files/patch-vl.c 25 Dec 2006 19:49:52 -0000 1.5 +++ files/patch-vl.c 8 Jan 2008 17:34:51 -0000 @@ -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 @@ #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); Index: files/patch-vl.c-nographic =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/files/patch-vl.c-nographic,v retrieving revision 1.1 diff -u -r1.1 patch-vl.c-nographic --- files/patch-vl.c-nographic 18 Mar 2006 21:23:42 -0000 1.1 +++ files/patch-vl.c-nographic 5 Jan 2008 16:52:27 -0000 @@ -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; Index: files/patch-vl.c-ppbus =================================================================== RCS file: /home/pcvs/ports/emulators/qemu/files/patch-vl.c-ppbus,v retrieving revision 1.2 diff -u -r1.2 patch-vl.c-ppbus --- files/patch-vl.c-ppbus 3 Feb 2007 22:15:28 -0000 1.2 +++ files/patch-vl.c-ppbus 5 Jan 2008 16:52:27 -0000 @@ -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 #include + #include +#include +#include #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; Index: 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 Index: 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. Index: 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