Convert tricore to providing the translate_for_debug method rather than the deprecated get_phys_addr_debug method.
Signed-off-by: Peter Maydell <[email protected]> --- target/tricore/cpu.h | 3 ++- target/tricore/cpu.c | 2 +- target/tricore/helper.c | 13 ++++++++++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/target/tricore/cpu.h b/target/tricore/cpu.h index 12e497d2a7a..17e3d1fe804 100644 --- a/target/tricore/cpu.h +++ b/target/tricore/cpu.h @@ -79,7 +79,8 @@ struct TriCoreCPUClass { ResettablePhases parent_phases; }; -hwaddr tricore_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); +bool tricore_cpu_translate_for_debug(CPUState *cpu, vaddr addr, + TranslateForDebugResult *result); void tricore_cpu_dump_state(CPUState *cpu, FILE *f, int flags); FIELD(PCXI, PCPN_13, 24, 8) diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index 84a05e3d363..deca702cc6d 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -207,7 +207,7 @@ static bool tricore_cpu_exec_interrupt(CPUState *cs, int interrupt_request) static const struct SysemuCPUOps tricore_sysemu_ops = { .has_work = tricore_cpu_has_work, - .get_phys_addr_debug = tricore_cpu_get_phys_addr_debug, + .translate_for_debug = tricore_cpu_translate_for_debug, }; static const TCGCPUOps tricore_tcg_ops = { diff --git a/target/tricore/helper.c b/target/tricore/helper.c index 273713a1473..9cc80b14c8c 100644 --- a/target/tricore/helper.c +++ b/target/tricore/helper.c @@ -47,7 +47,8 @@ static int get_physical_address(CPUTriCoreState *env, hwaddr *physical, return ret; } -hwaddr tricore_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr) +bool tricore_cpu_translate_for_debug(CPUState *cs, vaddr addr, + TranslateForDebugResult *result) { TriCoreCPU *cpu = TRICORE_CPU(cs); hwaddr phys_addr; @@ -56,9 +57,15 @@ hwaddr tricore_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr) if (get_physical_address(&cpu->env, &phys_addr, &prot, addr, MMU_DATA_LOAD, mmu_idx)) { - return -1; + return false; } - return phys_addr; + + *result = (TranslateForDebugResult) { + .physaddr = phys_addr, + .lg_page_size = TARGET_PAGE_BITS, + .attrs.debug = 1, + }; + return true; } /* TODO: Add exception support */ -- 2.43.0
