384 |
{ |
{ |
385 |
pthread_t timer_irq_thread; |
pthread_t timer_irq_thread; |
386 |
mips_insn_t insn; |
mips_insn_t insn; |
|
int idle_count = 0; |
|
387 |
int timer_irq_check = 0; |
int timer_irq_check = 0; |
388 |
int res; |
int res; |
389 |
|
|
397 |
} |
} |
398 |
|
|
399 |
cpu->cpu_thread_running = TRUE; |
cpu->cpu_thread_running = TRUE; |
400 |
|
|
401 |
start_cpu: |
start_cpu: |
402 |
|
cpu->idle_count = 0; |
403 |
|
|
404 |
for(;;) { |
for(;;) { |
405 |
if (unlikely(cpu->state != MIPS_CPU_RUNNING)) |
if (unlikely(cpu->state != MIPS_CPU_RUNNING)) |
406 |
break; |
break; |
407 |
|
|
408 |
/* Handle virtual idle loop */ |
/* Handle virtual idle loop */ |
409 |
if (unlikely(cpu->pc == cpu->idle_pc)) { |
if (unlikely(cpu->pc == cpu->idle_pc)) { |
410 |
if (++idle_count == cpu->idle_max) { |
if (++cpu->idle_count == cpu->idle_max) { |
411 |
mips64_idle_loop(cpu); |
mips64_idle_loop(cpu); |
412 |
idle_count = 0; |
cpu->idle_count = 0; |
413 |
} |
} |
414 |
} |
} |
415 |
|
|