Index: Makefile =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/Makefile,v retrieving revision 1.92 diff -u -p -r1.92 Makefile --- Makefile 6 Jun 2008 13:27:04 -0000 1.92 +++ Makefile 20 Jun 2008 20:04:20 -0000 @@ -6,17 +6,14 @@ # PORTNAME= qemu -PORTVERSION= 0.9.1s.20080302 -PORTREVISION= 9 +PORTVERSION= 0.9.1s.20080620 CATEGORIES= emulators -MASTER_SITES= http://qemu.org/:release \ +MASTER_SITES= http://bellard.org/qemu/: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 + ${MASTER_SITE_LOCAL}:snapshot PKGNAMESUFFIX= -devel -DISTNAME= ${PORTNAME}-snapshot-2008-03-02_05 +DISTNAME= ${PORTNAME}-snapshot-2008-06-20_19 DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:snapshot DIST_SUBDIR= qemu EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} @@ -28,7 +25,6 @@ HAS_CONFIGURE= yes USE_BZIP2= yes USE_GMAKE= yes USE_PERL5= yes -USE_GCC= 3.4 PATCH_STRIP= -lp1 MAKE_ENV+= BSD_MAKE="${MAKE}" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" MAN1= qemu.1 qemu-img.1 @@ -40,10 +36,19 @@ OPTIONS= KQEMU "Build with (alpha!) acce SAMBA "samba dependency (for -smb)" Off \ SDL "SDL/X dependency (graphical output)" On \ GNUTLS "gnutls dependency (vnc encryption)" On \ - CDROM_DMA "IDE CDROM DMA" On + CDROM_DMA "IDE CDROM DMA" On \ + ALL_TARGETS "Also build dyngen targets (requires gcc34)" On .include +.if defined(WITHOUT_ALL_TARGETS) +CONFIGURE_ARGS+= --disable-gcc-check --target-list=i386-softmmu,sparc-softmmu,x86_64-softmmu,mips-softmmu,mipsel-softmmu,mips64-softmmu,mips64el-softmmu,arm-softmmu,m68k-softmmu +PLIST_SUB+= DYNGEN="@comment " +.else +USE_GCC= 3.4 +PLIST_SUB+= DYNGEN="" +.endif + .if ${OSVERSION} < 600000 # 5.x base gcc segfaults in target-mips/op_mem.c BUILD_DEPENDS+= gcc34:${PORTSDIR}/lang/gcc34 @@ -66,16 +71,12 @@ CONFIGURE_ARGS+= --disable-vnc-tls LIB_DEPENDS+= gnutls:${PORTSDIR}/security/gnutls .endif -.if defined (WITH_HACKS_CIRRUS) || defined (WITH_HACKS) -DISTFILES+= patch3_cirrus:misc -.endif - .if defined(WITH_SAMBA) RUN_DEPENDS+= ${LOCALBASE}/sbin/smbd:${PORTSDIR}/net/samba3 .endif .if defined(WITH_KQEMU) -BUILD_DEPENDS+= kqemu-kmod>=1.3.0pre5:${PORTSDIR}/emulators/kqemu-kmod +BUILD_DEPENDS+= kqemu-kmod-devel>=1.4.0pre1:${PORTSDIR}/emulators/kqemu-kmod-devel .else CONFIGURE_ARGS+= --disable-kqemu .endif Index: distinfo =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/distinfo,v retrieving revision 1.49 diff -u -p -r1.49 distinfo --- distinfo 11 Mar 2008 23:34:13 -0000 1.49 +++ distinfo 20 Jun 2008 17:23:17 -0000 @@ -1,3 +1,3 @@ -MD5 (qemu/qemu-snapshot-2008-03-02_05.tar.bz2) = 832923647bb52f1f0408a707e98479ca -SHA256 (qemu/qemu-snapshot-2008-03-02_05.tar.bz2) = d4159530d7f6b7261a16346b013f303cfa703403e749ca49ce003ef61d7eaff1 -SIZE (qemu/qemu-snapshot-2008-03-02_05.tar.bz2) = 2394602 +MD5 (qemu/qemu-snapshot-2008-06-20_19.tar.bz2) = 7201553586b59e400664b2f9ae0b17a1 +SHA256 (qemu/qemu-snapshot-2008-06-20_19.tar.bz2) = e9a3654976b923c471f572961f244f2758d15a367cfc1b32054aa2cd4391cace +SIZE (qemu/qemu-snapshot-2008-06-20_19.tar.bz2) = 2629290 Index: pkg-plist =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/pkg-plist,v retrieving revision 1.24 diff -u -p -r1.24 pkg-plist --- pkg-plist 3 Apr 2008 20:18:40 -0000 1.24 +++ pkg-plist 20 Jun 2008 18:34:31 -0000 @@ -1,17 +1,17 @@ bin/qemu bin/qemu-img bin/qemu-system-arm -bin/qemu-system-cris +%%DYNGEN%%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 +%%DYNGEN%%bin/qemu-system-ppc +%%DYNGEN%%bin/qemu-system-ppc64 +%%DYNGEN%%bin/qemu-system-ppcemb +%%DYNGEN%%bin/qemu-system-sh4 +%%DYNGEN%%bin/qemu-system-sh4eb bin/qemu-system-sparc bin/qemu-system-x86_64 @unexec if cmp -s %D/etc/qemu-ifup.sample %D/etc/qemu-ifup; then rm -f %D/etc/qemu-ifup; fi @@ -28,6 +28,7 @@ etc/qemu-ifdown.sample %%DATADIR%%/vgabios-cirrus.bin %%DATADIR%%/ppc_rom.bin %%DATADIR%%/openbios-sparc32 +%%DATADIR%%/openbios-sparc64 %%DATADIR%%/video.x %%DATADIR%%/pxe-ne2k_pci.bin %%DATADIR%%/pxe-rtl8139.bin Index: files/patch-90_security =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-90_security,v retrieving revision 1.4 diff -u -p -r1.4 patch-90_security --- files/patch-90_security 11 Mar 2008 23:34:13 -0000 1.4 +++ files/patch-90_security 20 Jun 2008 19:45:28 -0000 @@ -1,148 +1,3 @@ -Index: qemu-0.8.2/hw/cirrus_vga.c -@@ -217,6 +217,20 @@ - #define CIRRUS_HOOK_NOT_HANDLED 0 - #define CIRRUS_HOOK_HANDLED 1 - -+#define BLTUNSAFE(s) \ -+ ( \ -+ ( /* check dst is within bounds */ \ -+ (s)->cirrus_blt_height * (s)->cirrus_blt_dstpitch \ -+ + ((s)->cirrus_blt_dstaddr & (s)->cirrus_addr_mask) > \ -+ (s)->vram_size \ -+ ) || \ -+ ( /* check src is within bounds */ \ -+ (s)->cirrus_blt_height * (s)->cirrus_blt_srcpitch \ -+ + ((s)->cirrus_blt_srcaddr & (s)->cirrus_addr_mask) > \ -+ (s)->vram_size \ -+ ) \ -+ ) -+ - struct CirrusVGAState; - typedef void (*cirrus_bitblt_rop_t) (struct CirrusVGAState *s, - uint8_t * dst, const uint8_t * src, -@@ -636,7 +650,7 @@ - - for (y = 0; y < lines; y++) { - off_cur = off_begin; -- off_cur_end = off_cur + bytesperline; -+ off_cur_end = (off_cur + bytesperline) & s->cirrus_addr_mask; - off_cur &= TARGET_PAGE_MASK; - while (off_cur < off_cur_end) { - cpu_physical_memory_set_dirty(s->vram_offset + off_cur); -@@ -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); -@@ -667,8 +685,11 @@ - { - cirrus_fill_t rop_func; - -+ if (BLTUNSAFE(s)) -+ return 0; -+ - rop_func = cirrus_fill[rop_to_index[blt_rop]][s->cirrus_blt_pixelwidth - 1]; -- rop_func(s, s->vram_ptr + s->cirrus_blt_dstaddr, -+ rop_func(s, s->vram_ptr + (s->cirrus_blt_dstaddr & s->cirrus_addr_mask), - s->cirrus_blt_dstpitch, - s->cirrus_blt_width, s->cirrus_blt_height); - cirrus_invalidate_region(s, s->cirrus_blt_dstaddr, -@@ -687,8 +708,8 @@ - static int cirrus_bitblt_videotovideo_patterncopy(CirrusVGAState * s) - { - return cirrus_bitblt_common_patterncopy(s, -- s->vram_ptr + -- (s->cirrus_blt_srcaddr & ~7)); -+ s->vram_ptr + ((s->cirrus_blt_srcaddr & ~7) & -+ s->cirrus_addr_mask)); - } - - static void cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h) -@@ -738,8 +759,10 @@ - if (notify) - vga_hw_update(); - -- (*s->cirrus_rop) (s, s->vram_ptr + s->cirrus_blt_dstaddr, -- s->vram_ptr + s->cirrus_blt_srcaddr, -+ (*s->cirrus_rop) (s, s->vram_ptr + -+ (s->cirrus_blt_dstaddr & s->cirrus_addr_mask), -+ s->vram_ptr + -+ (s->cirrus_blt_srcaddr & s->cirrus_addr_mask), - s->cirrus_blt_dstpitch, s->cirrus_blt_srcpitch, - s->cirrus_blt_width, s->cirrus_blt_height); - -@@ -765,8 +788,14 @@ - s->cirrus_blt_srcaddr - s->start_addr, - s->cirrus_blt_width, s->cirrus_blt_height); - } else { -- (*s->cirrus_rop) (s, s->vram_ptr + s->cirrus_blt_dstaddr, -- s->vram_ptr + s->cirrus_blt_srcaddr, -+ -+ if (BLTUNSAFE(s)) -+ return 0; -+ -+ (*s->cirrus_rop) (s, s->vram_ptr + -+ (s->cirrus_blt_dstaddr & s->cirrus_addr_mask), -+ s->vram_ptr + -+ (s->cirrus_blt_srcaddr & s->cirrus_addr_mask), - s->cirrus_blt_dstpitch, s->cirrus_blt_srcpitch, - s->cirrus_blt_width, s->cirrus_blt_height); - -@@ -798,8 +827,9 @@ - } else { - /* at least one scan line */ - do { -- (*s->cirrus_rop)(s, s->vram_ptr + s->cirrus_blt_dstaddr, -- s->cirrus_bltbuf, 0, 0, s->cirrus_blt_width, 1); -+ (*s->cirrus_rop)(s, s->vram_ptr + -+ (s->cirrus_blt_dstaddr & s->cirrus_addr_mask), -+ s->cirrus_bltbuf, 0, 0, s->cirrus_blt_width, 1); - cirrus_invalidate_region(s, s->cirrus_blt_dstaddr, 0, - s->cirrus_blt_width, 1); - s->cirrus_blt_dstaddr += s->cirrus_blt_dstpitch; -@@ -1917,7 +1947,7 @@ - unsigned val = mem_value; - uint8_t *dst; - -- dst = s->vram_ptr + offset; -+ dst = s->vram_ptr + (offset &= s->cirrus_addr_mask); - for (x = 0; x < 8; x++) { - if (val & 0x80) { - *dst = s->cirrus_shadow_gr1; -@@ -1940,7 +1970,7 @@ - unsigned val = mem_value; - uint8_t *dst; - -- dst = s->vram_ptr + offset; -+ dst = s->vram_ptr + (offset &= s->cirrus_addr_mask); - for (x = 0; x < 8; x++) { - if (val & 0x80) { - *dst = s->cirrus_shadow_gr1; -Index: qemu-0.8.2/hw/cirrus_vga_rop.h -=================================================================== ---- qemu-0.8.2.orig/hw/cirrus_vga_rop.h 2006-07-22 20:23:34.000000000 +0300 -+++ qemu-0.8.2/hw/cirrus_vga_rop.h 2007-04-20 06:05:59.000000000 +0300 -@@ -31,6 +31,12 @@ glue(cirrus_bitblt_rop_fwd_, ROP_NAME)(C - int x,y; - dstpitch -= bltwidth; - srcpitch -= bltwidth; -+ -+ if (dstpitch < 0 || srcpitch < 0) { -+ /* is 0 valid? srcpitch == 0 could be useful */ -+ return; -+ } -+ - for (y = 0; y < bltheight; y++) { - for (x = 0; x < bltwidth; x++) { - ROP_OP(*dst, *src); Index: qemu-0.8.2/hw/dma.c =================================================================== --- qemu-0.8.2.orig/hw/dma.c 2006-07-22 20:23:34.000000000 +0300 @@ -162,21 +17,27 @@ Index: qemu-0.8.2/hw/dma.c ldebug ("dma_pos %d size %d\n", n, (r->base[COUNT] + 1) << ncont); } -Index: qemu-0.8.2/hw/fdc.c -@@ -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, 1); -+ if (cur_drv->bs) { -+ 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/hw/fdc.c +@@ -1322,7 +1322,8 @@ + fd_sector(cur_drv)); + return 0; + } +- if (bdrv_read(cur_drv->bs, fd_sector(cur_drv), fdctrl->fifo, 1) < 0) { ++ if (cur_drv->bs == NULL || ++ bdrv_read(cur_drv->bs, fd_sector(cur_drv), fdctrl->fifo, 1) < 0) { + FLOPPY_DPRINTF("error getting sector %d\n", + fd_sector(cur_drv)); + /* Sure, image size is too small... */ +@@ -1776,7 +1777,8 @@ + if (pos == FD_SECTOR_LEN - 1 || + fdctrl->data_pos == fdctrl->data_len) { + cur_drv = get_cur_drv(fdctrl); +- if (bdrv_write(cur_drv->bs, fd_sector(cur_drv), fdctrl->fifo, 1) < 0) { ++ if (cur_drv->bs == NULL || ++ bdrv_write(cur_drv->bs, fd_sector(cur_drv), fdctrl->fifo, 1) < 0) { + FLOPPY_ERROR("writing sector %d\n", fd_sector(cur_drv)); + return; + } Index: qemu-0.8.2/hw/pc.c =================================================================== --- qemu-0.8.2.orig/hw/pc.c 2007-04-20 06:05:58.000000000 +0300 Index: files/patch-CVE-2008-2004 =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-CVE-2008-2004,v retrieving revision 1.1 diff -u -p -r1.1 patch-CVE-2008-2004 --- files/patch-CVE-2008-2004 8 May 2008 20:45:10 -0000 1.1 +++ files/patch-CVE-2008-2004 20 Jun 2008 19:45:28 -0000 @@ -1,60 +0,0 @@ -Index: qemu/vl.c -=================================================================== ---- vl.c (revision 4276) -+++ vl.c (revision 4277) -@@ -4961,6 +4961,7 @@ - int bus_id, unit_id; - int cyls, heads, secs, translation; - BlockDriverState *bdrv; -+ BlockDriver *drv = NULL; - int max_devs; - int index; - int cache; -@@ -4968,7 +4969,7 @@ - char *str = arg->opt; - 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: unknown parameter '%s' in '%s'\n", -@@ -5136,6 +5137,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; -+ } -+ } -+ - if (arg->file == NULL) - get_param_value(file, sizeof(file), "file", str); - else -@@ -5238,7 +5247,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; -Index: qemu/qemu-doc.texi -=================================================================== ---- qemu-doc.texi (revision 4276) -+++ qemu-doc.texi (revision 4277) -@@ -261,6 +261,10 @@ - @var{snapshot} is "on" or "off" and allows to enable snapshot for given drive (see @option{-snapshot}). - @item cache=@var{cache} - @var{cache} is "on" or "off" and allows to disable host cache to access data. -+@item format=@var{format} -+Specify which disk @var{format} will be used rather than detecting -+the format. Can be used to specifiy format=raw to avoid interpreting -+an untrusted format header. - @end table - - Instead of @option{-cdrom} you can use: Index: files/patch-Makefile =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-Makefile,v retrieving revision 1.5 diff -u -p -r1.5 patch-Makefile --- files/patch-Makefile 25 Mar 2007 16:33:01 -0000 1.5 +++ files/patch-Makefile 20 Jun 2008 19:45:28 -0000 @@ -1,17 +1,17 @@ Index: qemu/Makefile -@@ -19,7 +19,11 @@ - BASE_LDFLAGS += -static +@@ -17,7 +17,11 @@ + LDFLAGS += -static endif ifdef BUILD_DOCS +ifdef NOPORTDOCS -+DOCS=qemu.1 qemu-img.1 ++DOCS=qemu.1 qemu-img.1 qemu-nbd.8 +else - DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 + DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 +endif else DOCS= endif -@@ -60,8 +64,10 @@ +@@ -203,13 +211,13 @@ common de-ch es fo fr-ca hu ja mk nl-be pt sl tr install-doc: $(DOCS) @@ -22,3 +22,8 @@ Index: qemu/Makefile ifndef CONFIG_WIN32 mkdir -p "$(DESTDIR)$(mandir)/man1" $(INSTALL) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1" +- mkdir -p "$(DESTDIR)$(mandir)/man8" +- $(INSTALL) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8" + endif + + install: all $(if $(BUILD_DOCS),install-doc) Index: files/patch-cpu-exec.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-cpu-exec.c,v retrieving revision 1.4 diff -u -p -r1.4 patch-cpu-exec.c --- files/patch-cpu-exec.c 11 Mar 2008 23:34:13 -0000 1.4 +++ files/patch-cpu-exec.c 20 Jun 2008 19:45:28 -0000 @@ -1,29 +1,27 @@ ---- qemu.orig/cpu-exec.c Mon Jan 14 11:11:02 2008 -+++ qemu/cpu-exec.c Thu Jan 17 23:03:00 2008 -@@ -449,16 +449,18 @@ int cpu_exec(CPUState *env1) - (env->eflags & IF_MASK || env->hflags & HF_HIF_MASK) && - !(env->hflags & HF_INHIBIT_IRQ_MASK)) { - int intno; -- svm_check_intercept(SVM_EXIT_INTR); - env->interrupt_request &= ~(CPU_INTERRUPT_HARD | CPU_INTERRUPT_VIRQ); - intno = cpu_get_pic_interrupt(env); -- if (loglevel & CPU_LOG_TB_IN_ASM) { -- fprintf(logfile, "Servicing hardware INT=0x%02x\n", intno); -- } -- do_interrupt(intno, 0, 0, 0, 1); -- /* ensure that no TB jump will be modified as -- the program flow was changed */ -- BREAK_CHAIN; -+ if(intno>=0) { -+ svm_check_intercept(SVM_EXIT_INTR); -+ if (loglevel & CPU_LOG_TB_IN_ASM) { -+ fprintf(logfile, "Servicing hardware INT=0x%02x\n", intno); -+ } -+ do_interrupt(intno, 0, 0, 0, 1); -+ /* ensure that no TB jump will be modified as -+ the program flow was changed */ -+ BREAK_CHAIN; -+ } +Index: qemu/cpu-exec.c +@@ -394,16 +394,18 @@ + (env->eflags & IF_MASK && + !(env->hflags & HF_INHIBIT_IRQ_MASK))))) { + int intno; +- svm_check_intercept(SVM_EXIT_INTR); + env->interrupt_request &= ~(CPU_INTERRUPT_HARD | CPU_INTERRUPT_VIRQ); + intno = cpu_get_pic_interrupt(env); +- if (loglevel & CPU_LOG_TB_IN_ASM) { +- fprintf(logfile, "Servicing hardware INT=0x%02x\n", intno); ++ if (intno>=0) { ++ svm_check_intercept(SVM_EXIT_INTR); ++ if (loglevel & CPU_LOG_TB_IN_ASM) { ++ fprintf(logfile, "Servicing hardware INT=0x%02x\n", intno); ++ } ++ do_interrupt(intno, 0, 0, 0, 1); ++ /* ensure that no TB jump will be modified as ++ the program flow was changed */ ++ next_tb = 0; + } +- do_interrupt(intno, 0, 0, 0, 1); +- /* ensure that no TB jump will be modified as +- the program flow was changed */ +- next_tb = 0; #if !defined(CONFIG_USER_ONLY) - } else if ((interrupt_request & CPU_INTERRUPT_VIRQ) && - (env->eflags & IF_MASK) && !(env->hflags & HF_INHIBIT_IRQ_MASK)) { + } else if ((interrupt_request & CPU_INTERRUPT_VIRQ) && + (env->eflags & IF_MASK) && Index: files/patch-curses_keys.h =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-curses_keys.h,v retrieving revision 1.1 diff -u -p -r1.1 patch-curses_keys.h --- files/patch-curses_keys.h 21 Mar 2008 22:20:07 -0000 1.1 +++ files/patch-curses_keys.h 20 Jun 2008 19:45:28 -0000 @@ -1,17 +0,0 @@ -Index: qemu/curses_keys.h -=================================================================== -RCS file: /sources/qemu/qemu/curses_keys.h,v -retrieving revision 1.1 -retrieving revision 1.2 -diff -u -p -r1.1 -r1.2 ---- curses_keys.h 10 Feb 2008 16:33:13 -0000 1.1 -+++ curses_keys.h 18 Mar 2008 06:55:27 -0000 1.2 -@@ -198,7 +198,7 @@ int curses2keycode[CURSES_KEYS] = { - - [0x001] = 30 | CNTRL, /* Control + a */ - [0x013] = 31 | CNTRL, /* Control + s */ -- [0x014] = 32 | CNTRL, /* Control + d */ -+ [0x004] = 32 | CNTRL, /* Control + d */ - [0x006] = 33 | CNTRL, /* Control + f */ - [0x007] = 34 | CNTRL, /* Control + g */ - [0x008] = 35 | CNTRL, /* Control + h */ Index: files/patch-fbsd =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-fbsd,v retrieving revision 1.11 diff -u -p -r1.11 patch-fbsd --- files/patch-fbsd 11 Mar 2008 23:34:13 -0000 1.11 +++ files/patch-fbsd 20 Jun 2008 19:45:28 -0000 @@ -20,14 +20,14 @@ Index: qemu/Makefile rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~ $(MAKE) -C tests clean Index: qemu/Makefile.target -@@ -649,8 +649,8 @@ +@@ -651,8 +651,8 @@ main.o: CFLAGS+=-p endif -$(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a -- $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) +- $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) +$(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a ../bsd/libmath.a -+ $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) ../bsd/libmath.a ++ $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) ../bsd/libmath.a endif # !CONFIG_USER_ONLY Index: files/patch-hw-e1000.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-hw-e1000.c,v retrieving revision 1.1 diff -u -p -r1.1 patch-hw-e1000.c --- files/patch-hw-e1000.c 12 Mar 2008 20:01:31 -0000 1.1 +++ files/patch-hw-e1000.c 20 Jun 2008 19:45:28 -0000 @@ -1,17 +0,0 @@ -Index: qemu/hw/e1000.c -=================================================================== -RCS file: /sources/qemu/qemu/hw/e1000.c,v -retrieving revision 1.3 -retrieving revision 1.4 -diff -u -p -r1.3 -r1.4 ---- hw/e1000.c 10 Feb 2008 13:34:48 -0000 1.3 -+++ hw/e1000.c 10 Mar 2008 00:02:10 -0000 1.4 -@@ -50,7 +50,7 @@ static int debugflags = DBGBIT(TXERR) | - #endif - - #define IOPORT_SIZE 0x40 --#define PNPMMIO_SIZE 0x60000 -+#define PNPMMIO_SIZE 0x20000 - - /* - * HW models: Index: files/patch-libmath2 =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-libmath2,v retrieving revision 1.2 diff -u -p -r1.2 patch-libmath2 --- files/patch-libmath2 10 Mar 2007 17:03:05 -0000 1.2 +++ files/patch-libmath2 20 Jun 2008 19:45:28 -0000 @@ -55,13 +55,3 @@ Index: qemu/bsd/amd64/s_ldexpl.c +} + +weak_alias(__ldexpl,ldexpl) -Index: qemu/target-i386/helper.c -@@ -2886,6 +2886,8 @@ - ST0 = floatx_round_to_int(ST0, &env->fp_status); - } - -+long double ldexpl(long double, int); -+ - void helper_fscale(void) - { - ST0 = ldexp (ST0, (int)(ST1)); Index: files/patch-osdep.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-osdep.c,v retrieving revision 1.3 diff -u -p -r1.3 patch-osdep.c --- files/patch-osdep.c 10 Mar 2007 17:03:05 -0000 1.3 +++ files/patch-osdep.c 20 Jun 2008 19:45:28 -0000 @@ -1,5 +1,5 @@ Index: qemu/osdep.c -@@ -79,7 +79,9 @@ +@@ -68,7 +68,9 @@ #if defined(USE_KQEMU) @@ -9,7 +9,7 @@ Index: qemu/osdep.c #include #include -@@ -90,6 +92,7 @@ +@@ -79,6 +81,7 @@ const char *tmpdir; char phys_ram_file[1024]; void *ptr; @@ -17,7 +17,7 @@ Index: qemu/osdep.c #ifdef HOST_SOLARIS struct statvfs stfs; #else -@@ -151,12 +154,20 @@ +@@ -138,7 +141,9 @@ } unlink(phys_ram_file); } @@ -25,16 +25,19 @@ Index: qemu/osdep.c size = (size + 4095) & ~4095; +#ifndef __FreeBSD__ ftruncate(phys_ram_fd, phys_ram_size + size); - ptr = mmap(NULL, - size, - PROT_WRITE | PROT_READ, MAP_SHARED, - phys_ram_fd, phys_ram_size); -+#else -+ ptr = mmap(NULL, -+ size, -+ PROT_WRITE | PROT_READ, MAP_PRIVATE|MAP_ANON, -+ -1, 0); -+#endif - if (ptr == MAP_FAILED) { + ptr = mmap(NULL, + size, +@@ -148,6 +153,13 @@ fprintf(stderr, "Could not map physical memory\n"); exit(1); + } ++#else ++ ptr = malloc(size); ++ if (ptr == NULL) { ++ fprintf(stderr, "Could not allocate physical memory\n"); ++ exit(1); ++ } ++#endif + phys_ram_size += size; + return ptr; + } Index: files/patch-qemu-img.texi =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-qemu-img.texi,v retrieving revision 1.3 diff -u -p -r1.3 patch-qemu-img.texi --- files/patch-qemu-img.texi 11 Mar 2008 23:34:14 -0000 1.3 +++ files/patch-qemu-img.texi 20 Jun 2008 19:45:28 -0000 @@ -1,19 +0,0 @@ -Index: qemu/qemu-img.texi -@@ -10,7 +10,7 @@ - @table @option - @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] [-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 - -@@ -83,7 +83,7 @@ - - Commit the changes recorded in @var{filename} in its base image. - --@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} - - Convert the disk image @var{filename} to disk image @var{output_filename} - using format @var{output_fmt}. It can be optionnaly encrypted Index: files/patch-tcg-tcg-op.h =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-tcg-tcg-op.h,v retrieving revision 1.1 diff -u -p -r1.1 patch-tcg-tcg-op.h --- files/patch-tcg-tcg-op.h 12 Mar 2008 20:01:31 -0000 1.1 +++ files/patch-tcg-tcg-op.h 20 Jun 2008 19:45:28 -0000 @@ -1,19 +0,0 @@ -Index: qemu/tcg/tcg-op.h -@@ -1172,7 +1172,7 @@ - tcg_gen_op3i(INDEX_op_qemu_ld8s, ret, addr, mem_index); - #else - tcg_gen_op4i(INDEX_op_qemu_ld8s, ret, addr, TCGV_HIGH(addr), mem_index); -- tcg_gen_ext8s_i32(TCGV_HIGH(ret), ret); -+ tcg_gen_sari_i32(TCGV_HIGH(ret), ret, 31); - #endif - } - -@@ -1192,7 +1192,7 @@ - tcg_gen_op3i(INDEX_op_qemu_ld16s, ret, addr, mem_index); - #else - tcg_gen_op4i(INDEX_op_qemu_ld16s, ret, addr, TCGV_HIGH(addr), mem_index); -- tcg_gen_ext16s_i32(TCGV_HIGH(ret), ret); -+ tcg_gen_sari_i32(TCGV_HIGH(ret), ret, 31); - #endif - } - Index: files/patch-vl.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-vl.c,v retrieving revision 1.10 diff -u -p -r1.10 patch-vl.c --- files/patch-vl.c 21 Mar 2008 17:31:52 -0000 1.10 +++ files/patch-vl.c 20 Jun 2008 19:45:28 -0000 @@ -7,23 +7,15 @@ Index: qemu/vl.c #else CharDriverState *qemu_chr_open_pty(void) -@@ -1771,14 +1771,14 @@ - return chr; +@@ -2334,7 +2334,7 @@ } + #endif -#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 Index: files/patch-vl.c-nographic =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-vl.c-nographic,v retrieving revision 1.3 diff -u -p -r1.3 patch-vl.c-nographic --- files/patch-vl.c-nographic 10 Mar 2007 17:15:07 -0000 1.3 +++ files/patch-vl.c-nographic 20 Jun 2008 19:45:28 -0000 @@ -1,9 +0,0 @@ -Index: qemu/vl.c -@@ -7131,6 +7131,7 @@ - case QEMU_OPTION_nographic: - 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; - case QEMU_OPTION_kernel: Index: files/patch-exec.c @@ -0,0 +1,30 @@ +Index: qemu/exec.c +@@ -405,6 +405,28 @@ + exit(1); + } + } ++#elif defined(__FreeBSD__) ++ { ++ int flags; ++ void *addr = NULL; ++ flags = MAP_PRIVATE | MAP_ANONYMOUS; ++#if defined(__x86_64__) ++ /* FreeBSD doesn't have MAP_32BIT, use MAP_FIXED and assume ++ * 0x40000000 is free */ ++ flags |= MAP_FIXED; ++ addr = (void *)0x40000000; ++ /* Cannot map more than that */ ++ if (code_gen_buffer_size > (800 * 1024 * 1024)) ++ code_gen_buffer_size = (800 * 1024 * 1024); ++#endif ++ code_gen_buffer = mmap(addr, code_gen_buffer_size, ++ PROT_WRITE | PROT_READ | PROT_EXEC, ++ flags, -1, 0); ++ if (code_gen_buffer == MAP_FAILED) { ++ fprintf(stderr, "Could not allocate dynamic translator buffer\n"); ++ exit(1); ++ } ++ } + #else + code_gen_buffer = qemu_malloc(code_gen_buffer_size); + if (!code_gen_buffer) {