summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2009-09-11 10:28:26 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2009-09-11 11:10:05 -0500
commit274dfed8ba1357496a549d21e94080bca2f7fcb4 (patch)
tree115bf888dc420dfc85af33655d6cc4568d4860b6 /qemu-timer.h
parenttimers: move them to VMState (diff)
downloadqemu-kvm-274dfed8ba1357496a549d21e94080bca2f7fcb4.tar.gz
qemu-kvm-274dfed8ba1357496a549d21e94080bca2f7fcb4.tar.bz2
qemu-kvm-274dfed8ba1357496a549d21e94080bca2f7fcb4.zip
Make get_ticks_per_sec() a static inline
ticks_per_sec is a constant. There's no need to store it as a variable as it never changes since our time is based on units. Convert get_ticks_per_sec() to a static inline and move the constant into qemu-timer.h. Remove all references to QEMU_TIMER_BASE so that we consistently use this interface. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qemu-timer.h')
-rw-r--r--qemu-timer.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/qemu-timer.h b/qemu-timer.h
index 00b166de4..e44c33420 100644
--- a/qemu-timer.h
+++ b/qemu-timer.h
@@ -26,7 +26,10 @@ void qemu_mod_timer(QEMUTimer *ts, int64_t expire_time);
int qemu_timer_pending(QEMUTimer *ts);
int qemu_timer_expired(QEMUTimer *timer_head, int64_t current_time);
-int64_t get_ticks_per_sec(void);
+static inline int64_t get_ticks_per_sec(void)
+{
+ return 1000000000LL;
+}
void qemu_get_timer(QEMUFile *f, QEMUTimer *ts);
void qemu_put_timer(QEMUFile *f, QEMUTimer *ts);