socsvn commit: r253647 - soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb

syuu at FreeBSD.org syuu at FreeBSD.org
Fri Jun 28 10:58:07 UTC 2013


Author: syuu
Date: Fri Jun 28 10:58:07 2013
New Revision: 253647
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=253647

Log:
  uncomment out things

Modified:
  soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/hcd-uhci.c

Modified: soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/hcd-uhci.c
==============================================================================
--- soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/hcd-uhci.c	Fri Jun 28 10:32:35 2013	(r253646)
+++ soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/hcd-uhci.c	Fri Jun 28 10:58:07 2013	(r253647)
@@ -27,6 +27,7 @@
  */
 #include "hw/usb.h"
 #include <sys/endian.h>
+#include <stdlib.h>
 
 #define le32_to_cpus(x) le32toh(x)
 #define cpu_to_le32(x) htole32(x)
@@ -204,7 +205,7 @@
 {
     UHCIQueue *queue;
 
-//    queue = g_new0(UHCIQueue, 1);
+    queue = (UHCIQueue *)calloc(sizeof(*queue), 1);
     queue->uhci = s;
     queue->qh_addr = qh_addr;
     queue->token = uhci_queue_token(td);
@@ -229,7 +230,7 @@
 
 //    trace_usb_uhci_queue_del(queue->token, reason);
     QTAILQ_REMOVE(&s->queues, queue, next);
-//    g_free(queue);
+    free(queue);
 }
 
 static UHCIQueue *uhci_queue_find(UHCIState *s, UHCI_TD *td)
@@ -258,17 +259,14 @@
 
 static UHCIAsync *uhci_async_alloc(UHCIQueue *queue, uint32_t td_addr)
 {
-#if 0
-    UHCIAsync *async = g_new0(UHCIAsync, 1);
+    UHCIAsync *async = (UHCIAsync *)calloc(sizeof(*async), 1);
 
     async->queue = queue;
     async->td_addr = td_addr;
     usb_packet_init(&async->packet);
-    trace_usb_uhci_packet_add(async->queue->token, async->td_addr);
+//    trace_usb_uhci_packet_add(async->queue->token, async->td_addr);
 
     return async;
-#endif
-    return 0;
 }
 
 static void uhci_async_free(UHCIAsync *async)
@@ -276,9 +274,9 @@
 //    trace_usb_uhci_packet_del(async->queue->token, async->td_addr);
     usb_packet_cleanup(&async->packet);
     if (async->buf != async->static_buf) {
-//        g_free(async->buf);
+        free(async->buf);
     }
-//    g_free(async);
+    free(async);
 }
 
 static void uhci_async_link(UHCIAsync *async)
@@ -297,14 +295,12 @@
 
 static void uhci_async_cancel(UHCIAsync *async)
 {
-#if 0
     uhci_async_unlink(async);
-    trace_usb_uhci_packet_cancel(async->queue->token, async->td_addr,
-                                 async->done);
+//    trace_usb_uhci_packet_cancel(async->queue->token, async->td_addr,
+//                                 async->done);
     if (!async->done)
         usb_cancel_packet(&async->packet);
     uhci_async_free(async);
-#endif
 }
 
 /*
@@ -387,15 +383,14 @@
 
 static void uhci_reset(void *opaque)
 {
-#if 0
     UHCIState *s = opaque;
     uint8_t *pci_conf;
     int i;
     UHCIPort *port;
 
-    trace_usb_uhci_reset();
+//    trace_usb_uhci_reset();
 
-    pci_conf = s->dev.config;
+ //   pci_conf = s->dev.config;
 
     pci_conf[0x6a] = 0x01; /* usb clock */
     pci_conf[0x6b] = 0x00;
@@ -415,9 +410,8 @@
     }
 
     uhci_async_cancel_all(s);
-    qemu_bh_cancel(s->bh);
+//    qemu_bh_cancel(s->bh);
     uhci_update_irq(s);
-#endif
 }
 
 #if 0
@@ -435,12 +429,14 @@
 
 static int uhci_post_load(void *opaque, int version_id)
 {
-//    UHCIState *s = opaque;
+#if 0
+    UHCIState *s = opaque;
 
     if (version_id < 2) {
-//        s->expire_time = qemu_get_clock_ns(vm_clock) +
-//            (get_ticks_per_sec() / FRAME_TIMER_FREQ);
+        s->expire_time = qemu_get_clock_ns(vm_clock) +
+            (get_ticks_per_sec() / FRAME_TIMER_FREQ);
     }
+#endif
     return 0;
 }
 
@@ -474,19 +470,18 @@
 static void uhci_port_write(void *opaque, hwaddr addr,
                             uint64_t val, unsigned size)
 {
-#if 0
     UHCIState *s = opaque;
 
-    trace_usb_uhci_mmio_writew(addr, val);
+//    trace_usb_uhci_mmio_writew(addr, val);
 
     switch(addr) {
     case 0x00:
         if ((val & UHCI_CMD_RS) && !(s->cmd & UHCI_CMD_RS)) {
             /* start frame processing */
-            trace_usb_uhci_schedule_start();
-            s->expire_time = qemu_get_clock_ns(vm_clock) +
-                (get_ticks_per_sec() / FRAME_TIMER_FREQ);
-            qemu_mod_timer(s->frame_timer, s->expire_time);
+//            trace_usb_uhci_schedule_start();
+//            s->expire_time = qemu_get_clock_ns(vm_clock) +
+//                (get_ticks_per_sec() / FRAME_TIMER_FREQ);
+//            qemu_mod_timer(s->frame_timer, s->expire_time);
             s->status &= ~UHCI_STS_HCHALTED;
         } else if (!(val & UHCI_CMD_RS)) {
             s->status |= UHCI_STS_HCHALTED;
@@ -565,12 +560,10 @@
         }
         break;
     }
-#endif
 }
 
 static uint64_t uhci_port_read(void *opaque, hwaddr addr, unsigned size)
 {
-#if 0
     UHCIState *s = opaque;
     uint32_t val;
 
@@ -613,11 +606,9 @@
         break;
     }
 
-    trace_usb_uhci_mmio_readw(addr, val);
+//    trace_usb_uhci_mmio_readw(addr, val);
 
     return val;
-#endif
-    return 0;
 }
 
 /* signal resume if controller suspended */
@@ -904,7 +895,7 @@
     if (max_len <= sizeof(async->static_buf)) {
         async->buf = async->static_buf;
     } else {
-//        async->buf = g_malloc(max_len);
+        async->buf = (uint8_t)malloc(max_len);
     }
     usb_packet_addbuf(&async->packet, async->buf, max_len);
 


More information about the svn-soc-all mailing list