c->sectors = NULL;
c->next = NULL;
- if ((retval = flash_drivers[i]->flash_bank_command(cmd_ctx, cmd, args, argc, c)) != ERROR_OK)
+ retval = CALL_COMMAND_HANDLER(flash_drivers[i]->flash_bank_command, c);
+ if (ERROR_OK != retval)
{
LOG_ERROR("'%s' driver rejected flash bank at 0x%8.8" PRIx32 , args[0], c->base);
free(c);
c->use_raw = 0;
c->next = NULL;
- if ((retval = nand_flash_controllers[i]->nand_device_command(cmd_ctx, cmd, args, argc, c)) != ERROR_OK)
+ retval = CALL_COMMAND_HANDLER(nand_flash_controllers[i]->nand_device_command, c);
+ if (ERROR_OK != retval)
{
LOG_ERROR("'%s' driver rejected nand flash", c->controller->name);
free(c);
* didn't match one of the compiled-in interfaces
*/
LOG_ERROR("The specified JTAG interface was not found (%s)", args[0]);
- handle_interface_list_command(cmd_ctx, cmd, args, argc);
+ CALL_COMMAND_HANDLER(handle_interface_list_command);
return ERROR_JTAG_INVALID_INTERFACE;
}
c->driver = pld_drivers[i];
c->next = NULL;
- if (pld_drivers[i]->pld_device_command(cmd_ctx, cmd, args, argc, c) != ERROR_OK)
+ int retval = CALL_COMMAND_HANDLER(pld_drivers[i]->pld_device_command, c);
+ if (ERROR_OK != retval)
{
LOG_ERROR("'%s' driver rejected pld device", args[0]);
free(c);
/* daemon configuration command gdb_port */
COMMAND_HANDLER(handle_gdb_port_command)
{
- return server_port_command(cmd_ctx, cmd, args, argc, &gdb_port);
+ return CALL_COMMAND_HANDLER(server_port_command, &gdb_port);
}
COMMAND_HANDLER(handle_gdb_memory_map_command)
COMMAND_HANDLER(handle_tcl_port_command)
{
- return server_port_command(cmd_ctx, cmd, args, argc, &tcl_port);
+ return CALL_COMMAND_HANDLER(server_port_command, &tcl_port);
}
int tcl_register_commands(command_context_t *cmd_ctx)
/* daemon configuration command telnet_port */
COMMAND_HANDLER(handle_telnet_port_command)
{
- return server_port_command(cmd_ctx, cmd, args, argc, &telnet_port);
+ return CALL_COMMAND_HANDLER(server_port_command, &telnet_port);
}
COMMAND_HANDLER(handle_exit_command)
#define BOOL_WRAPPER(name, print_name) \
COMMAND_HANDLER(arm11_handle_bool_##name) \
{ \
- return arm11_handle_bool(cmd_ctx, cmd, args, argc, &arm11_config_##name, print_name); \
+ return CALL_COMMAND_HANDLER(arm11_handle_bool, \
+ &arm11_config_##name, print_name); \
}
BOOL_WRAPPER(memwrite_burst, "memory write burst mode")
COMMAND_HANDLER(arm11_handle_etmr)
{
- return arm11_handle_etm_read_write(cmd_ctx, cmd, args, argc, true);
+ return CALL_COMMAND_HANDLER(arm11_handle_etm_read_write, true);
}
COMMAND_HANDLER(arm11_handle_etmw)
{
- return arm11_handle_etm_read_write(cmd_ctx, cmd, args, argc, false);
+ return CALL_COMMAND_HANDLER(arm11_handle_etm_read_write, false);
}
#define ARM11_HANDLER(x) .x = arm11_##x
case 0:
break;
case 4:
- handle_etm_tracemode_command_update(cmd_ctx, cmd, args, argc, &tracemode);
+ CALL_COMMAND_HANDLER(handle_etm_tracemode_command_update, &tracemode);
break;
default:
command_print(cmd_ctx, "usage: configure trace mode "
return ERROR_OK;
}
- return handle_wait_halt_command(cmd_ctx, cmd, args, argc);
+ return CALL_COMMAND_HANDLER(handle_wait_halt_command);
}
COMMAND_HANDLER(handle_soft_reset_halt_command)
int i;
image_t image;
- int retval = parse_load_image_command_args(cmd_ctx, cmd, args, argc,
+ int retval = CALL_COMMAND_HANDLER(parse_load_image_command_args,
&image, &min_address, &max_address);
if (ERROR_OK != retval)
return retval;
COMMAND_HANDLER(handle_verify_image_command)
{
- return handle_verify_image_command_internal(cmd_ctx, cmd, args, argc, 1);
+ return CALL_COMMAND_HANDLER(handle_verify_image_command_internal, 1);
}
COMMAND_HANDLER(handle_test_image_command)
{
- return handle_verify_image_command_internal(cmd_ctx, cmd, args, argc, 0);
+ return CALL_COMMAND_HANDLER(handle_verify_image_command_internal, 0);
}
static int handle_bp_command_list(struct command_context_s *cmd_ctx)
image_t image;
- int retval = parse_load_image_command_args(cmd_ctx, cmd, args, argc,
+ int retval = CALL_COMMAND_HANDLER(parse_load_image_command_args,
&image, &min_address, &max_address);
if (ERROR_OK != retval)
return retval;