From 0538081246fafbfb74d554bb1b758412534aa254 Mon Sep 17 00:00:00 2001 From: Øyvind Harboe Date: Thu, 10 Jun 2010 16:18:14 +0200 Subject: arm mmu: error propagation added for address translation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The return value for MMU translation was a mess, either error or value. Signed-off-by: Øyvind Harboe --- src/target/arm920t.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/target/arm920t.c') diff --git a/src/target/arm920t.c b/src/target/arm920t.c index 658315b2..31751960 100644 --- a/src/target/arm920t.c +++ b/src/target/arm920t.c @@ -514,8 +514,11 @@ static int arm920_virt2phys(struct target *target, uint32_t ap; struct arm920t_common *arm920t = target_to_arm920(target); - uint32_t ret = armv4_5_mmu_translate_va(target, - &arm920t->armv4_5_mmu, virt, &type, &cb, &domain, &ap); + uint32_t ret; + int retval = armv4_5_mmu_translate_va(target, + &arm920t->armv4_5_mmu, virt, &type, &cb, &domain, &ap, &ret); + if (retval != ERROR_OK) + return retval; if (type == -1) { return ret; @@ -589,8 +592,10 @@ int arm920t_write_memory(struct target *target, uint32_t address, /* * We need physical address and cb */ - pa = armv4_5_mmu_translate_va(target, &arm920t->armv4_5_mmu, - address, &type, &cb, &domain, &ap); + int retval = armv4_5_mmu_translate_va(target, &arm920t->armv4_5_mmu, + address, &type, &cb, &domain, &ap, &pa); + if (retval != ERROR_OK) + return retval; if (type == -1) return pa; -- cgit v1.2.3