Convert alpha to providing the translate_for_debug method rather than the deprecated get_phys_addr_debug method.
Signed-off-by: Peter Maydell <[email protected]> --- target/alpha/cpu.h | 3 ++- target/alpha/cpu.c | 2 +- target/alpha/helper.c | 15 +++++++++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h index 378bd96d941..32f53453d72 100644 --- a/target/alpha/cpu.h +++ b/target/alpha/cpu.h @@ -282,7 +282,8 @@ extern const VMStateDescription vmstate_alpha_cpu; void alpha_cpu_do_interrupt(CPUState *cpu); bool alpha_cpu_exec_interrupt(CPUState *cpu, int int_req); -hwaddr alpha_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); +bool alpha_cpu_translate_for_debug(CPUState *cpu, vaddr addr, + TranslateForDebugResult *result); #endif /* !CONFIG_USER_ONLY */ void alpha_cpu_dump_state(CPUState *cs, FILE *f, int flags); int alpha_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index 12e86021663..dca25456e78 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -242,7 +242,7 @@ static void alpha_cpu_initfn(Object *obj) static const struct SysemuCPUOps alpha_sysemu_ops = { .has_work = alpha_cpu_has_work, - .get_phys_addr_debug = alpha_cpu_get_phys_addr_debug, + .translate_for_debug = alpha_cpu_translate_for_debug, }; #endif diff --git a/target/alpha/helper.c b/target/alpha/helper.c index c3614ecafda..ccf1994b31b 100644 --- a/target/alpha/helper.c +++ b/target/alpha/helper.c @@ -297,14 +297,25 @@ static int get_physical_address(CPUAlphaState *env, vaddr addr, return ret; } -hwaddr alpha_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr) +bool alpha_cpu_translate_for_debug(CPUState *cs, vaddr addr, + TranslateForDebugResult *result) { hwaddr phys; int prot, fail; fail = get_physical_address(cpu_env(cs), addr, 0, 0, &phys, &prot); + if (fail >= 0) { + return false; + } + phys |= addr & ~TARGET_PAGE_MASK; - return (fail >= 0 ? -1 : phys); + + *result = (TranslateForDebugResult) { + .physaddr = phys, + .lg_page_size = TARGET_PAGE_BITS, + .attrs.debug = 1, + }; + return true; } bool alpha_cpu_tlb_fill(CPUState *cs, vaddr addr, int size, -- 2.43.0
