mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
target/xtensa: support icount
Delimit each instruction that may access timers or IRQ state with qemu_io_start/qemu_io_end, so that qemu-system-xtensa could be run with -icount option. Raise EXCP_YIELD after CCOMPARE reprogramming to let tcg_cpu_exec recalculate how long this CPU is allowed to run. RSR now may need to terminate TB, but it can't be done in RSR handler because the same handler is used for XSR together with WSR handler, which may also need to terminate TB. Change RSR and WSR handlers return type to bool indicating whether TB termination is needed (RSR) or has been done (WSR), and add TB termination after RSR/WSR dispatcher call. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
This commit is contained in:
parent
59a71f7578
commit
d2132510ca
3 changed files with 143 additions and 45 deletions
|
@ -382,6 +382,7 @@ typedef struct CPUXtensaState {
|
|||
uint32_t ccount_base;
|
||||
|
||||
int exception_taken;
|
||||
int yield_needed;
|
||||
unsigned static_vectors;
|
||||
|
||||
/* Watchpoints for DBREAK registers */
|
||||
|
@ -554,6 +555,7 @@ static inline int cpu_mmu_index(CPUXtensaState *env, bool ifetch)
|
|||
#define XTENSA_TBFLAG_EXCEPTION 0x4000
|
||||
#define XTENSA_TBFLAG_WINDOW_MASK 0x18000
|
||||
#define XTENSA_TBFLAG_WINDOW_SHIFT 15
|
||||
#define XTENSA_TBFLAG_YIELD 0x20000
|
||||
|
||||
static inline void cpu_get_tb_cpu_state(CPUXtensaState *env, target_ulong *pc,
|
||||
target_ulong *cs_base, uint32_t *flags)
|
||||
|
@ -595,6 +597,9 @@ static inline void cpu_get_tb_cpu_state(CPUXtensaState *env, target_ulong *pc,
|
|||
} else {
|
||||
*flags |= 3 << XTENSA_TBFLAG_WINDOW_SHIFT;
|
||||
}
|
||||
if (env->yield_needed) {
|
||||
*flags |= XTENSA_TBFLAG_YIELD;
|
||||
}
|
||||
}
|
||||
|
||||
#include "exec/cpu-all.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue