diff options
author | Norikatsu Shigemura <nork@FreeBSD.org> | 2006-08-07 16:10:27 +0000 |
---|---|---|
committer | Norikatsu Shigemura <nork@FreeBSD.org> | 2006-08-07 16:10:27 +0000 |
commit | abffcb30ec97e8b7fe50b51b323a63201f83190d (patch) | |
tree | 14535343032cf24b54d2d185d006e38ee894f846 /emulators | |
parent | 826d991f606c4ee01defa9be677d6caf59f02f22 (diff) | |
download | ports-abffcb30ec97e8b7fe50b51b323a63201f83190d.tar.gz ports-abffcb30ec97e8b7fe50b51b323a63201f83190d.zip |
Notes
Diffstat (limited to 'emulators')
24 files changed, 272 insertions, 832 deletions
diff --git a/emulators/qemu-devel/Makefile b/emulators/qemu-devel/Makefile index 0563c8a4b8c1..9efe2446d401 100644 --- a/emulators/qemu-devel/Makefile +++ b/emulators/qemu-devel/Makefile @@ -6,8 +6,7 @@ # PORTNAME= qemu -PORTVERSION= 0.8.1 -PORTREVISION= 2 +PORTVERSION= 0.8.2 CATEGORIES= emulators MASTER_SITES= http://www.qemu.org/:release \ http://people.fruitsalad.org/nox/qemu/:snapshot \ @@ -75,6 +74,12 @@ pre-everything:: @${ECHO_MSG} "then you also need samba, you can have this port install it by defining" @${ECHO_MSG} "WITH_SAMBA." .endif +.if !defined(WITH_RTL8139_TIMER) + @${ECHO_MSG} "Notice: if you want to use qemu's rtl8139c+ nic with a FreeBSD guest" + @${ECHO_MSG} "(qemu -net nic,model=rtl8139 -net user or tap ... - will use re(4)" + @${ECHO_MSG} "instead of ed(4) which should use less cpu), then you need to enable" + @${ECHO_MSG} "the emulated rtl8139 timer by defining WITH_RTL8139_TIMER." +.endif post-extract: @${MKDIR} ${WRKSRC}/kqemu @@ -90,6 +95,9 @@ post-patch: .if defined(WITH_HACKS_CIRRUS) || defined (WITH_HACKS) @cd ${WRKSRC} ; ${PATCH} --quiet < ${DISTDIR}/${DIST_SUBDIR}/patch3_cirrus .endif +.if defined(WITH_RTL8139_TIMER) + @cd ${WRKSRC} && ${PATCH} --quiet < ${FILESDIR}/rtl8139-re-patch +.endif post-install: @${CAT} ${PKGMESSAGE} diff --git a/emulators/qemu-devel/distinfo b/emulators/qemu-devel/distinfo index 21465ff94a0e..cf37ebf544fb 100644 --- a/emulators/qemu-devel/distinfo +++ b/emulators/qemu-devel/distinfo @@ -1,6 +1,6 @@ -MD5 (qemu/qemu-0.8.1.tar.gz) = 67d924324a5ab79d017bd97a1e767285 -SHA256 (qemu/qemu-0.8.1.tar.gz) = a1f83666f5c05eaee9bfc608a3a5034ad95d0fd3c99937bb399bf9235a6aa0c9 -SIZE (qemu/qemu-0.8.1.tar.gz) = 1623264 +MD5 (qemu/qemu-0.8.2.tar.gz) = 5b3a89eb2f256a8a6f3bb07f7b3f1b07 +SHA256 (qemu/qemu-0.8.2.tar.gz) = 2a20d811296c859d678bdd002222aa7ca7951a641327234f3af144e822d078f3 +SIZE (qemu/qemu-0.8.2.tar.gz) = 1810909 MD5 (qemu/patch3_cirrus) = ebe7ed9fce804c49e024bc93bfdfc810 SHA256 (qemu/patch3_cirrus) = e862371834b7d895a896fbdb84fd9f70d17b5729a6f6789a48a61504fc941e11 SIZE (qemu/patch3_cirrus) = 8817 diff --git a/emulators/qemu-devel/files/patch-be b/emulators/qemu-devel/files/patch-be index 6de47db9eaf9..95877801237d 100644 --- a/emulators/qemu-devel/files/patch-be +++ b/emulators/qemu-devel/files/patch-be @@ -1,16 +1,31 @@ +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 -@@ -662,6 +662,14 @@ - case QEMU_TIMER_REALTIME: - #ifdef _WIN32 - return GetTickCount(); -+#elif defined(_BSD) -+ { -+ struct timeval r; -+ if (!gettimeofday(&r, NULL)) { -+ return ((timer_freq * 1000LL) * (int64_t)r.tv_sec -+ + ((int64_t)r.tv_usec * timer_freq) / 1000) / timer_freq; -+ } -+ } - #else - { - struct tms tp; +@@ -541,7 +541,7 @@ + static void init_get_clock(void) + { + use_rt_clock = 0; +-#if defined(__linux__) ++#if defined(__linux__) || defined(__FreeBSD__) + { + struct timespec ts; + if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) { +@@ -553,7 +553,7 @@ + + static int64_t get_clock(void) + { +-#if defined(__linux__) ++#if defined(__linux__) || defined(__FreeBSD__) + if (use_rt_clock) { + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); diff --git a/emulators/qemu-devel/files/patch-bsdusb.patch b/emulators/qemu-devel/files/patch-bsdusb.patch index 596ba1c83b83..6c419328f459 100644 --- a/emulators/qemu-devel/files/patch-bsdusb.patch +++ b/emulators/qemu-devel/files/patch-bsdusb.patch @@ -1,6 +1,5 @@ Index: qemu/configure -@@ -122,7 +122,8 @@ - *) +@@ -134,6 +134,7 @@ oss="yes" linux="yes" user="yes" @@ -8,18 +7,19 @@ Index: qemu/configure if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then kqemu="yes" fi -@@ -131,6 +132,7 @@ +@@ -143,6 +144,7 @@ if [ "$bsd" = "yes" ] ; then - if [ ! "$darwin" = "yes" ] ; then + if [ "$darwin" != "yes" ] ; then make="gmake" + usb="bsd" fi fi -@@ -656,6 +675,19 @@ - echo "#define _BSD 1" >> $config_h +@@ -724,6 +726,19 @@ fi + echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h ++ +# USB host support +case "$usb" in +linux) @@ -32,20 +32,19 @@ Index: qemu/configure + echo "HOST_USB=stub" >> $config_mak +;; +esac -+ - for target in $target_list; do + for target in $target_list; do target_dir="$target" Index: qemu/Makefile.target -@@ -303,7 +303,7 @@ - endif +@@ -329,7 +329,7 @@ + VL_OBJS+= scsi-disk.o cdrom.o lsi53c895a.o # USB layer --VL_OBJS+= usb.o usb-hub.o usb-uhci.o usb-linux.o usb-hid.o -+VL_OBJS+= usb.o usb-hub.o usb-uhci.o usb-$(HOST_USB).o usb-hid.o +-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 + VL_OBJS+= ne2000.o rtl8139.o pcnet.o Index: qemu/usb-stub.c @@ -0,0 +1,11 @@ +#include "vl.h" @@ -60,11 +59,11 @@ Index: qemu/usb-stub.c + return NULL; +} Index: qemu/usb-bsd.c -@@ -0,0 +1,592 @@ +@@ -0,0 +1,603 @@ +/* + * BSD host USB redirector + * -+ * Copyright (c) 2005 Lonnie Mendez ++ * Copyright (c) 2006 Lonnie Mendez + * Portions of code and concepts borrowed from + * usb-linux.c and libusb's bsd.c and are copyright their respective owners. + * @@ -336,6 +335,23 @@ Index: qemu/usb-bsd.c + } +} + ++static void usb_host_handle_destroy(USBDevice *opaque) ++{ ++ USBHostDevice *s = (USBHostDevice *)opaque; ++ int i; ++ ++ for (i = 0; i < USB_MAX_ENDPOINTS; i++) ++ if (s->ep_fd[i] >= 0) ++ close(s->ep_fd[i]); ++ ++ if (s->devfd < 0) ++ return; ++ ++ close(s->devfd); ++ ++ qemu_free(s); ++} ++ +USBDevice *usb_host_device_open(const char *devname) +{ + struct usb_device_info bus_info, dev_info; @@ -409,8 +425,16 @@ Index: qemu/usb-bsd.c + dev->dev.handle_reset = usb_host_handle_reset; + dev->dev.handle_control = usb_host_handle_control; + dev->dev.handle_data = usb_host_handle_data; ++ dev->dev.handle_destroy = usb_host_handle_destroy; ++ ++ if (strncmp(dev_info.udi_product, "product", 7) != 0) ++ pstrcpy(dev->dev.devname, sizeof(dev->dev.devname), ++ dev_info.udi_product); ++ else ++ snprintf(dev->dev.devname, sizeof(dev->dev.devname), ++ "host:%s", devname); + -+ strcpy(dev->devpath, "/dev/"); ++ pstrcpy(dev->devpath, sizeof(dev->devpath), "/dev/"); + strcat(dev->devpath, dev_info.udi_devnames[0]); + + /* Mark the endpoints as not yet open */ @@ -426,21 +450,6 @@ Index: qemu/usb-bsd.c + return NULL; +} + -+void usb_host_device_close(USBDevice *opaque) -+{ -+ USBHostDevice *s = (USBHostDevice *)opaque; -+ int i; -+ -+ for (i = 0; i < USB_MAX_ENDPOINTS; i++) -+ if (s->ep_fd[i] >= 0) -+ close(s->ep_fd[i]); -+ -+ if (s->devfd < 0) -+ return; -+ -+ close(s->devfd); -+} -+ +static int usb_host_scan(void *opaque, USBScanFunc *func) +{ + struct usb_device_info bus_info; @@ -494,7 +503,8 @@ Index: qemu/usb-bsd.c + speed = dev_info.udi_speed; + + if (strncmp(dev_info.udi_product, "product", 7) != 0) -+ strcpy(product_name, dev_info.udi_product); ++ pstrcpy(product_name, sizeof(product_name), ++ dev_info.udi_product); + else + product_name[0] = '\0'; + @@ -653,55 +663,6 @@ Index: qemu/usb-bsd.c +{ + usb_host_scan(NULL, usb_host_info_device); +} -Index: qemu/vl.c -@@ -3245,14 +3258,17 @@ - dev = usb_host_device_open(p); - if (!dev) - return -1; -+ dev->isproxied = 1; - } else if (!strcmp(devname, "mouse")) { - dev = usb_mouse_init(); - if (!dev) - return -1; -+ dev->isproxied = 0; - } else if (!strcmp(devname, "tablet")) { - dev = usb_tablet_init(); - if (!dev) - return -1; -+ dev->isproxied = 0; - } else { - return -1; - } -@@ -3281,6 +3297,8 @@ - if (dev && dev->addr == addr) - break; - } -+ if (dev && dev->isproxied) -+ usb_host_device_close(dev); - if (i == MAX_VM_USB_PORTS) - return -1; - usb_attach(vm_usb_ports[i], NULL); -Index: qemu/hw/usb.h -@@ -135,6 +146,8 @@ - int setup_state; - int setup_len; - int setup_index; -+ -+ int isproxied; - }; - - /* USB port on which a device can be connected */ -@@ -157,8 +170,9 @@ - /* usb-uhci.c */ - void usb_uhci_init(PCIBus *bus, USBPort **usb_ports); - --/* usb-linux.c */ -+/* host proxy functions */ - USBDevice *usb_host_device_open(const char *devname); -+void usb_host_device_close(USBDevice *dev); - void usb_host_info(void); - - /* usb-hid.c */ Index: qemu/usb-linux.c @@ -23,7 +23,6 @@ */ @@ -710,23 +671,8 @@ Index: qemu/usb-linux.c -#if defined(__linux__) #include <dirent.h> #include <sys/ioctl.h> - #include <linux/usbdevice_fs.h> -@@ -255,6 +254,14 @@ - return q - buf; - } - -+void usb_host_device_close(USBDevice *opaque) -+{ -+ USBHostDevice *s = (USBHostDevice *)opaque; -+ -+ if (s->fd >= 0) -+ close(s->fd); -+} -+ - static int usb_host_scan(void *opaque, USBScanFunc *func) - { - FILE *f; -@@ -468,18 +475,3 @@ + #include <linux/compiler.h> +@@ -505,18 +504,3 @@ { usb_host_scan(NULL, usb_host_info_device); } diff --git a/emulators/qemu-devel/files/patch-fbsd b/emulators/qemu-devel/files/patch-fbsd index 88b01def0e4d..7195d62837b8 100644 --- a/emulators/qemu-devel/files/patch-fbsd +++ b/emulators/qemu-devel/files/patch-fbsd @@ -1,21 +1,17 @@ Index: qemu/Makefile -@@ -13,11 +13,14 @@ +@@ -25,7 +25,10 @@ + DOCS= endif - DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 - --all: dyngen$(EXESUF) $(TOOLS) $(DOCS) -+all: bsd/libmath.a dyngen$(EXESUF) $(TOOLS) $(DOCS) - for d in $(TARGET_DIRS); do \ - $(MAKE) -C $$d $@ || exit 1 ; \ - done +-all: $(TOOLS) $(DOCS) recurse-all ++all: bsd/libmath.a $(TOOLS) $(DOCS) recurse-all ++ +bsd/libmath.a: + ( cd bsd ; $(BSD_MAKE) CC=$(CC) ) -+ - qemu-img$(EXESUF): qemu-img.c block.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c - $(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS) -@@ -26,6 +29,7 @@ + subdir-%: dyngen$(EXESUF) + $(MAKE) -C $(subst subdir-,,$@) all +@@ -40,6 +43,7 @@ clean: # avoid old build problems by removing potentially incorrect old files @@ -36,7 +32,7 @@ Index: qemu/Makefile.target cocoa.o: cocoa.m $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< Index: qemu/fpu/softfloat-native.c -@@ -2,11 +2,15 @@ +@@ -2,11 +2,16 @@ context is supported */ #include "softfloat.h" #include <math.h> @@ -47,21 +43,22 @@ Index: qemu/fpu/softfloat-native.c void set_float_rounding_mode(int val STATUS_PARAM) { STATUS(float_rounding_mode) = val; --#if defined(_BSD) && !defined(__APPLE__) -+#if defined(_BSD) && !defined(__APPLE__) && \ -+ (defined(__FreeBSD__) && __FreeBSD_version < 500000) +-#if defined(_BSD) && !defined(__APPLE__) || (defined(HOST_SOLARIS) && HOST_SOLARIS < 10) ++#if defined(_BSD) && !defined(__APPLE__) && !defined(__FreeBSD__) || \ ++ (defined(__FreeBSD__) && __FreeBSD_version < 500000) || \ ++ (defined(HOST_SOLARIS) && HOST_SOLARIS < 10) fpsetround(val); #elif defined(__arm__) /* nothing to do */ -@@ -22,7 +26,7 @@ +@@ -22,7 +25,7 @@ } #endif --#if defined(_BSD) -+#if defined(_BSD) && !defined(__FreeBSD__) - #define lrint(d) ((long)rint(d)) - #define llrint(d) ((long long)rint(d)) - #endif +-#if defined(_BSD) || (defined(HOST_SOLARIS) && HOST_SOLARIS < 10) ++#if (defined(_BSD) && !defined(__FreeBSD__)) || (defined(HOST_SOLARIS) && HOST_SOLARIS < 10) + #define lrint(d) ((int32_t)rint(d)) + #define llrint(d) ((int64_t)rint(d)) + #define lrintf(f) ((int32_t)rint(f)) Index: qemu/fpu/softfloat-native.h @@ -1,8 +1,28 @@ /* Native implementation of soft float functions */ diff --git a/emulators/qemu-devel/files/patch-malc-17h_aqemu b/emulators/qemu-devel/files/patch-malc-17h_aqemu deleted file mode 100644 index 6c5a033bd74a..000000000000 --- a/emulators/qemu-devel/files/patch-malc-17h_aqemu +++ /dev/null @@ -1,243 +0,0 @@ -Index: qemu/audio/alsaaudio.c -=================================================================== -RCS file: /home/malc/cvsroot/bellard/qemu/audio/alsaaudio.c,v -retrieving revision 1.1.1.4 -retrieving revision 1.1.1.1.2.8 -diff -u -r1.1.1.4 -r1.1.1.1.2.8 ---- audio/alsaaudio.c 21 Nov 2005 12:47:06 -0000 1.1.1.4 -+++ audio/alsaaudio.c 7 Apr 2006 22:05:21 -0000 1.1.1.1.2.8 -@@ -61,8 +61,8 @@ - .size_in_usec_in = 1, - .size_in_usec_out = 1, - #endif -- .pcm_name_out = "hw:0,0", -- .pcm_name_in = "hw:0,0", -+ .pcm_name_out = "default", -+ .pcm_name_in = "default", - #ifdef HIGH_LATENCY - .buffer_size_in = 400000, - .period_size_in = 400000 / 4, -Index: qemu/audio/audio.h -=================================================================== -RCS file: /home/malc/cvsroot/bellard/qemu/audio/audio.h,v -retrieving revision 1.1.1.3 -retrieving revision 1.1.1.1.2.5 -diff -u -r1.1.1.3 -r1.1.1.1.2.5 ---- audio/audio.h 21 Nov 2005 12:47:06 -0000 1.1.1.3 -+++ audio/audio.h 7 Apr 2006 22:05:21 -0000 1.1.1.1.2.5 -@@ -111,7 +111,7 @@ - } - - uint32_t popcount (uint32_t u); --inline uint32_t lsbindex (uint32_t u); -+uint32_t lsbindex (uint32_t u); - - #ifdef __GNUC__ - #define audio_MIN(a, b) ( __extension__ ({ \ -Index: qemu/audio/dsound_template.h -=================================================================== -RCS file: /home/malc/cvsroot/bellard/qemu/audio/dsound_template.h,v -retrieving revision 1.1.1.2 -retrieving revision 1.1.1.1.2.2 -diff -u -r1.1.1.2 -r1.1.1.1.2.2 ---- audio/dsound_template.h 5 Nov 2005 20:42:14 -0000 1.1.1.2 -+++ audio/dsound_template.h 7 Apr 2006 22:05:21 -0000 1.1.1.1.2.2 -@@ -70,7 +70,13 @@ - int i; - LPVOID p1 = NULL, p2 = NULL; - DWORD blen1 = 0, blen2 = 0; -+ DWORD flag; - -+#ifdef DSBTYPE_IN -+ flag = entire ? DSCBLOCK_ENTIREBUFFER : 0; -+#else -+ flag = entire ? DSBLOCK_ENTIREBUFFER : 0; -+#endif - for (i = 0; i < conf.lock_retries; ++i) { - hr = glue (IFACE, _Lock) ( - buf, -@@ -80,13 +86,7 @@ - &blen1, - &p2, - &blen2, -- (entire --#ifdef DSBTYPE_IN -- ? DSCBLOCK_ENTIREBUFFER --#else -- ? DSBLOCK_ENTIREBUFFER --#endif -- : 0) -+ flag - ); - - if (FAILED (hr)) { -Index: qemu/audio/dsoundaudio.c -=================================================================== -RCS file: /home/malc/cvsroot/bellard/qemu/audio/dsoundaudio.c,v -retrieving revision 1.1.1.2 -retrieving revision 1.1.1.1.2.2 -diff -u -r1.1.1.2 -r1.1.1.1.2.2 ---- audio/dsoundaudio.c 5 Nov 2005 20:42:14 -0000 1.1.1.2 -+++ audio/dsoundaudio.c 7 Apr 2006 22:05:21 -0000 1.1.1.1.2.2 -@@ -987,6 +987,12 @@ - hr = IDirectSound_Initialize (s->dsound, NULL); - if (FAILED (hr)) { - dsound_logerr (hr, "Could not initialize DirectSound\n"); -+ -+ hr = IDirectSound_Release (s->dsound); -+ if (FAILED (hr)) { -+ dsound_logerr (hr, "Could not release DirectSound\n"); -+ } -+ s->dsound = NULL; - return NULL; - } - -Index: qemu/audio/ossaudio.c -=================================================================== -RCS file: /home/malc/cvsroot/bellard/qemu/audio/ossaudio.c,v -retrieving revision 1.1.1.4 -retrieving revision 1.1.1.1.2.5 -diff -u -r1.1.1.4 -r1.1.1.1.2.5 ---- audio/ossaudio.c 21 Nov 2005 12:47:06 -0000 1.1.1.4 -+++ audio/ossaudio.c 7 Apr 2006 22:23:42 -0000 1.1.1.1.2.5 -@@ -324,9 +324,18 @@ - return 0; - } - -- if (abinfo.bytes < 0 || abinfo.bytes > bufsize) { -- ldebug ("warning: Invalid available size, size=%d bufsize=%d\n", -- abinfo.bytes, bufsize); -+ if (abinfo.bytes > bufsize) { -+#ifndef __FreeBSD__ -+ dolog ("warning: Invalid available size, size=%d bufsize=%d\n" -+ "please report your OS/audio hw to malc@pulsesoft.com\n", -+ abinfo.bytes, bufsize); -+#endif -+ abinfo.bytes = bufsize; -+ } -+ -+ if (abinfo.bytes < 0) { -+ dolog ("warning: Invalid available size, size=%d bufsize=%d\n", -+ abinfo.bytes, bufsize); - return 0; - } - -Index: qemu/hw/es1370.c -=================================================================== -RCS file: /home/malc/cvsroot/bellard/qemu/hw/es1370.c,v -retrieving revision 1.1.1.4 -retrieving revision 1.1.1.1.2.7 -diff -u -r1.1.1.4 -r1.1.1.1.2.7 ---- hw/es1370.c 21 Nov 2005 12:47:06 -0000 1.1.1.4 -+++ hw/es1370.c 7 Apr 2006 22:05:21 -0000 1.1.1.1.2.7 -@@ -479,9 +479,10 @@ - IO_WRITE_PROTO (es1370_writeb) - { - ES1370State *s = opaque; -- addr = es1370_fixup (s, addr); - uint32_t shift, mask; - -+ addr = es1370_fixup (s, addr); -+ - switch (addr) { - case ES1370_REG_CONTROL: - case ES1370_REG_CONTROL + 1: -Index: qemu/hw/sb16.c -=================================================================== -RCS file: /home/malc/cvsroot/bellard/qemu/hw/sb16.c,v -retrieving revision 1.1.1.4 -retrieving revision 1.1.1.1.2.6 -diff -u -r1.1.1.4 -r1.1.1.1.2.6 ---- hw/sb16.c 21 Nov 2005 12:47:06 -0000 1.1.1.4 -+++ hw/sb16.c 7 Apr 2006 22:23:59 -0000 1.1.1.1.2.6 -@@ -193,6 +193,31 @@ - #define DMA8_AUTO 1 - #define DMA8_HIGH 2 - -+static void continue_dma8 (SB16State *s) -+{ -+ if (s->freq > 0) { -+ audsettings_t as; -+ -+ s->audio_free = 0; -+ -+ as.freq = s->freq; -+ as.nchannels = 1 << s->fmt_stereo; -+ as.fmt = s->fmt; -+ -+ s->voice = AUD_open_out ( -+ &s->card, -+ s->voice, -+ "sb16", -+ s, -+ SB_audio_callback, -+ &as, -+ 0 /* little endian */ -+ ); -+ } -+ -+ control (s, 1); -+} -+ - static void dma_cmd8 (SB16State *s, int mask, int dma_len) - { - s->fmt = AUD_FMT_U8; -@@ -201,7 +226,8 @@ - s->fmt_signed = 0; - s->fmt_stereo = (s->mixer_regs[0x0e] & 2) != 0; - if (-1 == s->time_const) { -- s->freq = 11025; -+ if (s->freq <= 0) -+ s->freq = 11025; - } - else { - int tmp = (256 - s->time_const); -@@ -239,27 +265,7 @@ - s->freq, s->fmt_stereo, s->fmt_signed, s->fmt_bits, - s->block_size, s->dma_auto, s->fifo, s->highspeed); - -- if (s->freq) { -- audsettings_t as; -- -- s->audio_free = 0; -- -- as.freq = s->freq; -- as.nchannels = 1 << s->fmt_stereo; -- as.fmt = s->fmt; -- -- s->voice = AUD_open_out ( -- &s->card, -- s->voice, -- "sb16", -- s, -- SB_audio_callback, -- &as, -- 0 /* little endian */ -- ); -- } -- -- control (s, 1); -+ continue_dma8 (s); - speaker (s, 1); - } - -@@ -437,7 +443,7 @@ - break; - - case 0x1c: /* Auto-Initialize DMA DAC, 8-bit */ -- control (s, 1); -+ dma_cmd8 (s, DMA8_AUTO, -1); - break; - - case 0x20: /* Direct ADC, Juice/PL */ -@@ -531,7 +537,9 @@ - break; - - case 0xd4: /* continue DMA operation. 8bit */ -- control (s, 1); -+ /* KQ6 (or maybe Sierras audblst.drv in general) resets -+ the frequency between halt/continue */ -+ continue_dma8 (s); - break; - - case 0xd5: /* halt DMA operation. 16bit */ diff --git a/emulators/qemu-devel/files/patch-sdl.c b/emulators/qemu-devel/files/patch-sdl.c deleted file mode 100644 index 68ea6cd4dc51..000000000000 --- a/emulators/qemu-devel/files/patch-sdl.c +++ /dev/null @@ -1,23 +0,0 @@ -Index: qemu/sdl.c -@@ -280,13 +280,19 @@ - - static void sdl_hide_cursor(void) - { -- SDL_SetCursor(sdl_cursor_hidden); -+ if (kbd_mouse_is_absolute()) { -+ SDL_ShowCursor(1); -+ SDL_SetCursor(sdl_cursor_hidden); -+ } else { -+ SDL_ShowCursor(0); -+ } -+ - } - - static void sdl_show_cursor(void) - { - if (!kbd_mouse_is_absolute()) { -- SDL_SetCursor(sdl_cursor_normal); -+ SDL_ShowCursor(1); - } - } - diff --git a/emulators/qemu-devel/files/patch-vl.c b/emulators/qemu-devel/files/patch-vl.c index adf052460e28..53d8063f7a31 100644 --- a/emulators/qemu-devel/files/patch-vl.c +++ b/emulators/qemu-devel/files/patch-vl.c @@ -1,6 +1,5 @@ ---- vl.c.orig Mon Nov 14 15:55:56 2005 -+++ vl.c Mon Nov 14 15:57:25 2005 -@@ -1363,7 +1367,7 @@ +Index: qemu/vl.c +@@ -1510,7 +1510,7 @@ return chr; } @@ -8,8 +7,8 @@ +#if defined(__linux__) || defined(__FreeBSD__) CharDriverState *qemu_chr_open_pty(void) { - char slave_name[1024]; -@@ -1509,6 +1513,7 @@ + struct termios tty; +@@ -1665,6 +1665,7 @@ return chr; } @@ -17,11 +16,11 @@ static int pp_ioctl(CharDriverState *chr, int cmd, void *arg) { int fd = (int)chr->opaque; -@@ -1571,6 +1576,7 @@ +@@ -1727,6 +1728,7 @@ chr->chr_ioctl = pp_ioctl; return chr; } -+#endif ++#endif /* defined(__linux__) */ #else CharDriverState *qemu_chr_open_pty(void) diff --git a/emulators/qemu-devel/files/rtl8139-re-patch b/emulators/qemu-devel/files/rtl8139-re-patch new file mode 100644 index 000000000000..dbb301d4057a --- /dev/null +++ b/emulators/qemu-devel/files/rtl8139-re-patch @@ -0,0 +1,10 @@ +Index: hw/rtl8139.c +@@ -58,7 +58,7 @@ + //#define RTL8139_CALCULATE_RXCRC 1 + + /* Uncomment to enable on-board timer interrupts */ +-//#define RTL8139_ONBOARD_TIMER 1 ++#define RTL8139_ONBOARD_TIMER 1 + + #if defined(RTL8139_CALCULATE_RXCRC) + /* For crc32 */ diff --git a/emulators/qemu-devel/pkg-descr b/emulators/qemu-devel/pkg-descr index 5dbc48de3ce5..d1cb289e746f 100644 --- a/emulators/qemu-devel/pkg-descr +++ b/emulators/qemu-devel/pkg-descr @@ -12,9 +12,9 @@ launch the Wine Windows API emulator or to ease cross-compilation and cross-debugging. As QEMU requires no host kernel patches to run, it is very safe and easy to use. -(but kqemu is now also supported for the i386 on i386 case) +(but kqemu is now also supported for the i386 on i386 and amd64 case) See also the preconfigured system images on http://oszoo.org/ Many live cd isos also work. -WWW: http://fabrice.bellard.free.fr/qemu/ +WWW: http://qemu.org/ diff --git a/emulators/qemu-devel/pkg-message b/emulators/qemu-devel/pkg-message index 6aae63037bb3..7ade9da7da15 100644 --- a/emulators/qemu-devel/pkg-message +++ b/emulators/qemu-devel/pkg-message @@ -45,4 +45,15 @@ and run /etc/rc.d/devfs restart. example devfs.rules: add path 'ugen*' mode 660 group operator corresponding rc.conf line: devfs_system_ruleset="ugen_ruleset" +- still usb: since the hub is no longer attached to the uchi controller +and the wakeup mechanism, resume interrupt is not implemented yet linux +guests will suspend the bus, i.e. they wont see devices usb_add'ed after +its (linux') uhci module got loaded. workaround: either add devices +before linux loads the module or rmmod and modprobe it afterwards. +- to avoid panics or non-working re(4) nics with FreeBSD guests if you +use qemu -net nic,model=rtl8139 -net user or tap ... enable the emulated +rtl8139 timer by building the port with WITH_RTL8139_TIMER defined. +(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.) ==== diff --git a/emulators/qemu-devel/pkg-plist b/emulators/qemu-devel/pkg-plist index 60cebcf4fb23..403d8987adbe 100644 --- a/emulators/qemu-devel/pkg-plist +++ b/emulators/qemu-devel/pkg-plist @@ -13,7 +13,7 @@ bin/qemu-system-x86_64 %%DATADIR%%/vgabios.bin %%DATADIR%%/vgabios-cirrus.bin %%DATADIR%%/ppc_rom.bin -%%DATADIR%%/proll.elf +%%DATADIR%%/openbios-sparc32 %%DATADIR%%/video.x %%DATADIR%%/keymaps/ar %%DATADIR%%/keymaps/common diff --git a/emulators/qemu/Makefile b/emulators/qemu/Makefile index 0563c8a4b8c1..9efe2446d401 100644 --- a/emulators/qemu/Makefile +++ b/emulators/qemu/Makefile @@ -6,8 +6,7 @@ # PORTNAME= qemu -PORTVERSION= 0.8.1 -PORTREVISION= 2 +PORTVERSION= 0.8.2 CATEGORIES= emulators MASTER_SITES= http://www.qemu.org/:release \ http://people.fruitsalad.org/nox/qemu/:snapshot \ @@ -75,6 +74,12 @@ pre-everything:: @${ECHO_MSG} "then you also need samba, you can have this port install it by defining" @${ECHO_MSG} "WITH_SAMBA." .endif +.if !defined(WITH_RTL8139_TIMER) + @${ECHO_MSG} "Notice: if you want to use qemu's rtl8139c+ nic with a FreeBSD guest" + @${ECHO_MSG} "(qemu -net nic,model=rtl8139 -net user or tap ... - will use re(4)" + @${ECHO_MSG} "instead of ed(4) which should use less cpu), then you need to enable" + @${ECHO_MSG} "the emulated rtl8139 timer by defining WITH_RTL8139_TIMER." +.endif post-extract: @${MKDIR} ${WRKSRC}/kqemu @@ -90,6 +95,9 @@ post-patch: .if defined(WITH_HACKS_CIRRUS) || defined (WITH_HACKS) @cd ${WRKSRC} ; ${PATCH} --quiet < ${DISTDIR}/${DIST_SUBDIR}/patch3_cirrus .endif +.if defined(WITH_RTL8139_TIMER) + @cd ${WRKSRC} && ${PATCH} --quiet < ${FILESDIR}/rtl8139-re-patch +.endif post-install: @${CAT} ${PKGMESSAGE} diff --git a/emulators/qemu/distinfo b/emulators/qemu/distinfo index 21465ff94a0e..cf37ebf544fb 100644 --- a/emulators/qemu/distinfo +++ b/emulators/qemu/distinfo @@ -1,6 +1,6 @@ -MD5 (qemu/qemu-0.8.1.tar.gz) = 67d924324a5ab79d017bd97a1e767285 -SHA256 (qemu/qemu-0.8.1.tar.gz) = a1f83666f5c05eaee9bfc608a3a5034ad95d0fd3c99937bb399bf9235a6aa0c9 -SIZE (qemu/qemu-0.8.1.tar.gz) = 1623264 +MD5 (qemu/qemu-0.8.2.tar.gz) = 5b3a89eb2f256a8a6f3bb07f7b3f1b07 +SHA256 (qemu/qemu-0.8.2.tar.gz) = 2a20d811296c859d678bdd002222aa7ca7951a641327234f3af144e822d078f3 +SIZE (qemu/qemu-0.8.2.tar.gz) = 1810909 MD5 (qemu/patch3_cirrus) = ebe7ed9fce804c49e024bc93bfdfc810 SHA256 (qemu/patch3_cirrus) = e862371834b7d895a896fbdb84fd9f70d17b5729a6f6789a48a61504fc941e11 SIZE (qemu/patch3_cirrus) = 8817 diff --git a/emulators/qemu/files/patch-be b/emulators/qemu/files/patch-be index 6de47db9eaf9..95877801237d 100644 --- a/emulators/qemu/files/patch-be +++ b/emulators/qemu/files/patch-be @@ -1,16 +1,31 @@ +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 -@@ -662,6 +662,14 @@ - case QEMU_TIMER_REALTIME: - #ifdef _WIN32 - return GetTickCount(); -+#elif defined(_BSD) -+ { -+ struct timeval r; -+ if (!gettimeofday(&r, NULL)) { -+ return ((timer_freq * 1000LL) * (int64_t)r.tv_sec -+ + ((int64_t)r.tv_usec * timer_freq) / 1000) / timer_freq; -+ } -+ } - #else - { - struct tms tp; +@@ -541,7 +541,7 @@ + static void init_get_clock(void) + { + use_rt_clock = 0; +-#if defined(__linux__) ++#if defined(__linux__) || defined(__FreeBSD__) + { + struct timespec ts; + if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) { +@@ -553,7 +553,7 @@ + + static int64_t get_clock(void) + { +-#if defined(__linux__) ++#if defined(__linux__) || defined(__FreeBSD__) + if (use_rt_clock) { + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); diff --git a/emulators/qemu/files/patch-bsdusb.patch b/emulators/qemu/files/patch-bsdusb.patch index 596ba1c83b83..6c419328f459 100644 --- a/emulators/qemu/files/patch-bsdusb.patch +++ b/emulators/qemu/files/patch-bsdusb.patch @@ -1,6 +1,5 @@ Index: qemu/configure -@@ -122,7 +122,8 @@ - *) +@@ -134,6 +134,7 @@ oss="yes" linux="yes" user="yes" @@ -8,18 +7,19 @@ Index: qemu/configure if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then kqemu="yes" fi -@@ -131,6 +132,7 @@ +@@ -143,6 +144,7 @@ if [ "$bsd" = "yes" ] ; then - if [ ! "$darwin" = "yes" ] ; then + if [ "$darwin" != "yes" ] ; then make="gmake" + usb="bsd" fi fi -@@ -656,6 +675,19 @@ - echo "#define _BSD 1" >> $config_h +@@ -724,6 +726,19 @@ fi + echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h ++ +# USB host support +case "$usb" in +linux) @@ -32,20 +32,19 @@ Index: qemu/configure + echo "HOST_USB=stub" >> $config_mak +;; +esac -+ - for target in $target_list; do + for target in $target_list; do target_dir="$target" Index: qemu/Makefile.target -@@ -303,7 +303,7 @@ - endif +@@ -329,7 +329,7 @@ + VL_OBJS+= scsi-disk.o cdrom.o lsi53c895a.o # USB layer --VL_OBJS+= usb.o usb-hub.o usb-uhci.o usb-linux.o usb-hid.o -+VL_OBJS+= usb.o usb-hub.o usb-uhci.o usb-$(HOST_USB).o usb-hid.o +-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 + VL_OBJS+= ne2000.o rtl8139.o pcnet.o Index: qemu/usb-stub.c @@ -0,0 +1,11 @@ +#include "vl.h" @@ -60,11 +59,11 @@ Index: qemu/usb-stub.c + return NULL; +} Index: qemu/usb-bsd.c -@@ -0,0 +1,592 @@ +@@ -0,0 +1,603 @@ +/* + * BSD host USB redirector + * -+ * Copyright (c) 2005 Lonnie Mendez ++ * Copyright (c) 2006 Lonnie Mendez + * Portions of code and concepts borrowed from + * usb-linux.c and libusb's bsd.c and are copyright their respective owners. + * @@ -336,6 +335,23 @@ Index: qemu/usb-bsd.c + } +} + ++static void usb_host_handle_destroy(USBDevice *opaque) ++{ ++ USBHostDevice *s = (USBHostDevice *)opaque; ++ int i; ++ ++ for (i = 0; i < USB_MAX_ENDPOINTS; i++) ++ if (s->ep_fd[i] >= 0) ++ close(s->ep_fd[i]); ++ ++ if (s->devfd < 0) ++ return; ++ ++ close(s->devfd); ++ ++ qemu_free(s); ++} ++ +USBDevice *usb_host_device_open(const char *devname) +{ + struct usb_device_info bus_info, dev_info; @@ -409,8 +425,16 @@ Index: qemu/usb-bsd.c + dev->dev.handle_reset = usb_host_handle_reset; + dev->dev.handle_control = usb_host_handle_control; + dev->dev.handle_data = usb_host_handle_data; ++ dev->dev.handle_destroy = usb_host_handle_destroy; ++ ++ if (strncmp(dev_info.udi_product, "product", 7) != 0) ++ pstrcpy(dev->dev.devname, sizeof(dev->dev.devname), ++ dev_info.udi_product); ++ else ++ snprintf(dev->dev.devname, sizeof(dev->dev.devname), ++ "host:%s", devname); + -+ strcpy(dev->devpath, "/dev/"); ++ pstrcpy(dev->devpath, sizeof(dev->devpath), "/dev/"); + strcat(dev->devpath, dev_info.udi_devnames[0]); + + /* Mark the endpoints as not yet open */ @@ -426,21 +450,6 @@ Index: qemu/usb-bsd.c + return NULL; +} + -+void usb_host_device_close(USBDevice *opaque) -+{ -+ USBHostDevice *s = (USBHostDevice *)opaque; -+ int i; -+ -+ for (i = 0; i < USB_MAX_ENDPOINTS; i++) -+ if (s->ep_fd[i] >= 0) -+ close(s->ep_fd[i]); -+ -+ if (s->devfd < 0) -+ return; -+ -+ close(s->devfd); -+} -+ +static int usb_host_scan(void *opaque, USBScanFunc *func) +{ + struct usb_device_info bus_info; @@ -494,7 +503,8 @@ Index: qemu/usb-bsd.c + speed = dev_info.udi_speed; + + if (strncmp(dev_info.udi_product, "product", 7) != 0) -+ strcpy(product_name, dev_info.udi_product); ++ pstrcpy(product_name, sizeof(product_name), ++ dev_info.udi_product); + else + product_name[0] = '\0'; + @@ -653,55 +663,6 @@ Index: qemu/usb-bsd.c +{ + usb_host_scan(NULL, usb_host_info_device); +} -Index: qemu/vl.c -@@ -3245,14 +3258,17 @@ - dev = usb_host_device_open(p); - if (!dev) - return -1; -+ dev->isproxied = 1; - } else if (!strcmp(devname, "mouse")) { - dev = usb_mouse_init(); - if (!dev) - return -1; -+ dev->isproxied = 0; - } else if (!strcmp(devname, "tablet")) { - dev = usb_tablet_init(); - if (!dev) - return -1; -+ dev->isproxied = 0; - } else { - return -1; - } -@@ -3281,6 +3297,8 @@ - if (dev && dev->addr == addr) - break; - } -+ if (dev && dev->isproxied) -+ usb_host_device_close(dev); - if (i == MAX_VM_USB_PORTS) - return -1; - usb_attach(vm_usb_ports[i], NULL); -Index: qemu/hw/usb.h -@@ -135,6 +146,8 @@ - int setup_state; - int setup_len; - int setup_index; -+ -+ int isproxied; - }; - - /* USB port on which a device can be connected */ -@@ -157,8 +170,9 @@ - /* usb-uhci.c */ - void usb_uhci_init(PCIBus *bus, USBPort **usb_ports); - --/* usb-linux.c */ -+/* host proxy functions */ - USBDevice *usb_host_device_open(const char *devname); -+void usb_host_device_close(USBDevice *dev); - void usb_host_info(void); - - /* usb-hid.c */ Index: qemu/usb-linux.c @@ -23,7 +23,6 @@ */ @@ -710,23 +671,8 @@ Index: qemu/usb-linux.c -#if defined(__linux__) #include <dirent.h> #include <sys/ioctl.h> - #include <linux/usbdevice_fs.h> -@@ -255,6 +254,14 @@ - return q - buf; - } - -+void usb_host_device_close(USBDevice *opaque) -+{ -+ USBHostDevice *s = (USBHostDevice *)opaque; -+ -+ if (s->fd >= 0) -+ close(s->fd); -+} -+ - static int usb_host_scan(void *opaque, USBScanFunc *func) - { - FILE *f; -@@ -468,18 +475,3 @@ + #include <linux/compiler.h> +@@ -505,18 +504,3 @@ { usb_host_scan(NULL, usb_host_info_device); } diff --git a/emulators/qemu/files/patch-fbsd b/emulators/qemu/files/patch-fbsd index 88b01def0e4d..7195d62837b8 100644 --- a/emulators/qemu/files/patch-fbsd +++ b/emulators/qemu/files/patch-fbsd @@ -1,21 +1,17 @@ Index: qemu/Makefile -@@ -13,11 +13,14 @@ +@@ -25,7 +25,10 @@ + DOCS= endif - DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 - --all: dyngen$(EXESUF) $(TOOLS) $(DOCS) -+all: bsd/libmath.a dyngen$(EXESUF) $(TOOLS) $(DOCS) - for d in $(TARGET_DIRS); do \ - $(MAKE) -C $$d $@ || exit 1 ; \ - done +-all: $(TOOLS) $(DOCS) recurse-all ++all: bsd/libmath.a $(TOOLS) $(DOCS) recurse-all ++ +bsd/libmath.a: + ( cd bsd ; $(BSD_MAKE) CC=$(CC) ) -+ - qemu-img$(EXESUF): qemu-img.c block.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c - $(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS) -@@ -26,6 +29,7 @@ + subdir-%: dyngen$(EXESUF) + $(MAKE) -C $(subst subdir-,,$@) all +@@ -40,6 +43,7 @@ clean: # avoid old build problems by removing potentially incorrect old files @@ -36,7 +32,7 @@ Index: qemu/Makefile.target cocoa.o: cocoa.m $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< Index: qemu/fpu/softfloat-native.c -@@ -2,11 +2,15 @@ +@@ -2,11 +2,16 @@ context is supported */ #include "softfloat.h" #include <math.h> @@ -47,21 +43,22 @@ Index: qemu/fpu/softfloat-native.c void set_float_rounding_mode(int val STATUS_PARAM) { STATUS(float_rounding_mode) = val; --#if defined(_BSD) && !defined(__APPLE__) -+#if defined(_BSD) && !defined(__APPLE__) && \ -+ (defined(__FreeBSD__) && __FreeBSD_version < 500000) +-#if defined(_BSD) && !defined(__APPLE__) || (defined(HOST_SOLARIS) && HOST_SOLARIS < 10) ++#if defined(_BSD) && !defined(__APPLE__) && !defined(__FreeBSD__) || \ ++ (defined(__FreeBSD__) && __FreeBSD_version < 500000) || \ ++ (defined(HOST_SOLARIS) && HOST_SOLARIS < 10) fpsetround(val); #elif defined(__arm__) /* nothing to do */ -@@ -22,7 +26,7 @@ +@@ -22,7 +25,7 @@ } #endif --#if defined(_BSD) -+#if defined(_BSD) && !defined(__FreeBSD__) - #define lrint(d) ((long)rint(d)) - #define llrint(d) ((long long)rint(d)) - #endif +-#if defined(_BSD) || (defined(HOST_SOLARIS) && HOST_SOLARIS < 10) ++#if (defined(_BSD) && !defined(__FreeBSD__)) || (defined(HOST_SOLARIS) && HOST_SOLARIS < 10) + #define lrint(d) ((int32_t)rint(d)) + #define llrint(d) ((int64_t)rint(d)) + #define lrintf(f) ((int32_t)rint(f)) Index: qemu/fpu/softfloat-native.h @@ -1,8 +1,28 @@ /* Native implementation of soft float functions */ diff --git a/emulators/qemu/files/patch-malc-17h_aqemu b/emulators/qemu/files/patch-malc-17h_aqemu deleted file mode 100644 index 6c5a033bd74a..000000000000 --- a/emulators/qemu/files/patch-malc-17h_aqemu +++ /dev/null @@ -1,243 +0,0 @@ -Index: qemu/audio/alsaaudio.c -=================================================================== -RCS file: /home/malc/cvsroot/bellard/qemu/audio/alsaaudio.c,v -retrieving revision 1.1.1.4 -retrieving revision 1.1.1.1.2.8 -diff -u -r1.1.1.4 -r1.1.1.1.2.8 ---- audio/alsaaudio.c 21 Nov 2005 12:47:06 -0000 1.1.1.4 -+++ audio/alsaaudio.c 7 Apr 2006 22:05:21 -0000 1.1.1.1.2.8 -@@ -61,8 +61,8 @@ - .size_in_usec_in = 1, - .size_in_usec_out = 1, - #endif -- .pcm_name_out = "hw:0,0", -- .pcm_name_in = "hw:0,0", -+ .pcm_name_out = "default", -+ .pcm_name_in = "default", - #ifdef HIGH_LATENCY - .buffer_size_in = 400000, - .period_size_in = 400000 / 4, -Index: qemu/audio/audio.h -=================================================================== -RCS file: /home/malc/cvsroot/bellard/qemu/audio/audio.h,v -retrieving revision 1.1.1.3 -retrieving revision 1.1.1.1.2.5 -diff -u -r1.1.1.3 -r1.1.1.1.2.5 ---- audio/audio.h 21 Nov 2005 12:47:06 -0000 1.1.1.3 -+++ audio/audio.h 7 Apr 2006 22:05:21 -0000 1.1.1.1.2.5 -@@ -111,7 +111,7 @@ - } - - uint32_t popcount (uint32_t u); --inline uint32_t lsbindex (uint32_t u); -+uint32_t lsbindex (uint32_t u); - - #ifdef __GNUC__ - #define audio_MIN(a, b) ( __extension__ ({ \ -Index: qemu/audio/dsound_template.h -=================================================================== -RCS file: /home/malc/cvsroot/bellard/qemu/audio/dsound_template.h,v -retrieving revision 1.1.1.2 -retrieving revision 1.1.1.1.2.2 -diff -u -r1.1.1.2 -r1.1.1.1.2.2 ---- audio/dsound_template.h 5 Nov 2005 20:42:14 -0000 1.1.1.2 -+++ audio/dsound_template.h 7 Apr 2006 22:05:21 -0000 1.1.1.1.2.2 -@@ -70,7 +70,13 @@ - int i; - LPVOID p1 = NULL, p2 = NULL; - DWORD blen1 = 0, blen2 = 0; -+ DWORD flag; - -+#ifdef DSBTYPE_IN -+ flag = entire ? DSCBLOCK_ENTIREBUFFER : 0; -+#else -+ flag = entire ? DSBLOCK_ENTIREBUFFER : 0; -+#endif - for (i = 0; i < conf.lock_retries; ++i) { - hr = glue (IFACE, _Lock) ( - buf, -@@ -80,13 +86,7 @@ - &blen1, - &p2, - &blen2, -- (entire --#ifdef DSBTYPE_IN -- ? DSCBLOCK_ENTIREBUFFER --#else -- ? DSBLOCK_ENTIREBUFFER --#endif -- : 0) -+ flag - ); - - if (FAILED (hr)) { -Index: qemu/audio/dsoundaudio.c -=================================================================== -RCS file: /home/malc/cvsroot/bellard/qemu/audio/dsoundaudio.c,v -retrieving revision 1.1.1.2 -retrieving revision 1.1.1.1.2.2 -diff -u -r1.1.1.2 -r1.1.1.1.2.2 ---- audio/dsoundaudio.c 5 Nov 2005 20:42:14 -0000 1.1.1.2 -+++ audio/dsoundaudio.c 7 Apr 2006 22:05:21 -0000 1.1.1.1.2.2 -@@ -987,6 +987,12 @@ - hr = IDirectSound_Initialize (s->dsound, NULL); - if (FAILED (hr)) { - dsound_logerr (hr, "Could not initialize DirectSound\n"); -+ -+ hr = IDirectSound_Release (s->dsound); -+ if (FAILED (hr)) { -+ dsound_logerr (hr, "Could not release DirectSound\n"); -+ } -+ s->dsound = NULL; - return NULL; - } - -Index: qemu/audio/ossaudio.c -=================================================================== -RCS file: /home/malc/cvsroot/bellard/qemu/audio/ossaudio.c,v -retrieving revision 1.1.1.4 -retrieving revision 1.1.1.1.2.5 -diff -u -r1.1.1.4 -r1.1.1.1.2.5 ---- audio/ossaudio.c 21 Nov 2005 12:47:06 -0000 1.1.1.4 -+++ audio/ossaudio.c 7 Apr 2006 22:23:42 -0000 1.1.1.1.2.5 -@@ -324,9 +324,18 @@ - return 0; - } - -- if (abinfo.bytes < 0 || abinfo.bytes > bufsize) { -- ldebug ("warning: Invalid available size, size=%d bufsize=%d\n", -- abinfo.bytes, bufsize); -+ if (abinfo.bytes > bufsize) { -+#ifndef __FreeBSD__ -+ dolog ("warning: Invalid available size, size=%d bufsize=%d\n" -+ "please report your OS/audio hw to malc@pulsesoft.com\n", -+ abinfo.bytes, bufsize); -+#endif -+ abinfo.bytes = bufsize; -+ } -+ -+ if (abinfo.bytes < 0) { -+ dolog ("warning: Invalid available size, size=%d bufsize=%d\n", -+ abinfo.bytes, bufsize); - return 0; - } - -Index: qemu/hw/es1370.c -=================================================================== -RCS file: /home/malc/cvsroot/bellard/qemu/hw/es1370.c,v -retrieving revision 1.1.1.4 -retrieving revision 1.1.1.1.2.7 -diff -u -r1.1.1.4 -r1.1.1.1.2.7 ---- hw/es1370.c 21 Nov 2005 12:47:06 -0000 1.1.1.4 -+++ hw/es1370.c 7 Apr 2006 22:05:21 -0000 1.1.1.1.2.7 -@@ -479,9 +479,10 @@ - IO_WRITE_PROTO (es1370_writeb) - { - ES1370State *s = opaque; -- addr = es1370_fixup (s, addr); - uint32_t shift, mask; - -+ addr = es1370_fixup (s, addr); -+ - switch (addr) { - case ES1370_REG_CONTROL: - case ES1370_REG_CONTROL + 1: -Index: qemu/hw/sb16.c -=================================================================== -RCS file: /home/malc/cvsroot/bellard/qemu/hw/sb16.c,v -retrieving revision 1.1.1.4 -retrieving revision 1.1.1.1.2.6 -diff -u -r1.1.1.4 -r1.1.1.1.2.6 ---- hw/sb16.c 21 Nov 2005 12:47:06 -0000 1.1.1.4 -+++ hw/sb16.c 7 Apr 2006 22:23:59 -0000 1.1.1.1.2.6 -@@ -193,6 +193,31 @@ - #define DMA8_AUTO 1 - #define DMA8_HIGH 2 - -+static void continue_dma8 (SB16State *s) -+{ -+ if (s->freq > 0) { -+ audsettings_t as; -+ -+ s->audio_free = 0; -+ -+ as.freq = s->freq; -+ as.nchannels = 1 << s->fmt_stereo; -+ as.fmt = s->fmt; -+ -+ s->voice = AUD_open_out ( -+ &s->card, -+ s->voice, -+ "sb16", -+ s, -+ SB_audio_callback, -+ &as, -+ 0 /* little endian */ -+ ); -+ } -+ -+ control (s, 1); -+} -+ - static void dma_cmd8 (SB16State *s, int mask, int dma_len) - { - s->fmt = AUD_FMT_U8; -@@ -201,7 +226,8 @@ - s->fmt_signed = 0; - s->fmt_stereo = (s->mixer_regs[0x0e] & 2) != 0; - if (-1 == s->time_const) { -- s->freq = 11025; -+ if (s->freq <= 0) -+ s->freq = 11025; - } - else { - int tmp = (256 - s->time_const); -@@ -239,27 +265,7 @@ - s->freq, s->fmt_stereo, s->fmt_signed, s->fmt_bits, - s->block_size, s->dma_auto, s->fifo, s->highspeed); - -- if (s->freq) { -- audsettings_t as; -- -- s->audio_free = 0; -- -- as.freq = s->freq; -- as.nchannels = 1 << s->fmt_stereo; -- as.fmt = s->fmt; -- -- s->voice = AUD_open_out ( -- &s->card, -- s->voice, -- "sb16", -- s, -- SB_audio_callback, -- &as, -- 0 /* little endian */ -- ); -- } -- -- control (s, 1); -+ continue_dma8 (s); - speaker (s, 1); - } - -@@ -437,7 +443,7 @@ - break; - - case 0x1c: /* Auto-Initialize DMA DAC, 8-bit */ -- control (s, 1); -+ dma_cmd8 (s, DMA8_AUTO, -1); - break; - - case 0x20: /* Direct ADC, Juice/PL */ -@@ -531,7 +537,9 @@ - break; - - case 0xd4: /* continue DMA operation. 8bit */ -- control (s, 1); -+ /* KQ6 (or maybe Sierras audblst.drv in general) resets -+ the frequency between halt/continue */ -+ continue_dma8 (s); - break; - - case 0xd5: /* halt DMA operation. 16bit */ diff --git a/emulators/qemu/files/patch-sdl.c b/emulators/qemu/files/patch-sdl.c deleted file mode 100644 index 68ea6cd4dc51..000000000000 --- a/emulators/qemu/files/patch-sdl.c +++ /dev/null @@ -1,23 +0,0 @@ -Index: qemu/sdl.c -@@ -280,13 +280,19 @@ - - static void sdl_hide_cursor(void) - { -- SDL_SetCursor(sdl_cursor_hidden); -+ if (kbd_mouse_is_absolute()) { -+ SDL_ShowCursor(1); -+ SDL_SetCursor(sdl_cursor_hidden); -+ } else { -+ SDL_ShowCursor(0); -+ } -+ - } - - static void sdl_show_cursor(void) - { - if (!kbd_mouse_is_absolute()) { -- SDL_SetCursor(sdl_cursor_normal); -+ SDL_ShowCursor(1); - } - } - diff --git a/emulators/qemu/files/patch-vl.c b/emulators/qemu/files/patch-vl.c index adf052460e28..53d8063f7a31 100644 --- a/emulators/qemu/files/patch-vl.c +++ b/emulators/qemu/files/patch-vl.c @@ -1,6 +1,5 @@ ---- vl.c.orig Mon Nov 14 15:55:56 2005 -+++ vl.c Mon Nov 14 15:57:25 2005 -@@ -1363,7 +1367,7 @@ +Index: qemu/vl.c +@@ -1510,7 +1510,7 @@ return chr; } @@ -8,8 +7,8 @@ +#if defined(__linux__) || defined(__FreeBSD__) CharDriverState *qemu_chr_open_pty(void) { - char slave_name[1024]; -@@ -1509,6 +1513,7 @@ + struct termios tty; +@@ -1665,6 +1665,7 @@ return chr; } @@ -17,11 +16,11 @@ static int pp_ioctl(CharDriverState *chr, int cmd, void *arg) { int fd = (int)chr->opaque; -@@ -1571,6 +1576,7 @@ +@@ -1727,6 +1728,7 @@ chr->chr_ioctl = pp_ioctl; return chr; } -+#endif ++#endif /* defined(__linux__) */ #else CharDriverState *qemu_chr_open_pty(void) diff --git a/emulators/qemu/files/rtl8139-re-patch b/emulators/qemu/files/rtl8139-re-patch new file mode 100644 index 000000000000..dbb301d4057a --- /dev/null +++ b/emulators/qemu/files/rtl8139-re-patch @@ -0,0 +1,10 @@ +Index: hw/rtl8139.c +@@ -58,7 +58,7 @@ + //#define RTL8139_CALCULATE_RXCRC 1 + + /* Uncomment to enable on-board timer interrupts */ +-//#define RTL8139_ONBOARD_TIMER 1 ++#define RTL8139_ONBOARD_TIMER 1 + + #if defined(RTL8139_CALCULATE_RXCRC) + /* For crc32 */ diff --git a/emulators/qemu/pkg-descr b/emulators/qemu/pkg-descr index 5dbc48de3ce5..d1cb289e746f 100644 --- a/emulators/qemu/pkg-descr +++ b/emulators/qemu/pkg-descr @@ -12,9 +12,9 @@ launch the Wine Windows API emulator or to ease cross-compilation and cross-debugging. As QEMU requires no host kernel patches to run, it is very safe and easy to use. -(but kqemu is now also supported for the i386 on i386 case) +(but kqemu is now also supported for the i386 on i386 and amd64 case) See also the preconfigured system images on http://oszoo.org/ Many live cd isos also work. -WWW: http://fabrice.bellard.free.fr/qemu/ +WWW: http://qemu.org/ diff --git a/emulators/qemu/pkg-message b/emulators/qemu/pkg-message index 6aae63037bb3..7ade9da7da15 100644 --- a/emulators/qemu/pkg-message +++ b/emulators/qemu/pkg-message @@ -45,4 +45,15 @@ and run /etc/rc.d/devfs restart. example devfs.rules: add path 'ugen*' mode 660 group operator corresponding rc.conf line: devfs_system_ruleset="ugen_ruleset" +- still usb: since the hub is no longer attached to the uchi controller +and the wakeup mechanism, resume interrupt is not implemented yet linux +guests will suspend the bus, i.e. they wont see devices usb_add'ed after +its (linux') uhci module got loaded. workaround: either add devices +before linux loads the module or rmmod and modprobe it afterwards. +- to avoid panics or non-working re(4) nics with FreeBSD guests if you +use qemu -net nic,model=rtl8139 -net user or tap ... enable the emulated +rtl8139 timer by building the port with WITH_RTL8139_TIMER defined. +(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.) ==== diff --git a/emulators/qemu/pkg-plist b/emulators/qemu/pkg-plist index 60cebcf4fb23..403d8987adbe 100644 --- a/emulators/qemu/pkg-plist +++ b/emulators/qemu/pkg-plist @@ -13,7 +13,7 @@ bin/qemu-system-x86_64 %%DATADIR%%/vgabios.bin %%DATADIR%%/vgabios-cirrus.bin %%DATADIR%%/ppc_rom.bin -%%DATADIR%%/proll.elf +%%DATADIR%%/openbios-sparc32 %%DATADIR%%/video.x %%DATADIR%%/keymaps/ar %%DATADIR%%/keymaps/common |