RUNSTALL signal stalls core execution while it's applied. It is widely
used in multicore configurations to control activity of additional
cores.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
{
XtensaCPU *cpu = XTENSA_CPU(cs);
- return cpu->env.pending_irq_level;
+ return !cpu->env.runstall && cpu->env.pending_irq_level;
}
/* CPUClass::reset() */
env->pending_irq_level = 0;
reset_mmu(env);
+ s->halted = env->runstall;
}
static ObjectClass *xtensa_cpu_class_by_name(const char *cpu_model)
xtensa_tlb_entry itlb[7][MAX_TLB_WAY_SIZE];
xtensa_tlb_entry dtlb[10][MAX_TLB_WAY_SIZE];
unsigned autorefill_idx;
-
+ bool runstall;
int pending_irq_level; /* level of last raised IRQ */
void **irq_inputs;
QEMUTimer *ccompare_timer;
assert(n < 2);
env->static_vectors = n;
}
+void xtensa_runstall(CPUXtensaState *env, bool runstall);
#define XTENSA_OPTION_BIT(opt) (((uint64_t)1) << (opt))
#define XTENSA_OPTION_ALL (~(uint64_t)0)
cpu_fprintf(f, "No TLB for this CPU core\n");
}
}
+
+void xtensa_runstall(CPUXtensaState *env, bool runstall)
+{
+ CPUState *cpu = CPU(xtensa_env_get_cpu(env));
+
+ env->runstall = runstall;
+ cpu->halted = runstall;
+ if (runstall) {
+ cpu_interrupt(cpu, CPU_INTERRUPT_HALT);
+ } else {
+ cpu_reset_interrupt(cpu, CPU_INTERRUPT_HALT);
+ }
+}