On 20/10/26 14:27, Peter Maydell wrote:
Convert tricore to providing the translate_for_debug method rather
than the deprecated get_phys_addr_debug method.

Signed-off-by: Peter Maydell <[email protected]>
---
  target/tricore/cpu.h    |  3 ++-
  target/tricore/cpu.c    |  2 +-
  target/tricore/helper.c | 13 ++++++++++---
  3 files changed, 13 insertions(+), 5 deletions(-)


diff --git a/target/tricore/helper.c b/target/tricore/helper.c
index 273713a1473..9cc80b14c8c 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;

pre-existing, get_physical_address() always returns TLBRET_MATCH (0)
so this part is dead code, but better keep the same pattern between
targets.

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>

      }
-    return phys_addr;
+
+    *result = (TranslateForDebugResult) {
+        .physaddr = phys_addr,
+        .lg_page_size = TARGET_PAGE_BITS,
+        .attrs.debug = 1,
+    };
+    return true;
  }
/* TODO: Add exception support */


Reply via email to