Convert avr to providing the translate_for_debug method rather than the deprecated get_phys_addr_debug method.
Signed-off-by: Peter Maydell <[email protected]> --- target/avr/cpu.h | 3 ++- target/avr/cpu.c | 2 +- target/avr/helper.c | 11 +++++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/target/avr/cpu.h b/target/avr/cpu.h index 1e4e839bd83..4e2372a6801 100644 --- a/target/avr/cpu.h +++ b/target/avr/cpu.h @@ -177,7 +177,8 @@ extern const struct VMStateDescription vms_avr_cpu; void avr_cpu_do_interrupt(CPUState *cpu); bool avr_cpu_exec_interrupt(CPUState *cpu, int int_req); -hwaddr avr_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); +bool avr_cpu_translate_for_debug(CPUState *cpu, vaddr addr, + TranslateForDebugResult *result); int avr_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int avr_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); int avr_print_insn(bfd_vma addr, disassemble_info *info); diff --git a/target/avr/cpu.c b/target/avr/cpu.c index f8409f32ab9..9476bd87276 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -233,7 +233,7 @@ static void avr_cpu_dump_state(CPUState *cs, FILE *f, int flags) static const struct SysemuCPUOps avr_sysemu_ops = { .has_work = avr_cpu_has_work, - .get_phys_addr_debug = avr_cpu_get_phys_addr_debug, + .translate_for_debug = avr_cpu_translate_for_debug, }; static const TCGCPUOps avr_tcg_ops = { diff --git a/target/avr/helper.c b/target/avr/helper.c index f452c9d9040..8f90b8d9a45 100644 --- a/target/avr/helper.c +++ b/target/avr/helper.c @@ -108,9 +108,16 @@ void avr_cpu_do_interrupt(CPUState *cs) qemu_plugin_vcpu_interrupt_cb(cs, ret); } -hwaddr avr_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr) +bool avr_cpu_translate_for_debug(CPUState *cs, vaddr addr, + TranslateForDebugResult *result) { - return addr; /* I assume 1:1 address correspondence */ + /* I assume 1:1 address correspondence */ + *result = (TranslateForDebugResult) { + .physaddr = addr, + .lg_page_size = TARGET_PAGE_BITS, + .attrs.debug = 1, + }; + return true; } bool avr_cpu_tlb_fill(CPUState *cs, vaddr address, int size, -- 2.43.0
