summaryrefslogtreecommitdiff
path: root/src/target/arm720t.c
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2010-07-19 08:45:45 +0200
committerØyvind Harboe <oyvind.harboe@zylin.com>2010-07-19 22:13:48 +0200
commit70fee9207b5fd1c6f499b790591446adc4d4467c (patch)
tree441eee8f9af2ed37eaf072d22465246037f99d15 /src/target/arm720t.c
parent612184176fee6333e5372c4637e3cf54628ee416 (diff)
downloadopenocd+libswd-70fee9207b5fd1c6f499b790591446adc4d4467c.tar.gz
openocd+libswd-70fee9207b5fd1c6f499b790591446adc4d4467c.tar.bz2
openocd+libswd-70fee9207b5fd1c6f499b790591446adc4d4467c.tar.xz
openocd+libswd-70fee9207b5fd1c6f499b790591446adc4d4467c.zip
arm: add error propagation to generic get_ttb fn
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Diffstat (limited to 'src/target/arm720t.c')
-rw-r--r--src/target/arm720t.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/target/arm720t.c b/src/target/arm720t.c
index 0ea6cb2b..b269f948 100644
--- a/src/target/arm720t.c
+++ b/src/target/arm720t.c
@@ -134,16 +134,24 @@ static int arm720t_write_cp15(struct target *target, uint32_t opcode, uint32_t v
return ERROR_OK;
}
-static uint32_t arm720t_get_ttb(struct target *target)
+static int arm720t_get_ttb(struct target *target, uint32_t *result)
{
uint32_t ttb = 0x0;
- arm720t_read_cp15(target, 0xee120f10, &ttb);
- jtag_execute_queue();
+ int retval;
+
+ retval = arm720t_read_cp15(target, 0xee120f10, &ttb);
+ if (retval != ERROR_OK)
+ return retval;
+ retval = jtag_execute_queue();
+ if (retval != ERROR_OK)
+ return retval;
ttb &= 0xffffc000;
- return ttb;
+ *result = ttb;
+
+ return ERROR_OK;
}
static void arm720t_disable_mmu_caches(struct target *target,