Skip to content

Commit

Permalink
target/openrisc: Use exit_tb instead of CPU_INTERRUPT_EXITTB
Browse files Browse the repository at this point in the history
No need to use the interrupt mechanisms when we can
simply exit the tb directly.

Reviewed-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Stafford Horne <shorne@gmail.com>
  • Loading branch information
rth7680 authored and stffrdhrn committed Jul 2, 2018
1 parent c86395c commit 64e46c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions target/openrisc/interrupt_helper.c
Expand Up @@ -26,7 +26,6 @@
void HELPER(rfe)(CPUOpenRISCState *env)
{
OpenRISCCPU *cpu = openrisc_env_get_cpu(env);
CPUState *cs = CPU(cpu);
#ifndef CONFIG_USER_ONLY
int need_flush_tlb = (cpu->env.sr & (SR_SM | SR_IME | SR_DME)) ^
(cpu->env.esr & (SR_SM | SR_IME | SR_DME));
Expand All @@ -53,8 +52,8 @@ void HELPER(rfe)(CPUOpenRISCState *env)
}

if (need_flush_tlb) {
CPUState *cs = CPU(cpu);
tlb_flush(cs);
}
#endif
cs->interrupt_request |= CPU_INTERRUPT_EXITTB;
}
6 changes: 3 additions & 3 deletions target/openrisc/translate.c
Expand Up @@ -37,6 +37,7 @@
#include "exec/log.h"

/* is_jmp field values */
#define DISAS_EXIT DISAS_TARGET_0 /* force exit to main loop */
#define DISAS_UPDATE DISAS_TARGET_1 /* cpu state was modified dynamically */

typedef struct DisasContext {
Expand Down Expand Up @@ -1133,7 +1134,7 @@ static bool trans_l_rfe(DisasContext *dc, arg_l_rfe *a, uint32_t insn)
gen_illegal_exception(dc);
} else {
gen_helper_rfe(cpu_env);
dc->base.is_jmp = DISAS_UPDATE;
dc->base.is_jmp = DISAS_EXIT;
}
#endif
return true;
Expand Down Expand Up @@ -1353,8 +1354,7 @@ static void openrisc_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs)
case DISAS_NORETURN:
break;
case DISAS_UPDATE:
/* indicate that the hash table must be used
to find the next TB */
case DISAS_EXIT:
tcg_gen_exit_tb(NULL, 0);
break;
default:
Expand Down

0 comments on commit 64e46c9

Please sign in to comment.