Index: Makefile =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/Makefile,v retrieving revision 1.95 diff -u -p -r1.95 Makefile --- Makefile 2 Aug 2008 18:29:39 -0000 1.95 +++ Makefile 11 Oct 2008 20:56:02 -0000 @@ -6,15 +6,15 @@ # PORTNAME= qemu -PORTVERSION= 0.9.1s.20080620 -PORTREVISION= 1 +PORTVERSION= 0.9.1s.20081011 CATEGORIES= emulators MASTER_SITES= http://bellard.org/qemu/:release \ http://qemu-forum.ipi.fi/qemu-snapshots/:snapshot \ http://people.fruitsalad.org/nox/qemu/:snapshot \ - ${MASTER_SITE_LOCAL}:snapshot + ${MASTER_SITE_LOCAL}:snapshot \ + http://people.freebsd.org/~nox/qemu/:snapshot PKGNAMESUFFIX= -devel -DISTNAME= ${PORTNAME}-snapshot-2008-06-20_19 +DISTNAME= ${PORTNAME}-snapshot-2008-10-11_18 DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:snapshot DIST_SUBDIR= qemu EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} @@ -39,24 +39,19 @@ OPTIONS= KQEMU "Build with (alpha!) acce GNUTLS "gnutls dependency (vnc encryption)" On \ PCAP "pcap dependency (networking with bpf)" On \ CDROM_DMA "IDE CDROM DMA" On \ - ALL_TARGETS "Also build dyngen targets (requires gcc34)" On + ALL_TARGETS "Also build dyngen targets (requires gcc34)" On \ + ADD_AUDIO "Emulate more audio hardware (experimental!)" Off .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,cris-softmmu +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,cris-softmmu,sh4-softmmu,sh4eb-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 -CC= gcc34 -.endif - WITHOUT_CPU_CFLAGS=yes #to avoid problems with register allocation CFLAGS:= ${CFLAGS:C/-fno-tree-vrp//} CONFIGURE_ARGS+= --prefix=${PREFIX} --cc=${CC} @@ -77,6 +72,10 @@ LIB_DEPENDS+= gnutls:${PORTSDIR}/securit CONFIGURE_ARGS+= --enable-pcap .endif +.if defined(WITH_ADD_AUDIO) +CONFIGURE_ARGS+= --audio-card-list=ac97,adlib,cs4231a,gus +.endif + .if defined(WITH_SAMBA) RUN_DEPENDS+= ${LOCALBASE}/sbin/smbd:${PORTSDIR}/net/samba3 .endif @@ -118,12 +117,12 @@ post-patch: @cd ${WRKSRC} && ${PATCH} --quiet < ${FILESDIR}/cdrom-dma-patch .endif @${REINPLACE_CMD} -E \ - -e "s,^(CFLAGS=).*,\1${CFLAGS} -fno-strict-aliasing," \ - -e "s,^(LDFLAGS=).*,\1${LDFLAGS}," \ + -e "s|^(CFLAGS=).*|\1${CFLAGS} -fno-strict-aliasing|" \ + -e "s|^(LDFLAGS=).*|\1${LDFLAGS}|" \ ${WRKSRC}/Makefile.target @${REINPLACE_CMD} -E \ - -e "s,^(CFLAGS=).*,\1${CFLAGS} -fno-strict-aliasing -I.," \ - -e "s,^(LDFLAGS=).*,\1${LDFLAGS}," \ + -e "s|^(CFLAGS=).*|\1${CFLAGS} -fno-strict-aliasing -I.|" \ + -e "s|^(LDFLAGS=).*|\1${LDFLAGS}|" \ ${WRKSRC}/Makefile post-install: Index: distinfo =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/distinfo,v retrieving revision 1.50 diff -u -p -r1.50 distinfo --- distinfo 8 Jul 2008 18:42:08 -0000 1.50 +++ distinfo 11 Oct 2008 16:24:20 -0000 @@ -1,3 +1,3 @@ -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 +MD5 (qemu/qemu-snapshot-2008-10-11_18.tar.bz2) = 713f528684d796550bc065377e1e7af0 +SHA256 (qemu/qemu-snapshot-2008-10-11_18.tar.bz2) = 386875e606686ca4f468b8a43e19bff88906ce7f5471dcf76b3e3f17f2d75466 +SIZE (qemu/qemu-snapshot-2008-10-11_18.tar.bz2) = 2789196 Index: pkg-plist =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/pkg-plist,v retrieving revision 1.25 diff -u -p -r1.25 pkg-plist --- pkg-plist 8 Jul 2008 18:42:08 -0000 1.25 +++ pkg-plist 11 Oct 2008 16:06:37 -0000 @@ -10,8 +10,8 @@ bin/qemu-system-mipsel %%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-sh4 +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 @@ -30,6 +30,7 @@ etc/qemu-ifdown.sample %%DATADIR%%/openbios-sparc32 %%DATADIR%%/openbios-sparc64 %%DATADIR%%/video.x +%%DATADIR%%/pxe-e1000.bin %%DATADIR%%/pxe-ne2k_pci.bin %%DATADIR%%/pxe-rtl8139.bin %%DATADIR%%/pxe-pcnet.bin Index: files/patch-bsdusb.patch =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-bsdusb.patch,v retrieving revision 1.10 diff -u -p -r1.10 patch-bsdusb.patch --- files/patch-bsdusb.patch 11 Mar 2008 23:34:13 -0000 1.10 +++ files/patch-bsdusb.patch 11 Oct 2008 16:06:37 -0000 @@ -36,15 +36,15 @@ Index: qemu/configure for target in $target_list; do target_dir="$target" Index: qemu/Makefile -@@ -58,7 +58,7 @@ - OBJS+=ssd0303.o ssd0323.o ads7846.o stellaris_input.o +@@ -75,7 +75,7 @@ + OBJS+=tmp105.o lm832x.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 usb-serial.o -+OBJS+=usb.o usb-hub.o usb-$(HOST_USB).o usb-hid.o usb-msd.o usb-wacom.o usb-serial.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+=usb-serial.o usb-net.o OBJS+=sd.o ssi-sd.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,601 @@ +@@ -0,0 +1,607 @@ +/* + * BSD host USB redirector + * @@ -661,31 +661,9 @@ Index: qemu/usb-bsd.c +{ + usb_host_scan(NULL, usb_host_info_device); +} -Index: qemu/usb-linux.c -@@ -23,7 +23,6 @@ - */ - #include "vl.h" - --#if defined(__linux__) - #include - #include - #include -@@ -505,18 +504,3 @@ - { - usb_host_scan(NULL, usb_host_info_device); - } -- --#else -- --void usb_host_info(void) --{ -- term_printf("USB host devices not supported\n"); --} -- --/* XXX: modify configure to compile the right host driver */ --USBDevice *usb_host_device_open(const char *devname) --{ -- return NULL; --} -- --#endif ++ ++/* XXX add this */ ++int usb_host_device_close(const char *devname) ++{ ++ return 0; ++} Index: files/patch-configure =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-configure,v retrieving revision 1.3 diff -u -p -r1.3 patch-configure --- files/patch-configure 3 Jun 2008 18:39:51 -0000 1.3 +++ files/patch-configure 11 Oct 2008 19:56:33 -0000 @@ -1,4 +1,13 @@ Index: qemu/configure +@@ -490,7 +490,7 @@ + if [ "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then + AIOLIBS= + elif [ "$bsd" = "yes" ]; then +- AIOLIBS="-lpthread" ++# AIOLIBS="-lpthread" + else + # Some Linux architectures (e.g. s390) don't imply -lpthread automatically. + AIOLIBS="-lrt -lpthread" @@ -689,7 +689,7 @@ fi # test "$curses" Index: files/patch-exec.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-exec.c,v retrieving revision 1.3 diff -u -p -r1.3 patch-exec.c --- files/patch-exec.c 8 Jul 2008 18:42:09 -0000 1.3 +++ files/patch-exec.c 11 Oct 2008 16:06:37 -0000 @@ -1,30 +0,0 @@ -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) { Index: files/patch-fbsd =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-fbsd,v retrieving revision 1.12 diff -u -p -r1.12 patch-fbsd --- files/patch-fbsd 8 Jul 2008 18:42:09 -0000 1.12 +++ files/patch-fbsd 11 Oct 2008 16:06:37 -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 -@@ -651,8 +651,8 @@ +@@ -663,8 +663,8 @@ main.o: CFLAGS+=-p endif -$(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a -- $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) +- $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) +$(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a ../bsd/libmath.a -+ $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) ../bsd/libmath.a ++ $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) $(OS_LDFLAGS) ../bsd/libmath.a endif # !CONFIG_USER_ONLY @@ -90,17 +90,16 @@ Index: qemu/fpu/softfloat-native.h #define fabsf(f) ((float)fabs(f)) #else #include -@@ -60,7 +80,9 @@ - /*---------------------------------------------------------------------------- +@@ -109,6 +109,8 @@ | Software IEC/IEEE floating-point rounding mode. *----------------------------------------------------------------------------*/ -#if (defined(_BSD) && !defined(__APPLE__)) || defined(HOST_SOLARIS) +#if (defined(_BSD) && !defined(__APPLE__) && \ -+ (!defined(__FreeBSD__) || __FreeBSD_version < 500000)) || \ -+ defined(HOST_SOLARIS) - enum { - float_round_nearest_even = FP_RN, - float_round_down = FP_RM, ++ (!defined(__FreeBSD__) || __FreeBSD_version < 500000)) || \ ++ defined(HOST_SOLARIS) + #if defined(__OpenBSD__) + #define FE_RM FP_RM + #define FE_RP FP_RP Index: qemu/fpu/softfloat.h @@ -84,7 +84,8 @@ #define FLOAT128 Index: files/patch-hw-vmware_vga.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-hw-vmware_vga.c,v retrieving revision 1.1 diff -u -p -r1.1 patch-hw-vmware_vga.c --- files/patch-hw-vmware_vga.c 2 May 2007 19:55:07 -0000 1.1 +++ files/patch-hw-vmware_vga.c 11 Oct 2008 16:06:37 -0000 @@ -10,3 +10,63 @@ Index: qemu/hw/vmware_vga.c #define HW_MOUSE_ACCEL #ifdef EMBED_STDVGA +@@ -76,6 +76,7 @@ + uint32_t wblue; + int syncing; + int fb_size; ++ int empty; + + union { + uint32_t *fifo; +@@ -487,7 +488,7 @@ + + static inline int vmsvga_fifo_empty(struct vmsvga_state_s *s) + { +- if (!s->config || !s->enable) ++ if (!s->config || !s->enable || s->empty) + return 1; + return (s->cmd->next_cmd == s->cmd->stop); + } +@@ -495,6 +496,10 @@ + static inline uint32_t vmsvga_fifo_read_raw(struct vmsvga_state_s *s) + { + uint32_t cmd = s->fifo[CMD(stop) >> 2]; ++ if (s->cmd->next_cmd == s->cmd->stop) { ++ s->empty = 1; ++ return 0; ++ } + s->cmd->stop = cpu_to_le32(CMD(stop) + 4); + if (CMD(stop) >= CMD(max)) + s->cmd->stop = s->cmd->min; +@@ -512,6 +517,7 @@ + int args = 0; + int x, y, dx, dy, width, height; + struct vmsvga_cursor_definition_s cursor; ++ s->empty = 0; + while (!vmsvga_fifo_empty(s)) + switch (cmd = vmsvga_fifo_read(s)) { + case SVGA_CMD_UPDATE: +@@ -533,6 +539,7 @@ + vmsvga_fill_rect(s, colour, x, y, width, height); + break; + #else ++ args = 0; + goto badcmd; + #endif + +@@ -547,6 +554,7 @@ + vmsvga_copy_rect(s, x, y, dx, dy, width, height); + break; + #else ++ args = 0; + goto badcmd; + #endif + +@@ -609,6 +617,7 @@ + break; /* Nop */ + + default: ++ args = 0; + badcmd: + while (args --) + vmsvga_fifo_read(s); Index: files/patch-osdep.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-osdep.c,v retrieving revision 1.4 diff -u -p -r1.4 patch-osdep.c --- files/patch-osdep.c 8 Jul 2008 18:42:09 -0000 1.4 +++ files/patch-osdep.c 11 Oct 2008 16:06:37 -0000 @@ -1,43 +1,30 @@ Index: qemu/osdep.c -@@ -68,7 +68,9 @@ - - #if defined(USE_KQEMU) - +@@ -75,8 +75,10 @@ + #include + #include + #else +#ifndef __FreeBSD__ #include + #endif +#endif + #include #include - -@@ -79,6 +81,7 @@ - const char *tmpdir; - char phys_ram_file[1024]; +@@ -87,7 +87,7 @@ + static int phys_ram_size = 0; void *ptr; -+#ifndef __FreeBSD__ - #ifdef HOST_SOLARIS - struct statvfs stfs; + +-#ifdef __OpenBSD__ /* no need (?) for a dummy file on OpenBSD */ ++#if defined(__OpenBSD__) || defined(__FreeBSD__) /* no need (?) for a dummy file on OpenBSD/FreeBSD */ + int map_anon = MAP_ANON; #else -@@ -138,7 +141,9 @@ - } - unlink(phys_ram_file); + int map_anon = 0; +@@ -154,7 +154,7 @@ } -+#endif size = (size + 4095) & ~4095; -+#ifndef __FreeBSD__ ftruncate(phys_ram_fd, phys_ram_size + size); +-#endif /* !__OpenBSD__ */ ++#endif /* !(__OpenBSD__ || __FreeBSD__) */ 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; - } + PROT_WRITE | PROT_READ, map_anon | MAP_SHARED, Index: files/patch-target-i386-translate.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-target-i386-translate.c,v retrieving revision 1.3 diff -u -p -r1.3 patch-target-i386-translate.c --- files/patch-target-i386-translate.c 8 Jul 2008 18:42:09 -0000 1.3 +++ files/patch-target-i386-translate.c 11 Oct 2008 16:06:37 -0000 @@ -1,16 +0,0 @@ -Index: qemu/target-i386/translate.c -@@ -3330,8 +3330,12 @@ - op1_offset = offsetof(CPUX86State,xmm_regs[reg]); - tcg_gen_addi_ptr(cpu_ptr0, cpu_env, op1_offset); - sse_op2 = sse_op_table3[(s->dflag == 2) * 2 + ((b >> 8) - 2)]; -- tcg_gen_trunc_tl_i32(cpu_tmp2_i32, cpu_T[0]); -- tcg_gen_helper_0_2(sse_op2, cpu_ptr0, cpu_tmp2_i32); -+ if (ot == OT_LONG) { -+ tcg_gen_trunc_tl_i32(cpu_tmp2_i32, cpu_T[0]); -+ tcg_gen_helper_0_2(sse_op2, cpu_ptr0, cpu_tmp2_i32); -+ } else { -+ tcg_gen_helper_0_2(sse_op2, cpu_ptr0, cpu_T[0]); -+ } - break; - case 0x02c: /* cvttps2pi */ - case 0x12c: /* cvttpd2pi */ Index: files/patch-tcg-i386-tcg-target.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-tcg-i386-tcg-target.c,v retrieving revision 1.1 diff -u -p -r1.1 patch-tcg-i386-tcg-target.c --- files/patch-tcg-i386-tcg-target.c 8 Jul 2008 18:42:09 -0000 1.1 +++ files/patch-tcg-i386-tcg-target.c 11 Oct 2008 16:06:37 -0000 @@ -1,28 +0,0 @@ -Index: qemu/tcg/i386/tcg-target.c -@@ -360,22 +360,22 @@ - case TCG_COND_LT: - tcg_out_brcond(s, TCG_COND_LT, args[1], args[3], const_args[3], args[5]); - tcg_out_jxx(s, JCC_JNE, label_next); -- tcg_out_brcond(s, TCG_COND_LT, args[0], args[2], const_args[2], args[5]); -+ tcg_out_brcond(s, TCG_COND_LTU, args[0], args[2], const_args[2], args[5]); - break; - case TCG_COND_LE: - tcg_out_brcond(s, TCG_COND_LT, args[1], args[3], const_args[3], args[5]); - tcg_out_jxx(s, JCC_JNE, label_next); -- tcg_out_brcond(s, TCG_COND_LE, args[0], args[2], const_args[2], args[5]); -+ tcg_out_brcond(s, TCG_COND_LEU, args[0], args[2], const_args[2], args[5]); - break; - case TCG_COND_GT: - tcg_out_brcond(s, TCG_COND_GT, args[1], args[3], const_args[3], args[5]); - tcg_out_jxx(s, JCC_JNE, label_next); -- tcg_out_brcond(s, TCG_COND_GT, args[0], args[2], const_args[2], args[5]); -+ tcg_out_brcond(s, TCG_COND_GTU, args[0], args[2], const_args[2], args[5]); - break; - case TCG_COND_GE: - tcg_out_brcond(s, TCG_COND_GT, args[1], args[3], const_args[3], args[5]); - tcg_out_jxx(s, JCC_JNE, label_next); -- tcg_out_brcond(s, TCG_COND_GE, args[0], args[2], const_args[2], args[5]); -+ tcg_out_brcond(s, TCG_COND_GEU, args[0], args[2], const_args[2], args[5]); - break; - case TCG_COND_LTU: - tcg_out_brcond(s, TCG_COND_LTU, args[1], args[3], const_args[3], args[5]); Index: files/patch-vl.c =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-vl.c,v retrieving revision 1.11 diff -u -p -r1.11 patch-vl.c --- files/patch-vl.c 8 Jul 2008 18:42:09 -0000 1.11 +++ files/patch-vl.c 11 Oct 2008 16:52:18 -0000 @@ -1,39 +0,0 @@ -Index: qemu/vl.c -@@ -1727,6 +1728,7 @@ - chr->chr_ioctl = pp_ioctl; - return chr; - } -+#endif /* defined(__linux__) */ - - #else - CharDriverState *qemu_chr_open_pty(void) -@@ -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; -@@ -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 -@@ -8423,6 +8423,11 @@ - nb_nics = 0; - /* default mac address of the first network interface */ - -+#ifdef __FreeBSD__ -+ if (modfind("aio") == -1) -+ fprintf(stderr, "warning: aio not (kld)loaded, may cause `Invalid system call' traps on disk IO\n"); -+#endif -+ - optind = 1; - for(;;) { - if (optind >= argc) Index: files/patch-vl.c-ppbus =================================================================== RCS file: /home/pcvs/ports/emulators/qemu-devel/files/patch-vl.c-ppbus,v retrieving revision 1.5 diff -u -p -r1.5 patch-vl.c-ppbus --- files/patch-vl.c-ppbus 9 Aug 2007 20:03:30 -0000 1.5 +++ files/patch-vl.c-ppbus 11 Oct 2008 16:06:37 -0000 @@ -1,7 +1,5 @@ Index: qemu/vl.c -@@ -78,8 +78,10 @@ - #endif - #ifdef __FreeBSD__ +@@ -108,6 +108,8 @@ #include #include #include @@ -10,11 +8,10 @@ Index: qemu/vl.c #endif #if defined(CONFIG_SLIRP) -@@ -1728,7 +1730,64 @@ - chr->chr_ioctl = pp_ioctl; - return chr; +@@ -2939,6 +2941,65 @@ } --#endif /* defined(__linux__) */ + #endif /* __linux__ */ + +#if defined(__FreeBSD__) +static int pp_ioctl(CharDriverState *chr, int cmd, void *arg) +{ @@ -73,20 +70,18 @@ Index: qemu/vl.c + return chr; +} +#endif ++ + #else /* _WIN32 */ - #else - CharDriverState *qemu_chr_open_pty(void) -@@ -2562,6 +2622,13 @@ - #endif + typedef struct { +@@ -3824,6 +3885,10 @@ #if defined(__linux__) if (strstart(filename, "/dev/parport", NULL)) { -+ return qemu_chr_open_pp(filename); -+ } else -+ if (strstart(filename, "/dev/", NULL)) { -+ return qemu_chr_open_tty(filename); + return qemu_chr_open_pp(filename); + } else +#elif defined(__FreeBSD__) + if (strstart(filename, "/dev/ppi", NULL)) { - return qemu_chr_open_pp(filename); - } else - if (strstart(filename, "/dev/", NULL)) { ++ return qemu_chr_open_pp(filename); + } else + #endif + #if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) Index: files/patch-emulate-aio @@ -0,0 +1,106 @@ +Index: qemu/block.h +@@ -50,10 +50,9 @@ + #define BDRV_O_DIRECT 0x0020 + #define BDRV_O_AUTOGROW 0x0040 /* Allow backing file to extend when writing past end of file */ + +-void bdrv_info(void); ++void bdrv_init(int emulate_aio); + void bdrv_info_stats(void); + +-void bdrv_init(void); + BlockDriver *bdrv_find_format(const char *format_name); + int bdrv_create(BlockDriver *drv, + const char *filename, int64_t size_in_sectors, +Index: qemu/block.c +@@ -177,9 +177,9 @@ + } + + +-static void bdrv_register(BlockDriver *bdrv) ++static void bdrv_register(BlockDriver *bdrv, int emulate_aio) + { +- if (!bdrv->bdrv_aio_read) { ++ if (!bdrv->bdrv_aio_read || emulate_aio) { + /* add AIO emulation layer */ + bdrv->bdrv_aio_read = bdrv_aio_read_em; + bdrv->bdrv_aio_write = bdrv_aio_write_em; +@@ -1374,23 +1374,23 @@ + return async_ret; + } + +-void bdrv_init(void) ++void bdrv_init(int emulate_aio) + { +- bdrv_register(&bdrv_raw); +- bdrv_register(&bdrv_host_device); ++ bdrv_register(&bdrv_raw, emulate_aio); ++ bdrv_register(&bdrv_host_device, emulate_aio); + #ifndef _WIN32 +- bdrv_register(&bdrv_cow); ++ bdrv_register(&bdrv_cow, 0); + #endif +- bdrv_register(&bdrv_qcow); +- bdrv_register(&bdrv_vmdk); +- bdrv_register(&bdrv_cloop); +- bdrv_register(&bdrv_dmg); +- bdrv_register(&bdrv_bochs); +- bdrv_register(&bdrv_vpc); +- bdrv_register(&bdrv_vvfat); +- bdrv_register(&bdrv_qcow2); +- bdrv_register(&bdrv_parallels); +- bdrv_register(&bdrv_nbd); ++ bdrv_register(&bdrv_qcow, 0); ++ bdrv_register(&bdrv_vmdk, 0); ++ bdrv_register(&bdrv_cloop, 0); ++ bdrv_register(&bdrv_dmg, 0); ++ bdrv_register(&bdrv_bochs, 0); ++ bdrv_register(&bdrv_vpc, 0); ++ bdrv_register(&bdrv_vvfat, 0); ++ bdrv_register(&bdrv_qcow2, 0); ++ bdrv_register(&bdrv_parallels, 0); ++ bdrv_register(&bdrv_nbd, 0); + } + + void *qemu_aio_get(BlockDriverState *bs, BlockDriverCompletionFunc *cb, +Index: qemu/vl.c +@@ -9046,6 +9046,7 @@ + const char *pid_file = NULL; + VLANState *vlan; + int autostart; ++ int emulate_aio = 0; + + LIST_INIT (&vm_change_state_head); + #ifndef _WIN32 +@@ -9119,6 +9120,13 @@ + tb_size = 0; + autostart= 1; + ++#ifdef __FreeBSD__ ++ if (modfind("aio") == -1) { ++ emulate_aio = 1; ++ fprintf(stderr, "warning: aio not (kld)loaded, disabling (may slow down on disk IO)\n"); ++ } ++#endif ++ + optind = 1; + for(;;) { + if (optind >= argc) +@@ -9851,7 +9859,7 @@ + /* init the dynamic translator */ + cpu_exec_init_all(tb_size * 1024 * 1024); + +- bdrv_init(); ++ bdrv_init(emulate_aio); + + /* we always create the cdrom drive, even if no disk is there */ + +Index: qemu/qemu-img.c +@@ -733,7 +733,7 @@ + { + const char *cmd; + +- bdrv_init(); ++ bdrv_init(1); + if (argc < 2) + help(); + cmd = argv[1];