|
@@ -49,21 +49,19 @@ static bool icount_sleep = true;
|
|
|
/* Arbitrarily pick 1MIPS as the minimum allowable speed. */
|
|
|
#define MAX_ICOUNT_SHIFT 10
|
|
|
|
|
|
-/*
|
|
|
- * 0 = Do not count executed instructions.
|
|
|
- * 1 = Fixed conversion of insn to ns via "shift" option
|
|
|
- * 2 = Runtime adaptive algorithm to compute shift
|
|
|
- */
|
|
|
-int use_icount;
|
|
|
+/* Do not count executed instructions */
|
|
|
+ICountMode use_icount = ICOUNT_DISABLED;
|
|
|
|
|
|
static void icount_enable_precise(void)
|
|
|
{
|
|
|
- use_icount = 1;
|
|
|
+ /* Fixed conversion of insn to ns via "shift" option */
|
|
|
+ use_icount = ICOUNT_PRECISE;
|
|
|
}
|
|
|
|
|
|
static void icount_enable_adaptive(void)
|
|
|
{
|
|
|
- use_icount = 2;
|
|
|
+ /* Runtime adaptive algorithm to compute shift */
|
|
|
+ use_icount = ICOUNT_ADAPTATIVE;
|
|
|
}
|
|
|
|
|
|
/*
|
|
@@ -256,7 +254,7 @@ static void icount_warp_rt(void)
|
|
|
int64_t warp_delta;
|
|
|
|
|
|
warp_delta = clock - timers_state.vm_clock_warp_start;
|
|
|
- if (icount_enabled() == 2) {
|
|
|
+ if (icount_enabled() == ICOUNT_ADAPTATIVE) {
|
|
|
/*
|
|
|
* In adaptive mode, do not let QEMU_CLOCK_VIRTUAL run too far
|
|
|
* ahead of real time (it might already be ahead so careful not
|