Commit 97f45d8ded for qemu.org
commit 97f45d8ded7c53275855d45528836b0ee05811d0
Author: Peter Maydell <peter.maydell@linaro.org>
Date: Tue Oct 20 13:27:52 2026 +0100
target/tricore: Convert to translate_for_debug
Convert tricore 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-6-peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c
index 82b56c3cd5..fa782f82f0 100644
--- a/target/tricore/cpu.c
+++ b/target/tricore/cpu.c
@@ -207,7 +207,7 @@ static bool tricore_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
static const struct SysemuCPUOps tricore_sysemu_ops = {
.has_work = tricore_cpu_has_work,
- .get_phys_addr_debug = tricore_cpu_get_phys_addr_debug,
+ .translate_for_debug = tricore_cpu_translate_for_debug,
};
static const TCGCPUOps tricore_tcg_ops = {
diff --git a/target/tricore/cpu.h b/target/tricore/cpu.h
index 12e497d2a7..17e3d1fe80 100644
--- a/target/tricore/cpu.h
+++ b/target/tricore/cpu.h
@@ -79,7 +79,8 @@ struct TriCoreCPUClass {
ResettablePhases parent_phases;
};
-hwaddr tricore_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr);
+bool tricore_cpu_translate_for_debug(CPUState *cpu, vaddr addr,
+ TranslateForDebugResult *result);
void tricore_cpu_dump_state(CPUState *cpu, FILE *f, int flags);
FIELD(PCXI, PCPN_13, 24, 8)
diff --git a/target/tricore/helper.c b/target/tricore/helper.c
index 273713a147..9cc80b14c8 100644
--- a/target/tricore/helper.c
+++ b/target/tricore/helper.c
@@ -47,7 +47,8 @@ static int get_physical_address(CPUTriCoreState *env, hwaddr *physical,
return ret;
}
-hwaddr tricore_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr)
+bool tricore_cpu_translate_for_debug(CPUState *cs, vaddr addr,
+ TranslateForDebugResult *result)
{
TriCoreCPU *cpu = TRICORE_CPU(cs);
hwaddr phys_addr;
@@ -56,9 +57,15 @@ hwaddr tricore_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr)
if (get_physical_address(&cpu->env, &phys_addr, &prot, addr,
MMU_DATA_LOAD, mmu_idx)) {
- return -1;
+ return false;
}
- return phys_addr;
+
+ *result = (TranslateForDebugResult) {
+ .physaddr = phys_addr,
+ .lg_page_size = TARGET_PAGE_BITS,
+ .attrs.debug = 1,
+ };
+ return true;
}
/* TODO: Add exception support */