qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 4/7] timer: move QEMUTimerListGroup function to be be


From: Xuebing Wang
Subject: [Qemu-devel] [PULL 4/7] timer: move QEMUTimerListGroup function to be below QEMUClockType
Date: Mon, 3 Mar 2014 09:43:37 +0800

Signed-off-by: Xuebing Wang <address@hidden>
Reviewed-By: Alex Bligh <address@hidden>
---
 qemu-timer.c |   86 ++++++++++++++++++++++++++++++----------------------------
 1 file changed, 45 insertions(+), 41 deletions(-)

diff --git a/qemu-timer.c b/qemu-timer.c
index 471150c..6f13a76 100644
--- a/qemu-timer.c
+++ b/qemu-timer.c
@@ -456,6 +456,51 @@ bool qemu_clock_run_all_timers(void)
     return progress;
 }
 
+/*
+ * QEMUTimerListGroup
+ */
+
+void timerlistgroup_init(QEMUTimerListGroup *tlg,
+                         QEMUTimerListNotifyCB *cb, void *opaque)
+{
+    QEMUClockType type;
+    for (type = 0; type < QEMU_CLOCK_MAX; type++) {
+        tlg->tl[type] = timerlist_new(type, cb, opaque);
+    }
+}
+
+void timerlistgroup_deinit(QEMUTimerListGroup *tlg)
+{
+    QEMUClockType type;
+    for (type = 0; type < QEMU_CLOCK_MAX; type++) {
+        timerlist_free(tlg->tl[type]);
+    }
+}
+
+bool timerlistgroup_run_timers(QEMUTimerListGroup *tlg)
+{
+    QEMUClockType type;
+    bool progress = false;
+    for (type = 0; type < QEMU_CLOCK_MAX; type++) {
+        progress |= timerlist_run_timers(tlg->tl[type]);
+    }
+    return progress;
+}
+
+int64_t timerlistgroup_deadline_ns(QEMUTimerListGroup *tlg)
+{
+    int64_t deadline = -1;
+    QEMUClockType type;
+    for (type = 0; type < QEMU_CLOCK_MAX; type++) {
+        if (qemu_clock_use_for_deadline(tlg->tl[type]->clock->type)) {
+            deadline = qemu_soonest_timeout(deadline,
+                                            timerlist_deadline_ns(
+                                                tlg->tl[type]));
+        }
+    }
+    return deadline;
+}
+
 /* Transition function to convert a nanosecond timeout to ms
  * This is used where a system does not support ppoll
  */
@@ -630,47 +675,6 @@ bool timer_expired(QEMUTimer *timer_head, int64_t 
current_time)
     return timer_expired_ns(timer_head, current_time * timer_head->scale);
 }
 
-void timerlistgroup_init(QEMUTimerListGroup *tlg,
-                         QEMUTimerListNotifyCB *cb, void *opaque)
-{
-    QEMUClockType type;
-    for (type = 0; type < QEMU_CLOCK_MAX; type++) {
-        tlg->tl[type] = timerlist_new(type, cb, opaque);
-    }
-}
-
-void timerlistgroup_deinit(QEMUTimerListGroup *tlg)
-{
-    QEMUClockType type;
-    for (type = 0; type < QEMU_CLOCK_MAX; type++) {
-        timerlist_free(tlg->tl[type]);
-    }
-}
-
-bool timerlistgroup_run_timers(QEMUTimerListGroup *tlg)
-{
-    QEMUClockType type;
-    bool progress = false;
-    for (type = 0; type < QEMU_CLOCK_MAX; type++) {
-        progress |= timerlist_run_timers(tlg->tl[type]);
-    }
-    return progress;
-}
-
-int64_t timerlistgroup_deadline_ns(QEMUTimerListGroup *tlg)
-{
-    int64_t deadline = -1;
-    QEMUClockType type;
-    for (type = 0; type < QEMU_CLOCK_MAX; type++) {
-        if (qemu_clock_use_for_deadline(tlg->tl[type]->clock->type)) {
-            deadline = qemu_soonest_timeout(deadline,
-                                            timerlist_deadline_ns(
-                                                tlg->tl[type]));
-        }
-    }
-    return deadline;
-}
-
 void init_clocks(void)
 {
     QEMUClockType type;
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]