Convert hppa to providing the translate_for_debug method rather than the deprecated get_phys_addr_debug method.
Signed-off-by: Peter Maydell <[email protected]> --- target/hppa/cpu.h | 3 ++- target/hppa/cpu.c | 2 +- target/hppa/mem_helper.c | 21 ++++++++++++++++----- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index f453444d7f9..94c81d9fa6e 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -389,7 +389,8 @@ int hppa_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); void hppa_cpu_dump_state(CPUState *cs, FILE *f, int); #ifndef CONFIG_USER_ONLY void hppa_ptlbe(CPUHPPAState *env); -hwaddr hppa_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr); +bool hppa_cpu_translate_for_debug(CPUState *cs, vaddr addr, + TranslateForDebugResult *result); void hppa_set_ior_and_isr(CPUHPPAState *env, vaddr addr, bool mmu_disabled); bool hppa_cpu_tlb_fill_align(CPUState *cs, CPUTLBEntryFull *out, vaddr addr, MMUAccessType access_type, int mmu_idx, diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 07b49e51326..51d9ab186c5 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -245,7 +245,7 @@ static ObjectClass *hppa_cpu_class_by_name(const char *cpu_model) static const struct SysemuCPUOps hppa_sysemu_ops = { .has_work = hppa_cpu_has_work, - .get_phys_addr_debug = hppa_cpu_get_phys_addr_debug, + .translate_for_debug = hppa_cpu_translate_for_debug, }; #endif diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 01e6149c811..2393a155076 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -346,7 +346,8 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx, return ret; } -hwaddr hppa_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr) +bool hppa_cpu_translate_for_debug(CPUState *cs, vaddr addr, + TranslateForDebugResult *result) { HPPACPU *cpu = HPPA_CPU(cs); hwaddr phys; @@ -361,10 +362,20 @@ hwaddr hppa_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr) excp = hppa_get_physical_address(&cpu->env, addr, mmu_idx, 0, 0, &phys, &prot); - /* Since we're translating for debugging, the only error that is a - hard error is no translation at all. Otherwise, while a real cpu - access might not have permission, the debugger does. */ - return excp == EXCP_DTLB_MISS ? -1 : phys; + /* + * Since we're translating for debugging, the only error that is a + * hard error is no translation at all. Otherwise, while a real cpu + * access might not have permission, the debugger does. + */ + if (excp == EXCP_DTLB_MISS) { + return false; + } + *result = (TranslateForDebugResult) { + .physaddr = phys, + .lg_page_size = TARGET_PAGE_BITS, + .attrs.debug = 1, + }; + return true; } void hppa_set_ior_and_isr(CPUHPPAState *env, vaddr addr, bool mmu_disabled) -- 2.43.0
