qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Xuebing Wang <xbing6@gmail.com>
To: qemu-devel@nongnu.org, pbonzini@redhat.com, stefanha@redhat.com
Cc: xbing6@gmail.com
Subject: [Qemu-devel] [PULL 4/7] timer: move QEMUTimerListGroup function to be below QEMUClockType
Date: Mon,  3 Mar 2014 09:43:37 +0800	[thread overview]
Message-ID: <1393811020-24881-5-git-send-email-xbing6@gmail.com> (raw)
In-Reply-To: <1393811020-24881-1-git-send-email-xbing6@gmail.com>

Signed-off-by: Xuebing Wang <xbing6@gmail.com>
Reviewed-By: Alex Bligh <alex@alex.org.uk>
---
 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

  parent reply	other threads:[~2014-03-03  1:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-03  1:43 [Qemu-devel] [PULL 0/7] refactor timer Xuebing Wang
2014-03-03  1:43 ` [Qemu-devel] [PULL 1/7] timer: move QEMUTimerList functions together Xuebing Wang
2014-03-03  1:43 ` [Qemu-devel] [PULL 2/7] timer: make QEMUTimerList functions private (remove from APIs) Xuebing Wang
2014-03-03  1:43 ` [Qemu-devel] [PULL 3/7] timer: move QEMUClockType related functions together Xuebing Wang
2014-03-03  1:43 ` Xuebing Wang [this message]
2014-03-03  1:43 ` [Qemu-devel] [PULL 5/7] timer: move QEMUTimer " Xuebing Wang
2014-03-03  1:43 ` [Qemu-devel] [PULL 6/7] timer: move general utility " Xuebing Wang
2014-03-03  1:43 ` [Qemu-devel] [PULL 7/7] timer: clean unnecessary #include and use minimal required #include Xuebing Wang
2014-03-07 12:03 ` [Qemu-devel] [PULL 0/7] refactor timer Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1393811020-24881-5-git-send-email-xbing6@gmail.com \
    --to=xbing6@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).