@samitouri / QOSamiQemu / commits / 9e095560bb

hw/xtensa: Use cpu_translate_for_debug()

We want to remove the cpu_get_phys_addr_debug() function; update the xtensa boards to use cpu_translate_for_debug() instead. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20260430093810.2762539-22-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Peter Maydell committed Apr 30, 2026 at 10:38 UTC 9e095560bbae211559bd98f9ffb199eed9fc5f0a
2 files changed +10 -2
hw/xtensa/sim.c
+5 -1
@@ -40,8 +40,12 @@
40 static uint64_t translate_phys_addr(void *opaque, uint64_t addr)
41 {
42 XtensaCPU *cpu = opaque;
43 + TranslateForDebugResult tres;
44
44 - return cpu_get_phys_addr_debug(CPU(cpu), addr);
45 + if (!cpu_translate_for_debug(CPU(cpu), addr, &tres)) {
46 + return -1;
47 + }
48 + return tres.physaddr;
49 }
50
51 static void sim_reset(void *opaque)
hw/xtensa/xtfpga.c
+5 -1
@@ -191,8 +191,12 @@ static PFlashCFI01 *xtfpga_flash_init(MemoryRegion *address_space,
191 static uint64_t translate_phys_addr(void *opaque, uint64_t addr)
192 {
193 XtensaCPU *cpu = opaque;
194 + TranslateForDebugResult tres;
195
195 - return cpu_get_phys_addr_debug(CPU(cpu), addr);
196 + if (!cpu_translate_for_debug(CPU(cpu), addr, &tres)) {
197 + return -1;
198 + }
199 + return tres.physaddr;
200 }
201
202 static void xtfpga_reset(void *opaque)