aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Hunter <ehunter@broadcom.com>2016-01-11 11:04:19 +0000
committerAndreas Fritiofson <andreas.fritiofson@gmail.com>2016-02-29 20:26:13 +0000
commit9721e9dd71d3a6be911d0c650ca824348eee2bc0 (patch)
tree86753bfeeec3d743c5ac689682d3b1fa8d417e07
parent4fef1d5bb0e1453df28c5369ed89b4b445f32983 (diff)
downloadriscv-openocd-9721e9dd71d3a6be911d0c650ca824348eee2bc0.zip
riscv-openocd-9721e9dd71d3a6be911d0c650ca824348eee2bc0.tar.gz
riscv-openocd-9721e9dd71d3a6be911d0c650ca824348eee2bc0.tar.bz2
Cortex-A/R: Fix Mask-ISR parsing
Remove needless error when not halted with wrong return. Allow usage in any mode Add error message for incorrect arguments Change-Id: I3e94e159609351e503ed3f35760503079e3aa53c Signed-off-by: Evan Hunter <ehunter@broadcom.com> Reviewed-on: http://openocd.zylin.com/3195 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
-rw-r--r--src/target/cortex_a.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/target/cortex_a.c b/src/target/cortex_a.c
index e6e84bd..b8304c4 100644
--- a/src/target/cortex_a.c
+++ b/src/target/cortex_a.c
@@ -3336,17 +3336,14 @@ COMMAND_HANDLER(handle_cortex_a_mask_interrupts_command)
};
const Jim_Nvp *n;
- if (target->state != TARGET_HALTED) {
- command_print(CMD_CTX, "target must be stopped for \"%s\" command", CMD_NAME);
- return ERROR_OK;
- }
-
if (CMD_ARGC > 0) {
n = Jim_Nvp_name2value_simple(nvp_maskisr_modes, CMD_ARGV[0]);
- if (n->name == NULL)
+ if (n->name == NULL) {
+ LOG_ERROR("Unknown parameter: %s - should be off or on", CMD_ARGV[0]);
return ERROR_COMMAND_SYNTAX_ERROR;
- cortex_a->isrmasking_mode = n->value;
+ }
+ cortex_a->isrmasking_mode = n->value;
}
n = Jim_Nvp_value2name_simple(nvp_maskisr_modes, cortex_a->isrmasking_mode);
@@ -3418,7 +3415,7 @@ static const struct command_registration cortex_a_exec_command_handlers[] = {
{
.name = "maskisr",
.handler = handle_cortex_a_mask_interrupts_command,
- .mode = COMMAND_EXEC,
+ .mode = COMMAND_ANY,
.help = "mask cortex_a interrupts",
.usage = "['on'|'off']",
},