|
List Info
Thread: qemu 0.8.2 update - please test! (and usb cardreader SET_ADDR_FAILED)
|
|
| qemu 0.8.2 update - please test! (and
usb cardreader SET_ADDR_FAILED) |

|
2006-07-23 22:40:41 |
With the help of Lonnie Mendez (he updated his usb host
support patch)
I just put together an experimental qemu port update. For
some reason
my usb cardreader didnt want to work today:
uhub1: device problem (SET_ADDR_FAILED), disabling port 1
(anyone have an idea about this one? this is the first time
i tried using
it since I updated this box to 6.1), so the usb host support
is untested.
To test usb best run qemu with -monitor stdio, then do
`info usbhost'
when its running and then `usb_add host:<x.y>' where
x.y is the host
device you want to add (`plug into' the guest). also see
the port's
pkg-message.
enjoy,
Juergen
Removed files: files/patch-malc-17h_aqemu files/patch-sdl.c
files/patch-vl.c
Index: Makefile
============================================================
=======
RCS file: /home/ncvs/ports/emulators/qemu/Makefile,v
retrieving revision 1.53
diff -u -r1.53 Makefile
--- Makefile 23 Jul 2006 00:04:01 -0000 1.53
+++ Makefile 23 Jul 2006 15:51:45 -0000
 -6,8
+6,7 
#
PORTNAME= qemu
-PORTVERSION= 0.8.1
-PORTREVISION= 2
+PORTVERSION= 0.8.2
CATEGORIES= emulators
MASTER_SITES= http://www.qemu.org/:rel
ease \
http:
//people.fruitsalad.org/nox/qemu/:snapshot \
Index: distinfo
============================================================
=======
RCS file: /home/ncvs/ports/emulators/qemu/distinfo,v
retrieving revision 1.31
diff -u -r1.31 distinfo
--- distinfo 6 May 2006 16:15:41 -0000 1.31
+++ distinfo 23 Jul 2006 15:52:26 -0000
 -1,6
+1,6 
-MD5 (qemu/qemu-0.8.1.tar.gz) =
67d924324a5ab79d017bd97a1e767285
-SHA256 (qemu/qemu-0.8.1.tar.gz) =
a1f83666f5c05eaee9bfc608a3a5034ad95d0fd3c99937bb399bf9235a6a
a0c9
-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) =
2a20d811296c859d678bdd002222aa7ca7951a641327234f3af144e822d0
78f3
+SIZE (qemu/qemu-0.8.2.tar.gz) = 1810909
MD5 (qemu/patch3_cirrus) = ebe7ed9fce804c49e024bc93bfdfc810
SHA256 (qemu/patch3_cirrus) =
e862371834b7d895a896fbdb84fd9f70d17b5729a6f6789a48a61504fc94
1e11
SIZE (qemu/patch3_cirrus) = 8817
Index: pkg-descr
============================================================
=======
RCS file: /home/ncvs/ports/emulators/qemu/pkg-descr,v
retrieving revision 1.3
diff -u -r1.3 pkg-descr
--- pkg-descr 19 Jul 2005 06:06:56 -0000 1.3
+++ pkg-descr 23 Jul 2006 17:46:11 -0000
 -12,9
+12,9 
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.b
ellard.free.fr/qemu/
+WWW: http://qemu.org/
Index: pkg-plist
============================================================
=======
RCS file: /home/ncvs/ports/emulators/qemu/pkg-plist,v
retrieving revision 1.15
diff -u -r1.15 pkg-plist
--- pkg-plist 19 May 2006 08:17:54 -0000 1.15
+++ pkg-plist 23 Jul 2006 17:41:29 -0000
 -13,7
+13,7 
%%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
Index: files/patch-be
============================================================
=======
RCS file: /home/ncvs/ports/emulators/qemu/files/patch-be,v
retrieving revision 1.2
diff -u -r1.2 patch-be
--- files/patch-be 1 May 2005 07:39:11 -0000 1.2
+++ files/patch-be 23 Jul 2006 16:30:16 -0000
 -1,16
+1,12 
-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;
+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: files/patch-bsdusb.patch
============================================================
=======
RCS file:
/home/ncvs/ports/emulators/qemu/files/patch-bsdusb.patch,v
retrieving revision 1.4
diff -u -r1.4 patch-bsdusb.patch
--- files/patch-bsdusb.patch 29 Apr 2006 09:15:50 -0000 1.4
+++ files/patch-bsdusb.patch 23 Jul 2006 19:58:22 -0000
 -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 
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 
+ 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 
+ 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 
+ }
+}
+
++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 
+ 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 
+ 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 
+ 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 
+{
+ 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 
-#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);
}
Index: files/patch-fbsd
============================================================
=======
RCS file: /home/ncvs/ports/emulators/qemu/files/patch-fbsd,v
retrieving revision 1.7
diff -u -r1.7 patch-fbsd
--- files/patch-fbsd 6 May 2006 16:15:41 -0000 1.7
+++ files/patch-fbsd 23 Jul 2006 16:15:26 -0000
 -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 
cocoa.o: cocoa.m
$(CC) $(CFLAGS) $(DEFINES) -c -o $ $<
Index: qemu/fpu/softfloat-native.c
- -2,11 +2,15 
+ -2,11 +2,14 
context is supported */
#include "softfloat.h"
#include <math.h>
 -47,21
+43,20 
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(__FreeBSD__)
&& __FreeBSD_version < 500000)) &&
!defined(__APPLE__) || (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 */
_______________________________________________
freebsd-emulation freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-emu
lation
To unsubscribe, send any mail to
"freebsd-emulation-unsubscribe freebsd.org"
|
|
| FreeBSD qemu 0.8.2 update - please test!
(and usb cardreader SET_ADDR_FAILED) |

|
2006-07-25 17:47:19 |
On Mon, Jul 24, 2006 at 12:40:41AM +0200, Juergen Lock
wrote:
> With the help of Lonnie Mendez (he updated his usb host
support patch)
> I just put together an experimental qemu port update.
For some reason
> my usb cardreader didnt want to work today:
> uhub1: device problem (SET_ADDR_FAILED), disabling
port 1
> (anyone have an idea about this one? this is the first
time i tried using
> it since I updated this box to 6.1), so the usb host
support is untested.
>
> To test usb best run qemu with -monitor stdio, then do
`info usbhost'
> when its running and then `usb_add host:<x.y>'
where x.y is the host
> device you want to add (`plug into' the guest). also
see the port's
> pkg-message.
some quick test have been done on usb now (cardreader
started working
again without me doing anything), also Bakul Shah tested usb
with a
w2k guest. usb is slow tho... (and watch out for the new
pkg-message
note below.)
Also Jung-uk Kim made me aware that FreeBSD has
clock_gettime(2) too
and provided a patch to enable it.
And I noted -kernel-kqemu doesnt seem to be faster than
`regular'
kqemu anymore (subjectively it once even seemd a little
slower!),
example startup time of root shell xterm on
KANOTIX-2006-Easter-RC4.iso
went up from maybe 5 to over 20 seconds, and qemu now takes
some 30%
cpu here even when the guest is idle. And, I got two qemu
hangs
(guest suddenly hangs completly, qemu eating 99% cpu) with
-kernel-kqemu. So, if anyone has any ideas about this...
(can the new timing code slow things down that much?)
Oh, host has a single 2.0something GHz athlon cpu and 512 MB
ram.
new qemu port update below, enjoy,
Juergen
Removed files: files/patch-malc-17h_aqemu files/patch-sdl.c
Index: Makefile
============================================================
=======
RCS file: /home/ncvs/ports/emulators/qemu/Makefile,v
retrieving revision 1.53
diff -u -r1.53 Makefile
--- Makefile 23 Jul 2006 00:04:01 -0000 1.53
+++ Makefile 23 Jul 2006 15:51:45 -0000
 -6,8
+6,7 
#
PORTNAME= qemu
-PORTVERSION= 0.8.1
-PORTREVISION= 2
+PORTVERSION= 0.8.2
CATEGORIES= emulators
MASTER_SITES= http://www.qemu.org/:rel
ease \
http:
//people.fruitsalad.org/nox/qemu/:snapshot \
Index: distinfo
============================================================
=======
RCS file: /home/ncvs/ports/emulators/qemu/distinfo,v
retrieving revision 1.31
diff -u -r1.31 distinfo
--- distinfo 6 May 2006 16:15:41 -0000 1.31
+++ distinfo 23 Jul 2006 15:52:26 -0000
 -1,6
+1,6 
-MD5 (qemu/qemu-0.8.1.tar.gz) =
67d924324a5ab79d017bd97a1e767285
-SHA256 (qemu/qemu-0.8.1.tar.gz) =
a1f83666f5c05eaee9bfc608a3a5034ad95d0fd3c99937bb399bf9235a6a
a0c9
-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) =
2a20d811296c859d678bdd002222aa7ca7951a641327234f3af144e822d0
78f3
+SIZE (qemu/qemu-0.8.2.tar.gz) = 1810909
MD5 (qemu/patch3_cirrus) = ebe7ed9fce804c49e024bc93bfdfc810
SHA256 (qemu/patch3_cirrus) =
e862371834b7d895a896fbdb84fd9f70d17b5729a6f6789a48a61504fc94
1e11
SIZE (qemu/patch3_cirrus) = 8817
Index: pkg-descr
============================================================
=======
RCS file: /home/ncvs/ports/emulators/qemu/pkg-descr,v
retrieving revision 1.3
diff -u -r1.3 pkg-descr
--- pkg-descr 19 Jul 2005 06:06:56 -0000 1.3
+++ pkg-descr 23 Jul 2006 17:46:11 -0000
 -12,9
+12,9 
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.b
ellard.free.fr/qemu/
+WWW: http://qemu.org/
Index: pkg-message
============================================================
=======
RCS file: /home/ncvs/ports/emulators/qemu/pkg-message,v
retrieving revision 1.13
diff -u -r1.13 pkg-message
--- pkg-message 23 Jul 2006 00:04:01 -0000 1.13
+++ pkg-message 25 Jul 2006 17:12:19 -0000
 -45,4
+45,9 
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.
====
Index: pkg-plist
============================================================
=======
RCS file: /home/ncvs/ports/emulators/qemu/pkg-plist,v
retrieving revision 1.15
diff -u -r1.15 pkg-plist
--- pkg-plist 19 May 2006 08:17:54 -0000 1.15
+++ pkg-plist 23 Jul 2006 17:41:29 -0000
 -13,7
+13,7 
%%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
Index: files/patch-be
============================================================
=======
RCS file: /home/ncvs/ports/emulators/qemu/files/patch-be,v
retrieving revision 1.2
diff -u -r1.2 patch-be
--- files/patch-be 1 May 2005 07:39:11 -0000 1.2
+++ files/patch-be 25 Jul 2006 17:09:30 -0000
 -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);
Index: files/patch-bsdusb.patch
============================================================
=======
RCS file:
/home/ncvs/ports/emulators/qemu/files/patch-bsdusb.patch,v
retrieving revision 1.4
diff -u -r1.4 patch-bsdusb.patch
--- files/patch-bsdusb.patch 29 Apr 2006 09:15:50 -0000 1.4
+++ files/patch-bsdusb.patch 23 Jul 2006 19:58:22 -0000
 -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 
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 
+ 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 
+ 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 
+ }
+}
+
++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 
+ 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 
+ 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 
+ 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 
+{
+ 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 
-#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);
}
Index: files/patch-fbsd
============================================================
=======
RCS file: /home/ncvs/ports/emulators/qemu/files/patch-fbsd,v
retrieving revision 1.7
diff -u -r1.7 patch-fbsd
--- files/patch-fbsd 6 May 2006 16:15:41 -0000 1.7
+++ files/patch-fbsd 23 Jul 2006 16:15:26 -0000
 -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 
cocoa.o: cocoa.m
$(CC) $(CFLAGS) $(DEFINES) -c -o $ $<
Index: qemu/fpu/softfloat-native.c
- -2,11 +2,15 
+ -2,11 +2,14 
context is supported */
#include "softfloat.h"
#include <math.h>
 -47,21
+43,20 
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(__FreeBSD__)
&& __FreeBSD_version < 500000)) &&
!defined(__APPLE__) || (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 */
Index: files/patch-vl.c
============================================================
=======
RCS file: /home/ncvs/ports/emulators/qemu/files/patch-vl.c,v
retrieving revision 1.3
diff -u -r1.3 patch-vl.c
--- files/patch-vl.c 3 Dec 2005 03:18:40 -0000 1.3
+++ files/patch-vl.c 25 Jul 2006 17:19:37 -0000
 -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)
_______________________________________________
freebsd-emulation freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-emu
lation
To unsubscribe, send any mail to
"freebsd-emulation-unsubscribe freebsd.org"
|
|
| FreeBSD qemu 0.8.2 update - please test!
(and usb cardreader SET_ADDR_FAILED) |

|
2006-07-25 23:06:02 |
On Tuesday 25 July 2006 01:47 pm, Juergen Lock wrote:
>  -47,21 +43,20 
> 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(__FreeBSD__)
&& __FreeBSD_version < 500000)) &&
!defined(__APPLE__) || (defined(HOST_SOLARIS) &&
HOST_SOLARIS < 10)
> fpsetround(val);
> #elif defined(__arm__)
> /* nothing to do */
FYI, a parenthesis is misplaced (Note: I just rearranged
the order to be more clearer):
+-#if defined(_BSD) && !defined(__APPLE__) ||
(defined(HOST_SOLARIS) && HOST_SOLARIS < 10)
++#if (defined(_BSD) && !defined(__APPLE__)
&& (defined(__FreeBSD__) &&
__FreeBSD_version < 500000)) || \
++ (defined(HOST_SOLARIS) && HOST_SOLARIS <
10)
Actually it is an upstream bug, though.
Thanks,
Jung-uk Kim
_______________________________________________
freebsd-emulation freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-emu
lation
To unsubscribe, send any mail to
"freebsd-emulation-unsubscribe freebsd.org"
|
|
| FreeBSD qemu 0.8.2 update - please test!
(and usb cardreader SET_ADDR_FAILED) |

|
2006-07-28 17:33:51 |
On Tue, Jul 25, 2006 at 07:06:02PM -0400, Jung-uk Kim wrote:
> On Tuesday 25 July 2006 01:47 pm, Juergen Lock wrote:
> >  -47,21 +43,20 
> > 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(__FreeBSD__) && __FreeBSD_version <
500000)) && !defined(__APPLE__) ||
(defined(HOST_SOLARIS) && HOST_SOLARIS < 10)
> > fpsetround(val);
> > #elif defined(__arm__)
> > /* nothing to do */
>
> FYI, a parenthesis is misplaced (Note: I just
rearranged
> the order to be more clearer):
>
> +-#if defined(_BSD) && !defined(__APPLE__) ||
(defined(HOST_SOLARIS) && HOST_SOLARIS < 10)
> ++#if (defined(_BSD) && !defined(__APPLE__)
&& (defined(__FreeBSD__) &&
__FreeBSD_version < 500000)) || \
> ++ (defined(HOST_SOLARIS) && HOST_SOLARIS
< 10)
Well this should actually be:
#if defined(_BSD) && !defined(__APPLE__) &&
!defined(__FreeBSD__) || \
(defined(__FreeBSD__) && __FreeBSD_version <
500000) || \
(defined(HOST_SOLARIS) && HOST_SOLARIS < 10)
if it ever was going to be merged back. (wrongly excluded
non-FreeBSD BSDs)
>
> Actually it is an upstream bug, though.
Nah, the parens there are okay... (|| binds less than
&&, i.e.
1 || 0 && 0 evaluates to 1.)
On another note, am i the only one seeing those
-kernel-kqemu problems?
thanx,
Juergen
_______________________________________________
freebsd-emulation freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-emu
lation
To unsubscribe, send any mail to
"freebsd-emulation-unsubscribe freebsd.org"
|
|
[1-4]
|
|