r3616 - trunk/src/host/qemu-neo1973
andrew at sita.openmoko.org
andrew at sita.openmoko.org
Sun Dec 9 14:34:11 CET 2007
Author: andrew
Date: 2007-12-09 14:34:09 +0100 (Sun, 09 Dec 2007)
New Revision: 3616
Modified:
trunk/src/host/qemu-neo1973/qemu-timer.h
trunk/src/host/qemu-neo1973/usb-linux-gadget.c
trunk/src/host/qemu-neo1973/vl.c
Log:
Add timer debugging helpers and an ugly hack with no other purpose than to make usb-gadgetfs work until we can switch to AIO.
Modified: trunk/src/host/qemu-neo1973/qemu-timer.h
===================================================================
--- trunk/src/host/qemu-neo1973/qemu-timer.h 2007-12-07 18:08:01 UTC (rev 3615)
+++ trunk/src/host/qemu-neo1973/qemu-timer.h 2007-12-09 13:34:09 UTC (rev 3616)
@@ -3,6 +3,8 @@
/* timers */
+//#define TIMER_DEBUG
+
typedef struct QEMUClock QEMUClock;
typedef void QEMUTimerCB(void *opaque);
@@ -19,11 +21,25 @@
int64_t qemu_get_clock(QEMUClock *clock);
-QEMUTimer *qemu_new_timer(QEMUClock *clock, QEMUTimerCB *cb, void *opaque);
void qemu_free_timer(QEMUTimer *ts);
void qemu_del_timer(QEMUTimer *ts);
+int qemu_timer_pending(QEMUTimer *ts);
+#ifdef TIMER_DEBUG
+QEMUTimer *__qemu_new_timer(QEMUClock *clock,
+ QEMUTimerCB *cb, void *opaque, const char *line);
+# define qemu_new_timer(clock, cb, opaque) \
+ __qemu_new_timer(clock, cb, opaque, \
+ __FILE__ ":" stringify(__LINE__) " in " __FUNCTION__)
+void __qemu_mod_timer(QEMUTimer *ts, int64_t expire_time, const char *line);
+# define qemu_mod_timer(ts, time) \
+ __qemu_mod_timer(ts, time, \
+ __FILE__ ":" stringify(__LINE__) " in " __FUNCTION__)
+#else
+QEMUTimer *qemu_new_timer(QEMUClock *clock, QEMUTimerCB *cb, void *opaque);
+# define _qemu_new_timer qemu_new_timer
void qemu_mod_timer(QEMUTimer *ts, int64_t expire_time);
-int qemu_timer_pending(QEMUTimer *ts);
+# define _qemu_mod_timer qemu_mod_timer
+#endif
extern int64_t ticks_per_sec;
Modified: trunk/src/host/qemu-neo1973/usb-linux-gadget.c
===================================================================
--- trunk/src/host/qemu-neo1973/usb-linux-gadget.c 2007-12-07 18:08:01 UTC (rev 3615)
+++ trunk/src/host/qemu-neo1973/usb-linux-gadget.c 2007-12-09 13:34:09 UTC (rev 3616)
@@ -428,7 +428,7 @@
cfg->bmAttributes = 0xc0; /* dummy_hcd is picky about power */
if (hci->hosthighspeed) {
- /* For high-speed devies we need to set the interval for
+ /* For high-speed devices we need to set the interval for
* Interrupt Enpoints as high as possible so that the host doesn't
* expect really fast responses from the emulator and thus
* time-out on some packets. */
Modified: trunk/src/host/qemu-neo1973/vl.c
===================================================================
--- trunk/src/host/qemu-neo1973/vl.c 2007-12-07 18:08:01 UTC (rev 3615)
+++ trunk/src/host/qemu-neo1973/vl.c 2007-12-09 13:34:09 UTC (rev 3616)
@@ -811,6 +811,10 @@
QEMUTimerCB *cb;
void *opaque;
struct QEMUTimer *next;
+#ifdef TIMER_DEBUG
+ const char *new_line;
+ const char *mod_line;
+#endif
};
struct qemu_alarm_timer {
@@ -976,7 +980,7 @@
return clock;
}
-QEMUTimer *qemu_new_timer(QEMUClock *clock, QEMUTimerCB *cb, void *opaque)
+QEMUTimer *_qemu_new_timer(QEMUClock *clock, QEMUTimerCB *cb, void *opaque)
{
QEMUTimer *ts;
@@ -987,6 +991,17 @@
return ts;
}
+#ifdef TIMER_DEBUG
+QEMUTimer *__qemu_new_timer(QEMUClock *clock, QEMUTimerCB *cb, void *opaque,
+ const char *new_line)
+{
+ QEMUTimer *ts = _qemu_new_timer(clock, cb, opaque);
+
+ ts->new_line = new_line;
+ return ts;
+}
+#endif
+
void qemu_free_timer(QEMUTimer *ts)
{
qemu_free(ts);
@@ -1014,7 +1029,7 @@
/* modify the current timer so that it will be fired when current_time
>= expire_time. The corresponding callback will be called. */
-void qemu_mod_timer(QEMUTimer *ts, int64_t expire_time)
+void _qemu_mod_timer(QEMUTimer *ts, int64_t expire_time)
{
QEMUTimer **pt, *t;
@@ -1037,6 +1052,14 @@
*pt = ts;
}
+#ifdef TIMER_DEBUG
+void __qemu_mod_timer(QEMUTimer *ts, int64_t expire_time, const char *mod_line)
+{
+ _qemu_mod_timer(ts, expire_time);
+ ts->mod_line = mod_line;
+}
+#endif
+
int qemu_timer_pending(QEMUTimer *ts)
{
QEMUTimer *t;
@@ -1188,6 +1211,10 @@
#endif
CPUState *env = next_cpu;
+ /* FIXME Ugly hack only to make usb-gadgetfs work */
+ if (!alarm_has_dynticks(alarm_timer) && !cpu_single_env)
+ return;
+
/* stop the currently executing cpu because a timer occured */
cpu_interrupt(env, CPU_INTERRUPT_EXIT);
#ifdef USE_KQEMU
More information about the commitlog
mailing list