qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Wei Yang <weiyang@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: Wei Yang <weiyang@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH] This patch is used to move some struct definition, like QEMUTimer, QEMUClock, from .c to .h.
Date: Tue, 31 Jan 2012 14:56:26 +0800	[thread overview]
Message-ID: <1327992986-28168-1-git-send-email-weiyang@linux.vnet.ibm.com> (raw)

Tested on i386 platform.

Signed-off-by: Wei Yang<weiyang@linux.vnet.ibm.com>
---
 qemu-timer.c |   40 ----------------------------------------
 qemu-timer.h |   41 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 40 deletions(-)

diff --git a/qemu-timer.c b/qemu-timer.c
index cd026c6..2b5cc48 100644
--- a/qemu-timer.c
+++ b/qemu-timer.c
@@ -46,46 +46,6 @@
 
 #include "qemu-timer.h"
 
-/***********************************************************/
-/* timers */
-
-#define QEMU_CLOCK_REALTIME 0
-#define QEMU_CLOCK_VIRTUAL  1
-#define QEMU_CLOCK_HOST     2
-
-struct QEMUClock {
-    int type;
-    int enabled;
-
-    QEMUTimer *active_timers;
-
-    NotifierList reset_notifiers;
-    int64_t last;
-};
-
-struct QEMUTimer {
-    QEMUClock *clock;
-    int64_t expire_time;	/* in nanoseconds */
-    int scale;
-    QEMUTimerCB *cb;
-    void *opaque;
-    struct QEMUTimer *next;
-};
-
-struct qemu_alarm_timer {
-    char const *name;
-    int (*start)(struct qemu_alarm_timer *t);
-    void (*stop)(struct qemu_alarm_timer *t);
-    void (*rearm)(struct qemu_alarm_timer *t, int64_t nearest_delta_ns);
-#if defined(__linux__)
-    int fd;
-    timer_t timer;
-#elif defined(_WIN32)
-    HANDLE timer;
-#endif
-    char expired;
-    char pending;
-};
 
 static struct qemu_alarm_timer *alarm_timer;
 
diff --git a/qemu-timer.h b/qemu-timer.h
index 67ca72e..5bf2fc7 100644
--- a/qemu-timer.h
+++ b/qemu-timer.h
@@ -20,6 +20,47 @@
 typedef struct QEMUClock QEMUClock;
 typedef void QEMUTimerCB(void *opaque);
 
+/***********************************************************/
+/* timers */
+
+#define QEMU_CLOCK_REALTIME 0
+#define QEMU_CLOCK_VIRTUAL  1
+#define QEMU_CLOCK_HOST     2
+
+struct QEMUClock {
+    int type;
+    int enabled;
+
+    QEMUTimer *active_timers;
+
+    NotifierList reset_notifiers;
+    int64_t last;
+};
+
+struct QEMUTimer {
+    QEMUClock *clock;
+    int64_t expire_time;	/* in nanoseconds */
+    int scale;
+    QEMUTimerCB *cb;
+    void *opaque;
+    struct QEMUTimer *next;
+};
+
+struct qemu_alarm_timer {
+    char const *name;
+    int (*start)(struct qemu_alarm_timer *t);
+    void (*stop)(struct qemu_alarm_timer *t);
+    void (*rearm)(struct qemu_alarm_timer *t, int64_t nearest_delta_ns);
+#if defined(__linux__)
+    int fd;
+    timer_t timer;
+#elif defined(_WIN32)
+    HANDLE timer;
+#endif
+    char expired;
+    char pending;
+};
+
 /* The real time clock should be used only for stuff which does not
    change the virtual machine state, as it is run even if the virtual
    machine is stopped. The real time clock has a frequency of 1000
-- 
1.7.4.1

             reply	other threads:[~2012-02-02 13:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-31  6:56 Wei Yang [this message]
2012-02-04 10:22 ` [Qemu-devel] [PATCH] This patch is used to move some struct definition, like QEMUTimer, QEMUClock, from .c to .h Blue Swirl
2012-02-06  1:43   ` Richard Yang

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=1327992986-28168-1-git-send-email-weiyang@linux.vnet.ibm.com \
    --to=weiyang@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /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).