--- upstream/dynamips-0.2.6-RC1/mips64_exec.c 2007/10/06 16:03:58 2 +++ upstream/dynamips-0.2.6-RC2/mips64_exec.c 2007/10/06 16:05:34 3 @@ -384,7 +384,6 @@ { pthread_t timer_irq_thread; mips_insn_t insn; - int idle_count = 0; int timer_irq_check = 0; int res; @@ -398,16 +397,19 @@ } cpu->cpu_thread_running = TRUE; + start_cpu: + cpu->idle_count = 0; + for(;;) { if (unlikely(cpu->state != MIPS_CPU_RUNNING)) break; /* Handle virtual idle loop */ if (unlikely(cpu->pc == cpu->idle_pc)) { - if (++idle_count == cpu->idle_max) { + if (++cpu->idle_count == cpu->idle_max) { mips64_idle_loop(cpu); - idle_count = 0; + cpu->idle_count = 0; } }