summaryrefslogtreecommitdiff
path: root/src/target/arm11.c
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2009-10-27 13:43:42 +0100
committerØyvind Harboe <oyvind.harboe@zylin.com>2009-11-05 23:57:49 +0100
commitdc98c64d714c3c2e04bb96400955864b59655575 (patch)
treee21d477856337c234f49bbf38f56989c7ae71c0f /src/target/arm11.c
parent051eaf795023e990519b093423dd697b4d757f10 (diff)
downloadopenocd+libswd-dc98c64d714c3c2e04bb96400955864b59655575.tar.gz
openocd+libswd-dc98c64d714c3c2e04bb96400955864b59655575.tar.bz2
openocd+libswd-dc98c64d714c3c2e04bb96400955864b59655575.tar.xz
openocd+libswd-dc98c64d714c3c2e04bb96400955864b59655575.zip
arm11: check if target is halted before executing mrc/mcr commands.
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Diffstat (limited to 'src/target/arm11.c')
-rw-r--r--src/target/arm11.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/target/arm11.c b/src/target/arm11.c
index f1e062ad..5411b04d 100644
--- a/src/target/arm11.c
+++ b/src/target/arm11.c
@@ -2201,6 +2201,13 @@ int arm11_handle_mcr(struct command_context_s *cmd_ctx, char *cmd, char **args,
static int arm11_mrc_inner(target_t *target, int cpnum, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t *value, bool read)
{
int retval;
+
+ if (target->state != TARGET_HALTED)
+ {
+ LOG_ERROR("Target not halted");
+ return ERROR_FAIL;
+ }
+
arm11_common_t * arm11 = target->arch_info;
uint32_t instr = 0xEE000010 |