return r;
}
-static int
-sam3_handle_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(sam3_handle_info_command)
{
struct sam3_chip *pChip;
void *vp;
return ERROR_OK;
}
-static int
-sam3_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(sam3_handle_gpnvm_command)
{
unsigned x,v;
int r,who;
return r;
}
-static int
-sam3_handle_slowclk_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(sam3_handle_slowclk_command)
{
struct sam3_chip *pChip;
* The maximum number of write/erase cycles for Non volatile Memory bits is 100. this includes
* Lock Bits (LOCKx), General Purpose NVM bits (GPNVMx) and the Security Bit.
*/
-static int at91sam7_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(at91sam7_handle_gpnvm_command)
{
flash_bank_t *bank;
int bit;
return ERROR_OK;
}
-static int avrf_handle_mass_erase_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(avrf_handle_mass_erase_command)
{
int i;
}
-static int handle_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_bank_command)
{
int retval;
int i;
return ERROR_OK;
}
-static int handle_flash_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_info_command)
{
flash_bank_t *p;
uint32_t i = 0;
return ERROR_OK;
}
-static int handle_flash_probe_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_probe_command)
{
int retval;
return ERROR_OK;
}
-static int handle_flash_erase_check_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_erase_check_command)
{
if (argc != 1)
{
return ERROR_OK;
}
-static int handle_flash_erase_address_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_erase_address_command)
{
flash_bank_t *p;
int retval;
return retval;
}
-static int handle_flash_protect_check_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_protect_check_command)
{
if (argc != 1)
return ERROR_COMMAND_SYNTAX_ERROR;
return ERROR_OK;
}
-static int handle_flash_erase_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_erase_command)
{
if (argc != 2)
return ERROR_COMMAND_SYNTAX_ERROR;
return ERROR_OK;
}
-static int handle_flash_protect_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_protect_command)
{
if (argc != 3)
return ERROR_COMMAND_SYNTAX_ERROR;
return ERROR_OK;
}
-static int handle_flash_write_image_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_write_image_command)
{
target_t *target = get_current_target(cmd_ctx);
return retval;
}
-static int handle_flash_fill_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_fill_command)
{
int err = ERROR_OK;
uint32_t address;
return ERROR_OK;
}
-static int handle_flash_write_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_write_bank_command)
{
uint32_t offset;
uint8_t *buffer;
return ERROR_OK;
}
-static int lpc2000_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(lpc2000_handle_part_id_command)
{
uint32_t param_table[5];
uint32_t result_table[4];
* Uses the Built-In-Self-Test (BIST) to generate a 128-bit hash value
* of the flash content.
*/
-static int lpc2900_handle_signature_command( struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc )
+COMMAND_HANDLER(lpc2900_handle_signature_command)
{
uint32_t status;
uint32_t signature[4];
* Read customer info from index sector, and store that block of data into
* a disk file. The format is binary.
*/
-static int lpc2900_handle_read_custom_command( struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc )
+COMMAND_HANDLER(lpc2900_handle_read_custom_command)
{
if( argc < 2 )
{
/**
* Enter password to enable potentially dangerous options.
*/
-static int lpc2900_handle_password_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(lpc2900_handle_password_command)
{
if (argc < 2)
{
/**
* Write customer info from file to the index sector.
*/
-static int lpc2900_handle_write_custom_command( struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc )
+COMMAND_HANDLER(lpc2900_handle_write_custom_command)
{
if (argc < 2)
{
/**
* Activate 'sector security' for a range of sectors.
*/
-static int lpc2900_handle_secure_sector_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(lpc2900_handle_secure_sector_command)
{
if (argc < 3)
{
/**
* Activate JTAG protection.
*/
-static int lpc2900_handle_secure_jtag_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(lpc2900_handle_secure_jtag_command)
{
if (argc < 1)
{
return 0;
}
-static int handle_lpc3180_select_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_lpc3180_select_command)
{
lpc3180_nand_controller_t *lpc3180_info = NULL;
char *selected[] =
return mg_dsk_drv_info();
}
-static int mg_probe_cmd(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(mg_probe_cmd)
{
int ret;
return ret;
}
-static int mg_write_cmd(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(mg_write_cmd)
{
uint32_t address, buf_cnt, cnt, res, i;
uint8_t *buffer;
return ret;
}
-static int mg_dump_cmd(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(mg_dump_cmd)
{
uint32_t address, size_written, size, cnt, res, i;
uint8_t *buffer;
return ret;
}
-int mg_config_cmd(struct command_context_s *cmd_ctx, char *cmd,
- char **args, int argc)
+COMMAND_HANDLER(mg_config_cmd)
{
double fin, fout;
mg_pll_t pll;
return ERROR_OK;
}
-static int mg_bank_cmd(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(mg_bank_cmd)
{
target_t *target;
int i;
/* nand device <nand_controller> [controller options]
*/
-static int handle_nand_device_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_nand_device_command)
{
int i;
int retval;
return ERROR_OK;
}
-int handle_nand_list_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_nand_list_command)
{
nand_device_t *p;
int i;
return ERROR_OK;
}
-static int handle_nand_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_nand_info_command)
{
int i = 0;
int j = 0;
return ERROR_OK;
}
-static int handle_nand_probe_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_nand_probe_command)
{
if (argc != 1)
{
return ERROR_OK;
}
-static int handle_nand_erase_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_nand_erase_command)
{
if (argc != 1 && argc != 3)
{
return ERROR_OK;
}
-int handle_nand_check_bad_blocks_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_nand_check_bad_blocks_command)
{
int first = -1;
int last = -1;
return ERROR_OK;
}
-static int handle_nand_write_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_nand_write_command)
{
uint32_t offset;
uint32_t binary_size;
return ERROR_OK;
}
-static int handle_nand_dump_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_nand_dump_command)
{
if (argc < 4)
{
return ERROR_OK;
}
-static int handle_nand_raw_access_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_nand_raw_access_command)
{
if ((argc < 1) || (argc > 2))
{
}
#if 0
-static int pic32mx_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(pic32mx_handle_part_id_command)
{
return ERROR_OK;
}
}
#if 0
-int pic32mx_handle_lock_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(pic32mx_handle_lock_command)
{
target_t *target = NULL;
pic32mx_flash_bank_t *pic32mx_info = NULL;
return ERROR_OK;
}
-int pic32mx_handle_unlock_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(pic32mx_handle_unlock_command)
{
target_t *target = NULL;
pic32mx_flash_bank_t *pic32mx_info = NULL;
}
#endif
-static int pic32mx_handle_chip_erase_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(pic32mx_handle_chip_erase_command)
{
#if 0
int i;
return ERROR_OK;
}
-static int pic32mx_handle_pgm_word_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(pic32mx_handle_pgm_word_command)
{
uint32_t address, value;
int status, res;
return ERROR_OK;
}
-static int stellaris_handle_mass_erase_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(stellaris_handle_mass_erase_command)
{
int i;
}
#if 0
-static int stm32x_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(stm32x_handle_part_id_command)
{
return ERROR_OK;
}
return ERROR_OK;
}
-static int stm32x_handle_lock_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(stm32x_handle_lock_command)
{
target_t *target = NULL;
stm32x_flash_bank_t *stm32x_info = NULL;
return ERROR_OK;
}
-static int stm32x_handle_unlock_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(stm32x_handle_unlock_command)
{
target_t *target = NULL;
stm32x_flash_bank_t *stm32x_info = NULL;
return ERROR_OK;
}
-static int stm32x_handle_options_read_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(stm32x_handle_options_read_command)
{
uint32_t optionbyte;
target_t *target = NULL;
return ERROR_OK;
}
-static int stm32x_handle_options_write_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(stm32x_handle_options_write_command)
{
target_t *target = NULL;
stm32x_flash_bank_t *stm32x_info = NULL;
return ERROR_OK;
}
-static int stm32x_handle_mass_erase_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(stm32x_handle_mass_erase_command)
{
int i;
}
#if 0
-static int str7x_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str7x_handle_part_id_command)
{
return ERROR_OK;
}
return ERROR_OK;
}
-static int str7x_handle_disable_jtag_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str7x_handle_disable_jtag_command)
{
target_t *target = NULL;
str7x_flash_bank_t *str7x_info = NULL;
}
#if 0
-static int str9x_handle_part_id_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9x_handle_part_id_command)
{
return ERROR_OK;
}
return ERROR_OK;
}
-static int str9x_handle_flash_config_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9x_handle_flash_config_command)
{
str9x_flash_bank_t *str9x_info;
target_t *target = NULL;
return ERROR_OK;
}
-static int str9xpec_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9xpec_handle_part_id_command)
{
scan_field_t field;
uint8_t *buffer = NULL;
return ERROR_OK;
}
-static int str9xpec_handle_flash_options_read_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9xpec_handle_flash_options_read_command)
{
uint8_t status;
str9xpec_flash_controller_t *str9xpec_info = NULL;
return status;
}
-static int str9xpec_handle_flash_options_write_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9xpec_handle_flash_options_write_command)
{
uint8_t status;
return ERROR_OK;
}
-static int str9xpec_handle_flash_options_cmap_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9xpec_handle_flash_options_cmap_command)
{
str9xpec_flash_controller_t *str9xpec_info = NULL;
return ERROR_OK;
}
-static int str9xpec_handle_flash_options_lvdthd_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9xpec_handle_flash_options_lvdthd_command)
{
str9xpec_flash_controller_t *str9xpec_info = NULL;
return ERROR_OK;
}
-int str9xpec_handle_flash_options_lvdsel_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9xpec_handle_flash_options_lvdsel_command)
{
str9xpec_flash_controller_t *str9xpec_info = NULL;
return ERROR_OK;
}
-static int str9xpec_handle_flash_options_lvdwarn_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9xpec_handle_flash_options_lvdwarn_command)
{
str9xpec_flash_controller_t *str9xpec_info = NULL;
return ERROR_OK;
}
-static int str9xpec_handle_flash_lock_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9xpec_handle_flash_lock_command)
{
uint8_t status;
return ERROR_OK;
}
-static int str9xpec_handle_flash_unlock_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9xpec_handle_flash_unlock_command)
{
uint8_t status;
return ERROR_OK;
}
-static int str9xpec_handle_flash_enable_turbo_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9xpec_handle_flash_enable_turbo_command)
{
jtag_tap_t *tap0;
jtag_tap_t *tap1;
return ERROR_OK;
}
-static int str9xpec_handle_flash_disable_turbo_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(str9xpec_handle_flash_disable_turbo_command)
{
jtag_tap_t *tap;
str9xpec_flash_controller_t *str9xpec_info = NULL;
static uint32_t keysSet = 0;
static uint32_t flashKeys[4];
-static int tms470_handle_flash_keyset_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(tms470_handle_flash_keyset_command)
{
if (argc > 4)
{
static int oscMHz = 12;
-static int tms470_handle_osc_megahertz_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(tms470_handle_osc_megahertz_command)
{
if (argc > 1)
{
static int plldis = 0;
-static int tms470_handle_plldis_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(tms470_handle_plldis_command)
{
if (argc > 1)
{
/* sleep command sleeps for <n> miliseconds
* this is useful in target startup scripts
*/
-static int handle_sleep_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_sleep_command)
{
bool busy = false;
if (argc == 2)
return ERROR_OK;
}
-static int handle_fast_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_fast_command)
{
if (argc != 1)
return ERROR_COMMAND_SYNTAX_ERROR;
#endif
-int handle_rm_command(struct command_context_s *cmd_ctx, char *cmd,
- char **args, int argc)
+COMMAND_HANDLER(handle_rm_command)
{
if (argc != 1)
{
return ERROR_OK;
}
-
-
-int handle_cat_command(struct command_context_s *cmd_ctx, char *cmd,
- char **args, int argc)
+COMMAND_HANDLER(handle_cat_command)
{
if (argc != 1)
{
return ERROR_OK;
}
-int handle_trunc_command(struct command_context_s *cmd_ctx, char *cmd,
- char **args, int argc)
+
+COMMAND_HANDLER(handle_trunc_command)
{
if (argc != 1)
{
return ERROR_OK;
}
-
-int handle_meminfo_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_meminfo_command)
{
static int prev = 0;
struct mallinfo info;
}
-int handle_append_command(struct command_context_s *cmd_ctx, char *cmd,
- char **args, int argc)
+COMMAND_HANDLER(handle_append_command)
{
if (argc < 1)
{
-int handle_cp_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_cp_command)
{
if (argc != 2)
{
* 2: + INFORMATIONAL MSGS
* 3: + DEBUG MSGS
*/
-int handle_debug_level_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_debug_level_command)
{
if (argc == 1)
{
return ERROR_OK;
}
-int handle_log_output_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_log_output_command)
{
if (argc == 1)
{
return ERROR_OK;
}
-static int amt_jtagaccel_handle_parport_port_command(
- struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(amt_jtagaccel_handle_parport_port_command)
{
if (argc == 1)
{
return ERROR_OK;
}
-static int amt_jtagaccel_handle_rtck_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(amt_jtagaccel_handle_rtck_command)
{
if (argc == 0)
{
return ERROR_OK;
}
-static int ft2232_handle_device_desc_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
+COMMAND_HANDLER(ft2232_handle_device_desc_command)
{
char *cp;
char buf[200];
return ERROR_OK;
}
-static int ft2232_handle_serial_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
+COMMAND_HANDLER(ft2232_handle_serial_command)
{
if (argc == 1)
{
return ERROR_OK;
}
-static int ft2232_handle_layout_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
+COMMAND_HANDLER(ft2232_handle_layout_command)
{
if (argc == 0)
return ERROR_OK;
return ERROR_OK;
}
-static int ft2232_handle_vid_pid_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
+COMMAND_HANDLER(ft2232_handle_vid_pid_command)
{
if (argc > MAX_USB_IDS * 2)
{
return retval;
}
-static int ft2232_handle_latency_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
+COMMAND_HANDLER(ft2232_handle_latency_command)
{
if (argc == 1)
{
return ERROR_OK;
}
-static int gw16012_handle_parport_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(gw16012_handle_parport_port_command)
{
if (argc == 1)
{
return ERROR_OK;
}
-static int parport_handle_parport_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(parport_handle_parport_port_command)
{
if (argc == 1)
{
return ERROR_OK;
}
-static int parport_handle_parport_cable_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(parport_handle_parport_cable_command)
{
if (argc == 0)
return ERROR_OK;
return ERROR_OK;
}
-static int parport_handle_write_on_exit_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(parport_handle_write_on_exit_command)
{
if (argc != 1)
{
static char *presto_serial;
-static int presto_handle_serial_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(presto_handle_serial_command)
{
if (argc == 1)
{
return ERROR_OK;
}
-static int handle_interface_list_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_interface_list_command)
{
if (strcmp(cmd, "interface_list") == 0 && argc > 0)
return ERROR_COMMAND_SYNTAX_ERROR;
return ERROR_OK;
}
-static int handle_interface_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_interface_command)
{
/* check whether the interface is already configured */
if (jtag_interface)
return ERROR_JTAG_INVALID_INTERFACE;
}
-static int handle_scan_chain_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_scan_chain_command)
{
jtag_tap_t *tap;
return ERROR_OK;
}
-static int handle_reset_config_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_reset_config_command)
{
int new_cfg = 0;
int mask = 0;
return ERROR_OK;
}
-static int handle_jtag_nsrst_delay_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_jtag_nsrst_delay_command)
{
if (argc > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
return ERROR_OK;
}
-static int handle_jtag_ntrst_delay_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_jtag_ntrst_delay_command)
{
if (argc > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
return ERROR_OK;
}
-static int handle_jtag_nsrst_assert_width_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_jtag_nsrst_assert_width_command)
{
if (argc > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
return ERROR_OK;
}
-static int handle_jtag_ntrst_assert_width_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_jtag_ntrst_assert_width_command)
{
if (argc > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
return ERROR_OK;
}
-static int handle_jtag_khz_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_jtag_khz_command)
{
if (argc > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
return retval;
}
-static int handle_jtag_rclk_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_jtag_rclk_command)
{
if (argc > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
return retval;
}
-static int handle_jtag_reset_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_jtag_reset_command)
{
if (argc != 2)
return ERROR_COMMAND_SYNTAX_ERROR;
return jtag_execute_queue();
}
-static int handle_runtest_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_runtest_command)
{
if (argc != 1)
return ERROR_COMMAND_SYNTAX_ERROR;
}
-static int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_irscan_command)
{
int i;
scan_field_t *fields;
}
-static int handle_verify_ircapture_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_verify_ircapture_command)
{
if (argc > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
return ERROR_OK;
}
-static int handle_verify_jtag_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_verify_jtag_command)
{
if (argc > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
return ERROR_OK;
}
-static int handle_tms_sequence_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_tms_sequence_command)
{
if (argc > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
}
}
-static int vsllink_handle_mode_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(vsllink_handle_mode_command)
{
if (argc != 1) {
LOG_ERROR("parameter error, should be one parameter for VID");
return ERROR_OK;
}
-static int vsllink_handle_usb_vid_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(vsllink_handle_usb_vid_command)
{
if (argc != 1)
{
return ERROR_OK;
}
-static int vsllink_handle_usb_pid_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(vsllink_handle_usb_pid_command)
{
if (argc != 1)
{
return ERROR_OK;
}
-static int vsllink_handle_usb_bulkin_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(vsllink_handle_usb_bulkin_command)
{
if (argc != 1)
{
return ERROR_OK;
}
-static int vsllink_handle_usb_bulkout_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(vsllink_handle_usb_bulkout_command)
{
if (argc != 1)
{
return ERROR_OK;
}
-static int vsllink_handle_usb_interface_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(vsllink_handle_usb_interface_command)
{
if (argc != 1)
{
}
/* Give TELNET a way to find out what version this is */
-static int handle_version_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_version_command)
{
if (argc != 0)
return ERROR_COMMAND_SYNTAX_ERROR;
int ioutil_init(struct command_context_s *cmd_ctx);
/* OpenOCD can't really handle failure of this command. Patches welcome! :-) */
-static int handle_init_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_init_command)
{
if (argc != 0)
/* pld device <driver> [driver_options ...]
*/
-static int handle_pld_device_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_pld_device_command)
{
int i;
int found = 0;
return ERROR_OK;
}
-static int handle_pld_devices_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_pld_devices_command)
{
pld_device_t *p;
int i = 0;
return ERROR_OK;
}
-static int handle_pld_load_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_pld_load_command)
{
int retval;
struct timeval start, end, duration;
return ERROR_OK;
}
-static int virtex2_handle_read_stat_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(virtex2_handle_read_stat_command)
{
pld_device_t *device;
virtex2_pld_device_t *virtex2_info;
return ERROR_OK;
}
-static int handle_gdb_sync_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_gdb_sync_command)
{
if (argc != 0)
{
}
/* daemon configuration command gdb_port */
-static int handle_gdb_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_gdb_port_command)
{
return server_port_command(cmd_ctx, cmd, args, argc, &gdb_port);
}
-static int handle_gdb_memory_map_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_gdb_memory_map_command)
{
if (argc == 1)
{
return ERROR_COMMAND_SYNTAX_ERROR;
}
-static int handle_gdb_flash_program_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_gdb_flash_program_command)
{
if (argc == 1)
{
return ERROR_COMMAND_SYNTAX_ERROR;
}
-static int handle_gdb_report_data_abort_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_gdb_report_data_abort_command)
{
if (argc == 1)
{
}
/* gdb_breakpoint_override */
-static int handle_gdb_breakpoint_override_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_gdb_breakpoint_override_command)
{
if (argc == 0)
{
}
/* tell the server we want to shut down */
-static int handle_shutdown_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_shutdown_command)
{
shutdown_openocd = 1;
return retval;
}
-static int handle_tcl_port_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_tcl_port_command)
{
return server_port_command(cmd_ctx, cmd, args, argc, &tcl_port);
}
}
/* daemon configuration command telnet_port */
-static int handle_telnet_port_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_telnet_port_command)
{
return server_port_command(cmd_ctx, cmd, args, argc, &telnet_port);
}
-static int handle_exit_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_exit_command)
{
return ERROR_COMMAND_CLOSE_CONNECTION;
}
return ERROR_FAIL;
}
-static int handle_svf_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_svf_command)
{
#define SVF_NUM_OF_OPTIONS 1
int command_num = 0, i;
}
#define BOOL_WRAPPER(name, print_name) \
-static int arm11_handle_bool_##name(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) \
+COMMAND_HANDLER(arm11_handle_bool_##name) \
{ \
return arm11_handle_bool(cmd_ctx, cmd, args, argc, &arm11_config_##name, print_name); \
}
BOOL_WRAPPER(step_irq_enable, "IRQs while stepping")
BOOL_WRAPPER(hardware_step, "hardware single step")
-static int arm11_handle_vcr(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm11_handle_vcr)
{
switch (argc) {
case 0:
return ERROR_OK;
}
-int arm11_handle_etmr(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm11_handle_etmr)
{
return arm11_handle_etm_read_write(cmd_ctx, cmd, args, argc, true);
}
-int arm11_handle_etmw(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm11_handle_etmw)
{
return arm11_handle_etm_read_write(cmd_ctx, cmd, args, argc, false);
}
-
#define ARM11_HANDLER(x) .x = arm11_##x
target_type_t arm11_target = {
return arm720t_init_arch_info(target, arm720t, target->tap);
}
-static int arm720t_handle_cp15_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm720t_handle_cp15_command)
{
int retval;
target_t *target = get_current_target(cmd_ctx);
return ERROR_OK;
}
-int handle_arm7_9_write_xpsr_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_arm7_9_write_xpsr_command)
{
uint32_t value;
int spsr;
return ERROR_OK;
}
-int handle_arm7_9_write_xpsr_im8_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_arm7_9_write_xpsr_im8_command)
{
uint32_t value;
int rotate;
return ERROR_OK;
}
-int handle_arm7_9_write_core_reg_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_arm7_9_write_core_reg_command)
{
uint32_t value;
uint32_t mode;
return arm7_9_write_core_reg(target, num, mode, value);
}
-int handle_arm7_9_dbgrq_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_arm7_9_dbgrq_command)
{
target_t *target = get_current_target(cmd_ctx);
armv4_5_common_t *armv4_5;
return ERROR_OK;
}
-int handle_arm7_9_fast_memory_access_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_arm7_9_fast_memory_access_command)
{
target_t *target = get_current_target(cmd_ctx);
armv4_5_common_t *armv4_5;
return ERROR_OK;
}
-int handle_arm7_9_dcc_downloads_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_arm7_9_dcc_downloads_command)
{
target_t *target = get_current_target(cmd_ctx);
armv4_5_common_t *armv4_5;
return arm920t_init_arch_info(target, arm920t, target->tap);
}
-static int arm920t_handle_read_cache_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm920t_handle_read_cache_command)
{
int retval = ERROR_OK;
target_t *target = get_current_target(cmd_ctx);
return ERROR_OK;
}
-static int arm920t_handle_read_mmu_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm920t_handle_read_mmu_command)
{
int retval = ERROR_OK;
target_t *target = get_current_target(cmd_ctx);
return ERROR_OK;
}
-static int arm920t_handle_cp15_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm920t_handle_cp15_command)
{
int retval;
target_t *target = get_current_target(cmd_ctx);
return ERROR_OK;
}
-static int arm920t_handle_cp15i_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm920t_handle_cp15i_command)
{
int retval;
target_t *target = get_current_target(cmd_ctx);
return ERROR_OK;
}
-static int arm920t_handle_cache_info_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm920t_handle_cache_info_command)
{
int retval;
target_t *target = get_current_target(cmd_ctx);
return arm926ejs_init_arch_info(target, arm926ejs, target->tap);
}
-static int arm926ejs_handle_cp15_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm926ejs_handle_cp15_command)
{
int retval;
target_t *target = get_current_target(cmd_ctx);
return ERROR_OK;
}
-static int
-arm926ejs_handle_cache_info_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm926ejs_handle_cache_info_command)
{
int retval;
target_t *target = get_current_target(cmd_ctx);
return ERROR_OK;
}
-static int arm966e_handle_cp15_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(arm966e_handle_cp15_command)
{
int retval;
target_t *target = get_current_target(cmd_ctx);
return ERROR_OK;
}
-static int handle_arm9tdmi_catch_vectors_command(
- struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_arm9tdmi_catch_vectors_command)
{
target_t *target = get_current_target(cmd_ctx);
struct arm7_9_common_s *arm7_9 = target_to_arm7_9(target);
return ERROR_OK;
}
-int handle_armv4_5_reg_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_armv4_5_reg_command)
{
char output[128];
int output_len;
return ERROR_OK;
}
-int handle_armv4_5_core_state_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_armv4_5_core_state_command)
{
target_t *target = get_current_target(cmd_ctx);
struct armv4_5_common_s *armv4_5 = target_to_armv4_5(target);
return ERROR_OK;
}
-static int
-handle_armv4_5_disassemble_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_armv4_5_disassemble_command)
{
int retval = ERROR_OK;
target_t *target = get_current_target(cmd_ctx);
}
-static int handle_dap_baseaddr_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_dap_baseaddr_command)
{
target_t *target = get_current_target(cmd_ctx);
struct armv7a_common_s *armv7a = target_to_armv7a(target);
return dap_baseaddr_command(cmd_ctx, swjdp, args, argc);
}
-static int handle_dap_memaccess_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_dap_memaccess_command)
{
target_t *target = get_current_target(cmd_ctx);
struct armv7a_common_s *armv7a = target_to_armv7a(target);
return dap_memaccess_command(cmd_ctx, swjdp, args, argc);
}
-static int handle_dap_apsel_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_dap_apsel_command)
{
target_t *target = get_current_target(cmd_ctx);
struct armv7a_common_s *armv7a = target_to_armv7a(target);
return dap_apsel_command(cmd_ctx, swjdp, args, argc);
}
-static int handle_dap_apid_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_dap_apid_command)
{
target_t *target = get_current_target(cmd_ctx);
struct armv7a_common_s *armv7a = target_to_armv7a(target);
return dap_apid_command(cmd_ctx, swjdp, args, argc);
}
-static int handle_dap_info_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_dap_info_command)
{
target_t *target = get_current_target(cmd_ctx);
struct armv7a_common_s *armv7a = target_to_armv7a(target);
return dap_info_command(cmd_ctx, swjdp, apsel);
}
-static int
-handle_armv7a_disassemble_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_armv7a_disassemble_command)
{
target_t *target = get_current_target(cmd_ctx);
struct armv4_5_common_s *armv4_5 = target_to_armv4_5(target);
* Return the debug ap baseaddress in hexadecimal;
* no extra output to simplify script processing
*/
-static int handle_dap_baseaddr_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_dap_baseaddr_command)
{
target_t *target = get_current_target(cmd_ctx);
struct armv7m_common_s *armv7m = target_to_armv7m(target);
* Return the debug ap id in hexadecimal;
* no extra output to simplify script processing
*/
-static int handle_dap_apid_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_dap_apid_command)
{
target_t *target = get_current_target(cmd_ctx);
struct armv7m_common_s *armv7m = target_to_armv7m(target);
return dap_apid_command(cmd_ctx, swjdp, args, argc);
}
-static int handle_dap_apsel_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_dap_apsel_command)
{
target_t *target = get_current_target(cmd_ctx);
struct armv7m_common_s *armv7m = target_to_armv7m(target);
return dap_apsel_command(cmd_ctx, swjdp, args, argc);
}
-static int handle_dap_memaccess_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_dap_memaccess_command)
{
target_t *target = get_current_target(cmd_ctx);
struct armv7m_common_s *armv7m = target_to_armv7m(target);
}
-static int handle_dap_info_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_dap_info_command)
{
target_t *target = get_current_target(cmd_ctx);
struct armv7m_common_s *armv7m = target_to_armv7m(target);
return ERROR_OK;
}
-static int cortex_a8_handle_cache_info_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(cortex_a8_handle_cache_info_command)
{
target_t *target = get_current_target(cmd_ctx);
struct armv7a_common_s *armv7a = target_to_armv7a(target);
}
-static int cortex_a8_handle_dbginit_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(cortex_a8_handle_dbginit_command)
{
target_t *target = get_current_target(cmd_ctx);
* that *only* Thumb2 disassembly matters. There are also some small
* additions to Thumb2 that are specific to ARMv7-M.
*/
-static int
-handle_cortex_m3_disassemble_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_cortex_m3_disassemble_command)
{
int retval;
target_t *target = get_current_target(cmd_ctx);
{ "reset", VC_CORERESET, },
};
-static int
-handle_cortex_m3_vector_catch_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_cortex_m3_vector_catch_command)
{
target_t *target = get_current_target(cmd_ctx);
struct cortex_m3_common_s *cortex_m3 = target_to_cm3(target);
return ERROR_OK;
}
-static int
-handle_cortex_m3_mask_interrupts_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_cortex_m3_mask_interrupts_command)
{
target_t *target = get_current_target(cmd_ctx);
struct cortex_m3_common_s *cortex_m3 = target_to_cm3(target);
return ERROR_OK;
}
-static int handle_etb_config_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etb_config_command)
{
target_t *target;
jtag_tap_t *tap;
return ERROR_OK;
}
-static int handle_etm_tracemode_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_tracemode_command)
{
target_t *target = get_current_target(cmd_ctx);
struct arm *arm = target_to_arm(target);
return ERROR_OK;
}
-static int handle_etm_config_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_config_command)
{
target_t *target;
struct arm *arm;
return etm_register_user_commands(cmd_ctx);
}
-static int handle_etm_info_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_info_command)
{
target_t *target;
struct arm *arm;
return ERROR_OK;
}
-static int handle_etm_status_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_status_command)
{
target_t *target;
struct arm *arm;
return ERROR_OK;
}
-static int handle_etm_image_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_image_command)
{
target_t *target;
struct arm *arm;
return ERROR_OK;
}
-static int handle_etm_dump_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_dump_command)
{
fileio_t file;
target_t *target;
return ERROR_OK;
}
-static int handle_etm_load_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_load_command)
{
fileio_t file;
target_t *target;
return ERROR_OK;
}
-static int handle_etm_trigger_percent_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_trigger_percent_command)
{
target_t *target;
struct arm *arm;
return ERROR_OK;
}
-static int handle_etm_start_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_start_command)
{
target_t *target;
struct arm *arm;
return ERROR_OK;
}
-static int handle_etm_stop_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_stop_command)
{
target_t *target;
struct arm *arm;
return ERROR_OK;
}
-static int handle_etm_analyze_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_analyze_command)
{
target_t *target;
struct arm *arm;
#include "etm_dummy.h"
-static int handle_etm_dummy_config_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_etm_dummy_config_command)
{
target_t *target;
struct arm *arm;
.read_trace = oocd_trace_read_trace,
};
-static int handle_oocd_trace_config_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_oocd_trace_config_command)
{
target_t *target;
struct arm *arm;
return ERROR_OK;
}
-static int handle_oocd_trace_status_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_oocd_trace_status_command)
{
target_t *target;
struct arm *arm;
return ERROR_OK;
}
-static int handle_oocd_trace_resync_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_oocd_trace_resync_command)
{
target_t *target;
struct arm *arm;
return retval;
}
-static int handle_targets_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_targets_command)
{
target_t *target = all_targets;
return retval;
}
-static int handle_reg_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_reg_command)
{
target_t *target;
reg_t *reg = NULL;
return ERROR_OK;
}
-static int handle_poll_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_poll_command)
{
int retval = ERROR_OK;
target_t *target = get_current_target(cmd_ctx);
return retval;
}
-static int handle_wait_halt_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_wait_halt_command)
{
if (argc > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
return ERROR_OK;
}
-static int handle_halt_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_halt_command)
{
LOG_DEBUG("-");
return handle_wait_halt_command(cmd_ctx, cmd, args, argc);
}
-static int handle_soft_reset_halt_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_soft_reset_halt_command)
{
target_t *target = get_current_target(cmd_ctx);
return ERROR_OK;
}
-static int handle_reset_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_reset_command)
{
if (argc > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
}
-static int handle_resume_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_resume_command)
{
int current = 1;
if (argc > 1)
return target_resume(target, current, addr, 1, 0);
}
-static int handle_step_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_step_command)
{
if (argc > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
}
}
-static int handle_md_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_md_command)
{
if (argc < 1)
return ERROR_COMMAND_SYNTAX_ERROR;
return retval;
}
-static int handle_mw_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_mw_command)
{
if (argc < 2)
{
return ERROR_OK;
}
-static int handle_load_image_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_load_image_command)
{
uint8_t *buffer;
uint32_t buf_cnt;
}
-static int handle_dump_image_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_dump_image_command)
{
fileio_t fileio;
return retval;
}
-static int handle_verify_image_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_verify_image_command)
{
return handle_verify_image_command_internal(cmd_ctx, cmd, args, argc, 1);
}
-static int handle_test_image_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_test_image_command)
{
return handle_verify_image_command_internal(cmd_ctx, cmd, args, argc, 0);
}
return retval;
}
-static int handle_bp_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_bp_command)
{
if (argc == 0)
return handle_bp_command_list(cmd_ctx);
return handle_bp_command_set(cmd_ctx, addr, length, hw);
}
-static int handle_rbp_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_rbp_command)
{
if (argc != 1)
return ERROR_COMMAND_SYNTAX_ERROR;
return ERROR_OK;
}
-static int handle_wp_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_wp_command)
{
target_t *target = get_current_target(cmd_ctx);
return retval;
}
-static int handle_rwp_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_rwp_command)
{
if (argc != 1)
return ERROR_COMMAND_SYNTAX_ERROR;
* The low-level target implementation must have logged a detailed error
* which is forwarded to telnet/GDB session.
*/
-static int handle_virt2phys_command(command_context_t *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_virt2phys_command)
{
if (argc != 1)
return ERROR_COMMAND_SYNTAX_ERROR;
}
/* profiling samples the CPU PC as quickly as OpenOCD is able, which will be used as a random sampling of PC */
-static int handle_profile_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_profile_command)
{
target_t *target = get_current_target(cmd_ctx);
struct timeval timeout, now;
-static int handle_fast_load_image_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_fast_load_image_command)
{
uint8_t *buffer;
uint32_t buf_cnt;
return retval;
}
-static int handle_fast_load_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_fast_load_command)
{
if (argc > 0)
return ERROR_COMMAND_SYNTAX_ERROR;
return ERROR_OK;
}
-static int handle_target_request_debugmsgs_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_target_request_debugmsgs_command)
{
target_t *target = get_current_target(cmd_ctx);
return ERROR_OK;
}
-static int handle_trace_point_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_trace_point_command)
{
target_t *target = get_current_target(cmd_ctx);
trace_t *trace = target->trace_info;
return ERROR_OK;
}
-static int handle_trace_history_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_trace_history_command)
{
target_t *target = get_current_target(cmd_ctx);
trace_t *trace = target->trace_info;
target->variant);
}
-static int
-xscale_handle_debug_handler_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_debug_handler_command)
{
target_t *target = NULL;
xscale_common_t *xscale;
return ERROR_OK;
}
-static int
-xscale_handle_cache_clean_address_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_cache_clean_address_command)
{
target_t *target = NULL;
xscale_common_t *xscale;
return ERROR_OK;
}
-static int
-xscale_handle_cache_info_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_cache_info_command)
{
target_t *target = get_current_target(cmd_ctx);
struct xscale_common_s *xscale = target_to_xscale(target);
return ERROR_OK;
}
-static int xscale_handle_mmu_command(command_context_t *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_mmu_command)
{
target_t *target = get_current_target(cmd_ctx);
struct xscale_common_s *xscale = target_to_xscale(target);
return ERROR_OK;
}
-static int xscale_handle_idcache_command(command_context_t *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_idcache_command)
{
target_t *target = get_current_target(cmd_ctx);
struct xscale_common_s *xscale = target_to_xscale(target);
return ERROR_OK;
}
-static int xscale_handle_vector_catch_command(command_context_t *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_vector_catch_command)
{
target_t *target = get_current_target(cmd_ctx);
struct xscale_common_s *xscale = target_to_xscale(target);
}
-static int xscale_handle_vector_table_command(command_context_t *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_vector_table_command)
{
target_t *target = get_current_target(cmd_ctx);
struct xscale_common_s *xscale = target_to_xscale(target);
}
-static int
-xscale_handle_trace_buffer_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_trace_buffer_command)
{
target_t *target = get_current_target(cmd_ctx);
struct xscale_common_s *xscale = target_to_xscale(target);
return ERROR_OK;
}
-static int
-xscale_handle_trace_image_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_trace_image_command)
{
target_t *target = get_current_target(cmd_ctx);
struct xscale_common_s *xscale = target_to_xscale(target);
return ERROR_OK;
}
-static int xscale_handle_dump_trace_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_dump_trace_command)
{
target_t *target = get_current_target(cmd_ctx);
struct xscale_common_s *xscale = target_to_xscale(target);
return ERROR_OK;
}
-static int
-xscale_handle_analyze_trace_buffer_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_analyze_trace_buffer_command)
{
target_t *target = get_current_target(cmd_ctx);
struct xscale_common_s *xscale = target_to_xscale(target);
return ERROR_OK;
}
-static int xscale_handle_cp15(command_context_t *cmd_ctx,
- char *cmd, char **args, int argc)
+COMMAND_HANDLER(xscale_handle_cp15)
{
target_t *target = get_current_target(cmd_ctx);
struct xscale_common_s *xscale = target_to_xscale(target);
}
-static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_xsvf_command)
{
uint8_t *dr_out_buf = NULL; /* from host to device (TDI) */
uint8_t *dr_in_buf = NULL; /* from device to host (TDO) */