]> git.sur5r.net Git - openocd/commitdiff
Cortex-A/R: Fix Mask-ISR parsing
authorEvan Hunter <ehunter@broadcom.com>
Mon, 11 Jan 2016 11:04:19 +0000 (11:04 +0000)
committerAndreas Fritiofson <andreas.fritiofson@gmail.com>
Mon, 29 Feb 2016 20:26:13 +0000 (20:26 +0000)
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>
src/target/cortex_a.c

index e6e84bdaf72461b3f687293fe4bde678b4172086..b8304c4149939a750fe3cd25c9b12ec330745b9a 100644 (file)
@@ -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']",
        },