summaryrefslogtreecommitdiff
path: root/src/target/arm920t.c
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2010-08-11 10:58:49 +0200
committerØyvind Harboe <oyvind.harboe@zylin.com>2010-08-11 10:58:49 +0200
commitf941192723f7d71ae4a9a8f011dad5909f156da3 (patch)
tree7e0b779613edac188d90b69ce5afc33053a5739b /src/target/arm920t.c
parentba951aede3aa98591087428955dad51279e6a5ea (diff)
downloadopenocd+libswd-f941192723f7d71ae4a9a8f011dad5909f156da3.tar.gz
openocd+libswd-f941192723f7d71ae4a9a8f011dad5909f156da3.tar.bz2
openocd+libswd-f941192723f7d71ae4a9a8f011dad5909f156da3.tar.xz
openocd+libswd-f941192723f7d71ae4a9a8f011dad5909f156da3.zip
arm: add missing error reporting
when an unknown core mode is read from the target, report error. Can be communication failure. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Diffstat (limited to 'src/target/arm920t.c')
-rw-r--r--src/target/arm920t.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/target/arm920t.c b/src/target/arm920t.c
index 90f548f3..a3a5adf1 100644
--- a/src/target/arm920t.c
+++ b/src/target/arm920t.c
@@ -281,7 +281,10 @@ static int arm920t_read_cp15_interpreted(struct target *target,
#endif
if (!is_arm_mode(armv4_5->core_mode))
+ {
+ LOG_ERROR("not a valid arm core mode - communication failure?");
return ERROR_FAIL;
+ }
r[0].dirty = 1;
r[1].dirty = 1;
@@ -323,7 +326,10 @@ int arm920t_write_cp15_interpreted(struct target *target,
#endif
if (!is_arm_mode(armv4_5->core_mode))
+ {
+ LOG_ERROR("not a valid arm core mode - communication failure?");
return ERROR_FAIL;
+ }
r[0].dirty = 1;
r[1].dirty = 1;
@@ -1154,7 +1160,10 @@ COMMAND_HANDLER(arm920t_handle_read_cache_command)
fclose(output);
if (!is_arm_mode(armv4_5->core_mode))
+ {
+ LOG_ERROR("not a valid arm core mode - communication failure?");
return ERROR_FAIL;
+ }
/* force writeback of the valid data */
r = armv4_5->core_cache->reg_list;
@@ -1481,7 +1490,10 @@ COMMAND_HANDLER(arm920t_handle_read_mmu_command)
fclose(output);
if (!is_arm_mode(armv4_5->core_mode))
+ {
+ LOG_ERROR("not a valid arm core mode - communication failure?");
return ERROR_FAIL;
+ }
/* force writeback of the valid data */
r = armv4_5->core_cache->reg_list;