diff options
author | Blue Swirl <blauwirbel@gmail.com> | 2010-03-29 19:24:00 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2010-03-29 19:24:00 +0000 |
commit | 29e922b61fb3d93836825ca9731bb2cadbb6ed72 (patch) | |
tree | b461e05df4e043c3015857ca95fbfdf704bab059 /qemu-timer.c | |
parent | 5c4532ee7894277d8d54db108e891c4204d15f1d (diff) | |
download | qemu-29e922b61fb3d93836825ca9731bb2cadbb6ed72.tar.gz qemu-29e922b61fb3d93836825ca9731bb2cadbb6ed72.tar.bz2 qemu-29e922b61fb3d93836825ca9731bb2cadbb6ed72.zip |
Compile qemu-timer only once
Arrange various declarations so that also non-CPU code can access
them, adjust users.
Move CPU specific code to cpus.c.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'qemu-timer.c')
-rw-r--r-- | qemu-timer.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/qemu-timer.c b/qemu-timer.c index e6076ca522..bdc8206710 100644 --- a/qemu-timer.c +++ b/qemu-timer.c @@ -53,16 +53,14 @@ #include <mmsystem.h> #endif -#include "cpu-defs.h" #include "qemu-timer.h" -#include "exec-all.h" /* Conversion factor from emulated instructions to virtual clock ticks. */ -static int icount_time_shift; +int icount_time_shift; /* Arbitrarily pick 1MIPS as the minimum allowable speed. */ #define MAX_ICOUNT_SHIFT 10 /* Compensate for varying guest execution speed. */ -static int64_t qemu_icount_bias; +int64_t qemu_icount_bias; static QEMUTimer *icount_rt_timer; static QEMUTimer *icount_vm_timer; @@ -138,20 +136,6 @@ static int64_t get_clock(void) } #endif -/* Return the virtual CPU time, based on the instruction counter. */ -static int64_t cpu_get_icount(void) -{ - int64_t icount; - CPUState *env = cpu_single_env;; - icount = qemu_icount; - if (env) { - if (!can_do_io(env)) - fprintf(stderr, "Bad clock read\n"); - icount -= (env->icount_decr.u16.low + env->icount_extra); - } - return qemu_icount_bias + (icount << icount_time_shift); -} - /***********************************************************/ /* guest cycle counter */ |