Commit 4668bd26 authored by Øyvind Harboe's avatar Øyvind Harboe Committed by Spencer Oliver
Browse files

retire ERROR_INVALID_ARGUMENTS and replace with ERROR_COMMAND_SYNTAX_ERROR



Change-Id: I6dee51e1fab1944085391f274a343cdb9014c7a4
Signed-off-by: default avatarØyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/300


Tested-by: jenkins
Reviewed-by: default avatarØyvind Harboe <oyvindharboe@gmail.com>
Reviewed-by: default avatarSpencer Oliver <spen@spen-soft.co.uk>
parent 54d6330b
......@@ -141,7 +141,7 @@ static int s3c2440_set_gpio_to_output (struct mflash_gpio_num gpio)
gpio_con = S3C2440_GPJCON;
} else {
LOG_ERROR("mflash: invalid port %d%s", gpio.num, gpio.port);
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
ret = target_read_u32(target, gpio_con, &data);
......@@ -173,7 +173,7 @@ static int s3c2440_set_gpio_output_val (struct mflash_gpio_num gpio, uint8_t val
gpio_dat = S3C2440_GPJDAT;
} else {
LOG_ERROR("mflash: invalid port %d%s", gpio.num, gpio.port);
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
ret = target_read_u32(target, gpio_dat, &data);
......
......@@ -221,7 +221,7 @@ COMMAND_HELPER(nand_command_get_device, unsigned name_index,
*nand = get_nand_device_by_num(num);
if (!*nand) {
command_print(CMD_CTX, "NAND flash device '%s' not found", str);
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
return ERROR_OK;
}
......@@ -542,7 +542,7 @@ int nand_erase(struct nand_device *nand, int first_block, int last_block)
return ERROR_NAND_DEVICE_NOT_PROBED;
if ((first_block < 0) || (last_block >= nand->num_blocks))
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
/* make sure we know if a block is bad before erasing it */
for (i = first_block; i <= last_block; i++)
......
......@@ -177,12 +177,12 @@ COMMAND_HANDLER(handle_nand_erase_command)
COMMAND_PARSE_NUMBER(ulong, CMD_ARGV[1], offset);
if ((offset % p->erase_size) != 0 || offset >= size)
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
COMMAND_PARSE_NUMBER(ulong, CMD_ARGV[2], length);
if ((length == 0) || (length % p->erase_size) != 0
|| (length + offset) > size)
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
offset /= p->erase_size;
length /= p->erase_size;
......@@ -226,12 +226,12 @@ COMMAND_HANDLER(handle_nand_check_bad_blocks_command)
COMMAND_PARSE_NUMBER(ulong, CMD_ARGV[1], offset);
if (offset % p->erase_size)
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
offset /= p->erase_size;
COMMAND_PARSE_NUMBER(ulong, CMD_ARGV[2], length);
if (length % p->erase_size)
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
length -= 1;
length /= p->erase_size;
......
......@@ -897,7 +897,7 @@ static int stellaris_protect(struct flash_bank *bank, int set, int first, int la
{
LOG_ERROR("Hardware doesn't support page-level unprotect. "
"Try the 'recover' command.");
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
if (stellaris_info->did1 == 0)
......
......@@ -848,7 +848,7 @@ COMMAND_HANDLER(handle_flash_bank_command)
COMMAND_HANDLER(handle_flash_banks_command)
{
if (CMD_ARGC != 0)
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
unsigned n = 0;
for (struct flash_bank *p = flash_bank_list(); p; p = p->next, n++)
......
......@@ -314,7 +314,7 @@ COMMAND_HANDLER(tms470_handle_flash_keyset_command)
if (CMD_ARGC > 4)
{
command_print(CMD_CTX, "tms470 flash_keyset <key0> <key1> <key2> <key3>");
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
else if (CMD_ARGC == 4)
{
......@@ -328,7 +328,7 @@ COMMAND_HANDLER(tms470_handle_flash_keyset_command)
{
command_print(CMD_CTX, "could not process flash key %s", CMD_ARGV[i]);
LOG_ERROR("could not process flash key %s", CMD_ARGV[i]);
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
}
......@@ -337,7 +337,7 @@ COMMAND_HANDLER(tms470_handle_flash_keyset_command)
else if (CMD_ARGC != 0)
{
command_print(CMD_CTX, "tms470 flash_keyset <key0> <key1> <key2> <key3>");
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
if (keysSet)
......@@ -378,7 +378,7 @@ COMMAND_HANDLER(tms470_handle_osc_megahertz_command)
if (CMD_ARGC > 1)
{
command_print(CMD_CTX, "tms470 osc_megahertz <MHz>");
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
else if (CMD_ARGC == 1)
{
......@@ -390,7 +390,7 @@ COMMAND_HANDLER(tms470_handle_osc_megahertz_command)
LOG_ERROR("osc_megahertz must be positive and non-zero!");
command_print(CMD_CTX, "osc_megahertz must be positive and non-zero!");
oscMHz = 12;
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
command_print(CMD_CTX, "osc_megahertz=%d", oscMHz);
......@@ -407,7 +407,7 @@ COMMAND_HANDLER(tms470_handle_plldis_command)
if (CMD_ARGC > 1)
{
command_print(CMD_CTX, "tms470 plldis <0 | 1>");
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
else if (CMD_ARGC == 1)
{
......
......@@ -494,7 +494,7 @@ int unregister_command(struct command_context *context,
struct command *parent, const char *name)
{
if ((!context) || (!name))
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
struct command *p = NULL;
struct command **head = command_list_for_parent(context, parent);
......@@ -832,12 +832,12 @@ static COMMAND_HELPER(command_help_find, struct command *head,
struct command **out)
{
if (0 == CMD_ARGC)
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
*out = command_find(head, CMD_ARGV[0]);
if (NULL == *out && strncmp(CMD_ARGV[0], "ocd_", 4) == 0)
*out = command_find(head, CMD_ARGV[0] + 4);
if (NULL == *out)
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
if (--CMD_ARGC == 0)
return ERROR_OK;
CMD_ARGV++;
......@@ -1180,7 +1180,7 @@ COMMAND_HANDLER(handle_help_add_command)
if (CMD_ARGC < 2)
{
LOG_ERROR("%s: insufficient arguments", CMD_NAME);
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
// save help text and remove it from argument list
......@@ -1190,7 +1190,7 @@ COMMAND_HANDLER(handle_help_add_command)
if (!help && !usage)
{
LOG_ERROR("command name '%s' is unknown", CMD_NAME);
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
// likewise for the leaf command name
const char *cmd_name = CMD_ARGV[--CMD_ARGC];
......@@ -1399,7 +1399,7 @@ struct command_context* command_init(const char *startup_tcl, Jim_Interp *interp
int command_context_mode(struct command_context *cmd_ctx, enum command_mode mode)
{
if (!cmd_ctx)
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
cmd_ctx->mode = mode;
return ERROR_OK;
......@@ -1503,7 +1503,7 @@ int command_parse_bool_arg(const char *in, bool *out)
return ERROR_OK;
if (command_parse_bool(in, out, "1", "0") == ERROR_OK)
return ERROR_OK;
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
COMMAND_HELPER(handle_command_parse_bool, bool *out, const char *label)
......@@ -1514,7 +1514,7 @@ COMMAND_HELPER(handle_command_parse_bool, bool *out, const char *label)
if (command_parse_bool_arg(in, out) != ERROR_OK)
{
LOG_ERROR("%s: argument '%s' is not valid", CMD_NAME, in);
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
// fall through
}
......@@ -1522,7 +1522,7 @@ COMMAND_HELPER(handle_command_parse_bool, bool *out, const char *label)
LOG_INFO("%s is %s", label, *out ? "enabled" : "disabled");
break;
default:
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
return ERROR_OK;
}
......@@ -63,7 +63,7 @@ static inline int fileio_open_local(struct fileio_internal *fileio)
break;
default:
LOG_ERROR("BUG: access neither read, write nor readwrite");
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
/* win32 always opens in binary mode */
......
......@@ -118,7 +118,7 @@ COMMAND_HANDLER(handle_cat_command)
if (CMD_ARGC != 1)
{
command_print(CMD_CTX, "cat <filename>");
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
// NOTE!!! we only have line printing capability so we print the entire file as a single line.
......@@ -144,7 +144,7 @@ COMMAND_HANDLER(handle_trunc_command)
if (CMD_ARGC != 1)
{
command_print(CMD_CTX, "trunc <filename>");
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
FILE *config_file = NULL;
......@@ -163,7 +163,7 @@ COMMAND_HANDLER(handle_meminfo_command)
if (CMD_ARGC != 0)
{
command_print(CMD_CTX, "meminfo");
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
info = mallinfo();
......@@ -186,7 +186,7 @@ COMMAND_HANDLER(handle_append_command)
{
command_print(CMD_CTX,
"append <filename> [<string1>, [<string2>, ...]]");
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
int retval = ERROR_FAIL;
......@@ -224,7 +224,7 @@ COMMAND_HANDLER(handle_cp_command)
{
if (CMD_ARGC != 2)
{
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
// NOTE!!! we only have line printing capability so we print the entire file as a single line.
......@@ -237,7 +237,7 @@ COMMAND_HANDLER(handle_cp_command)
FILE *f = fopen(CMD_ARGV[1], "wb");
if (f == NULL)
retval = ERROR_INVALID_ARGUMENTS;
retval = ERROR_COMMAND_SYNTAX_ERROR;
size_t pos = 0;
for (;;)
......@@ -250,7 +250,7 @@ COMMAND_HANDLER(handle_cp_command)
}
if ((retval == ERROR_OK) && (fwrite(((char *)data) + pos, 1, chunk, f) != chunk))
retval = ERROR_INVALID_ARGUMENTS;
retval = ERROR_COMMAND_SYNTAX_ERROR;
if (retval != ERROR_OK)
{
......@@ -405,7 +405,7 @@ void copydir(char *name, char *destdir)
COMMAND_HANDLER(handle_rm_command)
{
if (CMD_ARGC != 1)
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
bool del = false;
if (rmdir(CMD_ARGV[0]) == 0)
......
......@@ -326,7 +326,7 @@ int log_add_callback(log_callback_fn fn, void *priv)
for (cb = log_callbacks; cb; cb = cb->next)
{
if (cb->fn == fn && cb->priv == priv)
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
/* alloc memory, it is safe just to return in case of an error, no need for the caller to check this */
......@@ -357,7 +357,7 @@ int log_remove_callback(log_callback_fn fn, void *priv)
}
/* no such item */
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
/* return allocated string w/printf() result */
......
......@@ -132,7 +132,6 @@ extern int debug_level;
* error codes < 100
*/
#define ERROR_OK (0)
#define ERROR_INVALID_ARGUMENTS ERROR_COMMAND_SYNTAX_ERROR
#define ERROR_NO_CONFIG_FILE (-2)
#define ERROR_BUF_TOO_SMALL (-3)
/* see "Error:" log entry for meaningful message to the user. The caller should
......
......@@ -218,7 +218,7 @@ COMMAND_HANDLER(handle_reset_config_command)
if (mask & m) {
LOG_ERROR("extra reset_config %s spec (%s)",
"gating", *CMD_ARGV);
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
if (m)
goto next;
......@@ -238,7 +238,7 @@ COMMAND_HANDLER(handle_reset_config_command)
if (mask & m) {
LOG_ERROR("extra reset_config %s spec (%s)",
"signal", *CMD_ARGV);
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
if (m)
goto next;
......@@ -258,7 +258,7 @@ COMMAND_HANDLER(handle_reset_config_command)
if (mask & m) {
LOG_ERROR("extra reset_config %s spec (%s)",
"combination", *CMD_ARGV);
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
if (m)
goto next;
......@@ -274,7 +274,7 @@ COMMAND_HANDLER(handle_reset_config_command)
if (mask & m) {
LOG_ERROR("extra reset_config %s spec (%s)",
"trst_type", *CMD_ARGV);
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
if (m)
goto next;
......@@ -290,14 +290,14 @@ COMMAND_HANDLER(handle_reset_config_command)
if (mask & m) {
LOG_ERROR("extra reset_config %s spec (%s)",
"srst_type", *CMD_ARGV);
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
if (m)
goto next;
/* caller provided nonsense; fail */
LOG_ERROR("unknown reset_config flag (%s)", *CMD_ARGV);
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
next:
/* Remember the bits which were specified (mask)
......
......@@ -279,7 +279,7 @@ int jtag_register_event_callback(jtag_event_handler_t callback, void *priv)
if (callback == NULL)
{
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
if (*callbacks_p)
......@@ -303,7 +303,7 @@ int jtag_unregister_event_callback(jtag_event_handler_t callback, void *priv)
if (callback == NULL)
{
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
while (*p)
......
......@@ -686,7 +686,7 @@ static int presto_adapter_khz(int khz, int *jtag_speed)
if (khz < 0)
{
*jtag_speed = 0;
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
if (khz >= 3000) *jtag_speed = 0;
......@@ -700,7 +700,7 @@ static int presto_jtag_speed_div(int speed, int *khz)
if ((speed < 0) || (speed > 1000))
{
*khz = 0;
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
if (speed == 0) *khz = 3000;
......@@ -715,7 +715,7 @@ static int presto_jtag_speed(int speed)
if (presto_jtag_speed_div(speed, &khz))
{
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
presto->jtag_speed = speed;
......
......@@ -283,7 +283,7 @@ int zy1000_speed(int speed)
{
LOG_USER("valid ZY1000 jtag_speed=[8190,2]. With divisor is %dkHz / even values between 8190-2, i.e. min %dHz, max %dMHz",
ZYLIN_KHZ, (ZYLIN_KHZ * 1000) / 8190, ZYLIN_KHZ / (2 * 1000));
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
int khz;
......@@ -325,7 +325,7 @@ COMMAND_HANDLER(handle_power_command)
LOG_INFO("Target power %s", savePower ? "on" : "off");
break;
default:
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
return ERROR_OK;
......
......@@ -82,7 +82,7 @@ int xilinx_read_bit_file(struct xilinx_bit_file *bit_file, const char *filename)
int read_count;
if (!filename || !bit_file)
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
if (stat(filename, &input_stat) == -1)
{
......
......@@ -657,7 +657,7 @@ SERVER_PORT_COMMAND()
break;
}
default:
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
return ERROR_OK;
}
......@@ -676,7 +676,7 @@ SERVER_PIPE_COMMAND()
break;
}
default:
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
return ERROR_OK;
}
......
......@@ -2142,7 +2142,7 @@ static int arm7_9_read_core_reg(struct target *target, struct reg *r,
if (!is_arm_mode(armv4_5->core_mode))
return ERROR_FAIL;
if ((num < 0) || (num > 16))
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
if ((mode != ARM_MODE_ANY)
&& (mode != armv4_5->core_mode)
......@@ -2205,7 +2205,7 @@ static int arm7_9_write_core_reg(struct target *target, struct reg *r,
if (!is_arm_mode(armv4_5->core_mode))
return ERROR_FAIL;
if ((num < 0) || (num > 16))
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
if ((mode != ARM_MODE_ANY)
&& (mode != armv4_5->core_mode)
......@@ -2277,7 +2277,7 @@ int arm7_9_read_memory(struct target *target, uint32_t address, uint32_t size, u
/* sanitize arguments */
if (((size != 4) && (size != 2) && (size != 1)) || (count == 0) || !(buffer))
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
if (((size == 4) && (address & 0x3u)) || ((size == 2) && (address & 0x1u)))
return ERROR_TARGET_UNALIGNED_ACCESS;
......@@ -2457,7 +2457,7 @@ int arm7_9_write_memory(struct target *target, uint32_t address, uint32_t size,
/* sanitize arguments */
if (((size != 4) && (size != 2) && (size != 1)) || (count == 0) || !(buffer))
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
if (((size == 4) && (address & 0x3u)) || ((size == 2) && (address & 0x1u)))
return ERROR_TARGET_UNALIGNED_ACCESS;
......
......@@ -1272,7 +1272,7 @@ int dap_get_debugbase(struct adiv5_dap *dap, int ap,
/* AP address is in bits 31:24 of DP_SELECT */
if (ap >= 256)
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
ap_old = dap->ap_current;
dap_ap_select(dap, ap);
......@@ -1315,7 +1315,7 @@ int dap_lookup_cs_component(struct adiv5_dap *dap, int ap,
int retval = ERROR_FAIL;
if (ap >= 256)
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
ap_old = dap->ap_current;
dap_ap_select(dap, ap);
......@@ -1799,7 +1799,7 @@ COMMAND_HANDLER(dap_baseaddr_command)
COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], apsel);
/* AP address is in bits 31:24 of DP_SELECT */
if (apsel >= 256)
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
break;
default:
return ERROR_COMMAND_SYNTAX_ERROR;
......@@ -1867,7 +1867,7 @@ COMMAND_HANDLER(dap_apsel_command)
COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], apsel);
/* AP address is in bits 31:24 of DP_SELECT */
if (apsel >= 256)
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
break;
default:
return ERROR_COMMAND_SYNTAX_ERROR;
......@@ -1906,7 +1906,7 @@ COMMAND_HANDLER(dap_apid_command)
COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], apsel);
/* AP address is in bits 31:24 of DP_SELECT */
if (apsel >= 256)
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
break;
default:
return ERROR_COMMAND_SYNTAX_ERROR;
......
......@@ -3013,7 +3013,7 @@ static int t2ev_misc(uint32_t opcode, uint32_t address,
mnemonic = "ISB";
break;
default:
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
strcpy(cp, mnemonic);
return ERROR_OK;
......@@ -3064,7 +3064,7 @@ static int t2ev_b_misc(uint32_t opcode, uint32_t address,
}
undef:
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
static int t2ev_data_mod_immed(uint32_t opcode, uint32_t address,
......@@ -3199,7 +3199,7 @@ static int t2ev_data_mod_immed(uint32_t opcode, uint32_t address,
suffix2 = ".W";
break;
default:
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
if (one)
......@@ -3288,7 +3288,7 @@ static int t2ev_data_immed(uint32_t opcode, uint32_t address,
(int) (opcode & 0x1f) + 1 - immed);
return ERROR_OK;
default:
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
sprintf(cp, "%s\tr%d, r%d, #%d\t; %#3.3x", mnemonic,
......@@ -3321,7 +3321,7 @@ static int t2ev_store_single(uint32_t opcode, uint32_t address,
unsigned rt = (opcode >> 12) & 0x0f;
if (rn == 0xf)
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
if (opcode & 0x0800)
op |= 1;
......@@ -3358,7 +3358,7 @@ static int t2ev_store_single(uint32_t opcode, uint32_t address,
break;
/* error */
default:
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
sprintf(cp, "STR%s.W\tr%d, [r%d, r%d, LSL #%d]",
......@@ -3381,7 +3381,7 @@ imm8:
break;
case 0x000:
case 0x200:
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
/* two indexed modes will write back rn */
......@@ -3426,7 +3426,7 @@ static int t2ev_mul32(uint32_t opcode, uint32_t address,
(int) (opcode >> 0) & 0xf, ra);
break;
default:
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
return ERROR_OK;
}
......@@ -3462,7 +3462,7 @@ static int t2ev_mul64_div(uint32_t opcode, uint32_t address,
(int) (opcode >> 0) & 0xf);
break;
default:
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
return ERROR_OK;
......@@ -3516,7 +3516,7 @@ static int t2ev_ldm_stm(uint32_t opcode, uint32_t address,
sprintf(cp, "LDMDB.W\tr%d%s, ", rn, t ? "!" : "");
break;
default:
return ERROR_INVALID_ARGUMENTS;
return ERROR_COMMAND_SYNTAX_ERROR;
}
cp = strchr(cp, 0);
......@@ -3584,7 +3584,7 @@ static int t2ev_ldrex_strex(uint32_t opcode, uint32_t address,
mnemonic = "STREXH";