Commit e188b2351c for qemu.org
commit e188b2351cd01778e090b535aeaeef599a97fbf8
Author: Peter Maydell <peter.maydell@linaro.org>
Date: Tue Oct 20 13:27:49 2026 +0100
target/avr: Convert to translate_for_debug
Convert avr to providing the translate_for_debug method rather than
the deprecated get_phys_addr_debug method.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Message-ID: <20261020122752.3651914-3-peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
diff --git a/target/avr/cpu.c b/target/avr/cpu.c
index 244871e5e6..83710f5651 100644
--- a/target/avr/cpu.c
+++ b/target/avr/cpu.c
@@ -234,7 +234,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/cpu.h b/target/avr/cpu.h
index b1b5b63761..a98fa6cead 100644
--- a/target/avr/cpu.h
+++ b/target/avr/cpu.h
@@ -179,7 +179,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/helper.c b/target/avr/helper.c
index f452c9d904..8f90b8d9a4 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,