Hi,
On 20/10/26 14:27, Peter Maydell wrote:
Convert alpha to providing the translate_for_debug method rather than
the deprecated get_phys_addr_debug method.
Signed-off-by: Peter Maydell <[email protected]>
---
target/alpha/cpu.h | 3 ++-
target/alpha/cpu.c | 2 +-
target/alpha/helper.c | 15 +++++++++++++--
3 files changed, 16 insertions(+), 4 deletions(-)
-hwaddr alpha_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr)
+bool alpha_cpu_translate_for_debug(CPUState *cs, vaddr addr,
+ TranslateForDebugResult *result)
{
hwaddr phys;
int prot, fail;
fail = get_physical_address(cpu_env(cs), addr, 0, 0, &phys, &prot);
+ if (fail >= 0) {
Pre-existing, @fail is mis-named, it is the target @excp (or -1 on
failure).
+ return false;
+ }
+
phys |= addr & ~TARGET_PAGE_MASK;
Clearer, we don't update @phys and discard it on failure.
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
- return (fail >= 0 ? -1 : phys);
+
+ *result = (TranslateForDebugResult) {
+ .physaddr = phys,
+ .lg_page_size = TARGET_PAGE_BITS,
+ .attrs.debug = 1,
+ };
+ return true;
}
bool alpha_cpu_tlb_fill(CPUState *cs, vaddr addr, int size,