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>__archive__
parent
4fef1d5bb0
commit
9721e9dd71
|
@ -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']",
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue