From 9721e9dd71d3a6be911d0c650ca824348eee2bc0 Mon Sep 17 00:00:00 2001 From: Evan Hunter Date: Mon, 11 Jan 2016 11:04:19 +0000 Subject: [PATCH] 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 Reviewed-on: http://openocd.zylin.com/3195 Tested-by: jenkins Reviewed-by: Matthias Welwarsky Reviewed-by: Andreas Fritiofson --- src/target/cortex_a.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/target/cortex_a.c b/src/target/cortex_a.c index e6e84bdaf..b8304c414 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']", }, -- 2.11.4.GIT