summaryrefslogtreecommitdiff
path: root/target/xtensa/helper.c
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2016-12-13 18:52:08 -0800
committerMax Filippov <jcmvbkbc@gmail.com>2017-01-15 13:01:55 -0800
commitbd527a83232ce8b48dac4b8c86607ad8a7e28d98 (patch)
tree6650120264bc9b01d6034e5ae017de2809d8ee99 /target/xtensa/helper.c
parent17ab14acd488289d2f85ad6212b212c21f050b3d (diff)
downloadqemu-bd527a83232ce8b48dac4b8c86607ad8a7e28d98.tar.gz
target/xtensa: implement RUNSTALL
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>
Diffstat (limited to 'target/xtensa/helper.c')
-rw-r--r--target/xtensa/helper.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/target/xtensa/helper.c b/target/xtensa/helper.c
index 768b32c417..c67d715c4b 100644
--- a/target/xtensa/helper.c
+++ b/target/xtensa/helper.c
@@ -728,3 +728,16 @@ void dump_mmu(FILE *f, fprintf_function cpu_fprintf, CPUXtensaState *env)
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);
+ }
+}