r2984 - trunk/src/host/qemu-neo1973

andrew at sita.openmoko.org andrew at sita.openmoko.org
Mon Sep 17 23:38:45 CEST 2007


Author: andrew
Date: 2007-09-17 23:38:44 +0200 (Mon, 17 Sep 2007)
New Revision: 2984

Modified:
   trunk/src/host/qemu-neo1973/usb-linux-gadget.c
   trunk/src/host/qemu-neo1973/vl.c
Log:
Force SIGALARM based timers when -usbgadget is used, for now (until gadgetfs does AIO).


Modified: trunk/src/host/qemu-neo1973/usb-linux-gadget.c
===================================================================
--- trunk/src/host/qemu-neo1973/usb-linux-gadget.c	2007-09-17 17:36:09 UTC (rev 2983)
+++ trunk/src/host/qemu-neo1973/usb-linux-gadget.c	2007-09-17 21:38:44 UTC (rev 2984)
@@ -211,7 +211,7 @@
         return;
 #endif
 
-    /* write() is supposed to not block here */
+    /* write() is supposed to not block here (but it does :-/ ) */
     if (write(ep->fd, ep->buffer, 0))
         return;
 

Modified: trunk/src/host/qemu-neo1973/vl.c
===================================================================
--- trunk/src/host/qemu-neo1973/vl.c	2007-09-17 17:36:09 UTC (rev 2983)
+++ trunk/src/host/qemu-neo1973/vl.c	2007-09-17 21:38:44 UTC (rev 2984)
@@ -905,7 +905,7 @@
     while (name) {
         struct qemu_alarm_timer tmp;
 
-        for (i = 0; i < count; i++) {
+        for (i = 0; i < count && alarm_timers[i].name; i++) {
             if (!strcmp(alarm_timers[i].name, name))
                 break;
         }
@@ -8243,6 +8243,17 @@
                 break;
             case QEMU_OPTION_usbgadget:
                 usbgadget_enabled = 1;
+                /* XXX: Force the "unix" alarm to be used because usbgadget
+                 * needs SIGALARM to interrupt the blocking read()s and
+                 * write()s until it is rewritten to use AIO - there's no
+                 * other way to get non-blocking IO on gadgetfs.  */
+                memset(alarm_timers, 0, sizeof(alarm_timers));
+                alarm_timers->name = "unix";
+                alarm_timers->flags = 0;
+                alarm_timers->start = unix_start_timer;
+                alarm_timers->stop = unix_stop_timer;
+                alarm_timers->rearm = 0;
+                alarm_timers->priv = 0;
                 break;
             case QEMU_OPTION_smp:
                 smp_cpus = atoi(optarg);





More information about the commitlog mailing list