Skip to content

Commit

Permalink
target-xtensa: Use cpu_exec_interrupt qom hook
Browse files Browse the repository at this point in the history
Cc: Max Filippov <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
Reviewed-by: Max Filippov <[email protected]>
Message-id: [email protected]
Signed-off-by: Peter Maydell <[email protected]>
  • Loading branch information
rth7680 authored and pm215 committed Sep 25, 2014
1 parent 9585db6 commit 37f3616
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
6 changes: 0 additions & 6 deletions cpu-exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,12 +669,6 @@ int cpu_exec(CPUArchState *env)
cc->do_interrupt(cpu);
next_tb = 0;
}
#elif defined(TARGET_XTENSA)
if (interrupt_request & CPU_INTERRUPT_HARD) {
cpu->exception_index = EXC_IRQ;
cc->do_interrupt(cpu);
next_tb = 0;
}
#endif
/* The target hook has 3 exit conditions:
False when the interrupt isn't processed,
Expand Down
1 change: 1 addition & 0 deletions target-xtensa/cpu-qom.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ static inline XtensaCPU *xtensa_env_get_cpu(const CPUXtensaState *env)
#define ENV_OFFSET offsetof(XtensaCPU, env)

void xtensa_cpu_do_interrupt(CPUState *cpu);
bool xtensa_cpu_exec_interrupt(CPUState *cpu, int interrupt_request);
void xtensa_cpu_dump_state(CPUState *cpu, FILE *f,
fprintf_function cpu_fprintf, int flags);
hwaddr xtensa_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
Expand Down
1 change: 1 addition & 0 deletions target-xtensa/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ static void xtensa_cpu_class_init(ObjectClass *oc, void *data)
cc->class_by_name = xtensa_cpu_class_by_name;
cc->has_work = xtensa_cpu_has_work;
cc->do_interrupt = xtensa_cpu_do_interrupt;
cc->cpu_exec_interrupt = xtensa_cpu_exec_interrupt;
cc->dump_state = xtensa_cpu_dump_state;
cc->set_pc = xtensa_cpu_set_pc;
cc->gdb_read_register = xtensa_cpu_gdb_read_register;
Expand Down
10 changes: 10 additions & 0 deletions target-xtensa/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,16 @@ void xtensa_cpu_do_interrupt(CPUState *cs)
check_interrupts(env);
}

bool xtensa_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
{
if (interrupt_request & CPU_INTERRUPT_HARD) {
cs->exception_index = EXC_IRQ;
xtensa_cpu_do_interrupt(cs);
return true;
}
return false;
}

static void reset_tlb_mmu_all_ways(CPUXtensaState *env,
const xtensa_tlb *tlb, xtensa_tlb_entry entry[][MAX_TLB_WAY_SIZE])
{
Expand Down

0 comments on commit 37f3616

Please sign in to comment.