command_context_t -> struct command_context
Remove misleading typedef and redundant suffix from struct command_context.
This commit is contained in:
parent
d16968e24f
commit
98723c4ecd
|
@ -229,7 +229,7 @@ void reboot_port(void)
|
|||
cyg_thread_resume(zylinjtag_reboot_port_thread_handle);
|
||||
}
|
||||
|
||||
int configuration_output_handler(struct command_context_s *context,
|
||||
int configuration_output_handler(struct command_context *context,
|
||||
const char* line)
|
||||
{
|
||||
diag_printf("%s", line);
|
||||
|
@ -237,7 +237,7 @@ int configuration_output_handler(struct command_context_s *context,
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int zy1000_configuration_output_handler_log(struct command_context_s *context,
|
||||
int zy1000_configuration_output_handler_log(struct command_context *context,
|
||||
const char* line)
|
||||
{
|
||||
LOG_USER_N("%s", line);
|
||||
|
@ -247,7 +247,7 @@ int zy1000_configuration_output_handler_log(struct command_context_s *context,
|
|||
|
||||
#ifdef CYGPKG_PROFILE_GPROF
|
||||
|
||||
int eCosBoard_handle_eCosBoard_profile_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
int eCosBoard_handle_eCosBoard_profile_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc)
|
||||
{
|
||||
command_print(cmd_ctx, "Profiling started");
|
||||
start_profile();
|
||||
|
@ -258,7 +258,7 @@ int eCosBoard_handle_eCosBoard_profile_command(struct command_context_s *cmd_ctx
|
|||
|
||||
externC void phi_init_all_network_interfaces(void);
|
||||
|
||||
command_context_t *cmd_ctx;
|
||||
struct command_context *cmd_ctx;
|
||||
|
||||
static bool webRunning = false;
|
||||
|
||||
|
@ -840,7 +840,7 @@ void startUart(void)
|
|||
cyg_thread_resume(zylinjtag_uart_thread_handle);
|
||||
}
|
||||
|
||||
int handle_uart_command(struct command_context_s *cmd_ctx, char *cmd,
|
||||
int handle_uart_command(struct command_context *cmd_ctx, char *cmd,
|
||||
char **args, int argc)
|
||||
{
|
||||
static int current_baud = 38400;
|
||||
|
@ -924,7 +924,7 @@ bool logAllToSerial = false;
|
|||
int boolParam(char *var);
|
||||
|
||||
|
||||
command_context_t *setup_command_handler(void);
|
||||
struct command_context *setup_command_handler(void);
|
||||
|
||||
static const char *zylin_config_dir="/config/settings";
|
||||
|
||||
|
@ -936,7 +936,7 @@ static int add_default_dirs(void)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int ioutil_init(struct command_context_s *cmd_ctx);
|
||||
int ioutil_init(struct command_context *cmd_ctx);
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
@ -1068,7 +1068,7 @@ int main(int argc, char *argv[])
|
|||
add_default_dirs();
|
||||
|
||||
/* initialize commandline interface */
|
||||
command_context_t * cmd_ctx;
|
||||
struct command_context * cmd_ctx;
|
||||
cmd_ctx = setup_command_handler();
|
||||
command_set_output_handler(cmd_ctx, configuration_output_handler, NULL);
|
||||
command_context_mode(cmd_ctx, COMMAND_CONFIG);
|
||||
|
|
|
@ -231,7 +231,7 @@ struct sam3_reg_list {
|
|||
static struct sam3_chip *all_sam3_chips;
|
||||
|
||||
static struct sam3_chip *
|
||||
get_current_sam3(struct command_context_s *cmd_ctx)
|
||||
get_current_sam3(struct command_context *cmd_ctx)
|
||||
{
|
||||
struct target *t;
|
||||
static struct sam3_chip *p;
|
||||
|
@ -2472,7 +2472,7 @@ COMMAND_HANDLER(sam3_handle_slowclk_command)
|
|||
|
||||
static int sam3_registered;
|
||||
static int
|
||||
sam3_register_commands(struct command_context_s *cmd_ctx)
|
||||
sam3_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
command_t *pCmd;
|
||||
|
||||
|
|
|
@ -1178,7 +1178,7 @@ COMMAND_HANDLER(at91sam7_handle_gpnvm_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int at91sam7_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int at91sam7_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
command_t *at91sam7_cmd = register_command(cmd_ctx, NULL, "at91sam7",
|
||||
NULL, COMMAND_ANY, NULL);
|
||||
|
|
|
@ -449,7 +449,7 @@ COMMAND_HANDLER(avrf_handle_mass_erase_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int avrf_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int avrf_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
command_t *avr_cmd = register_command(cmd_ctx, NULL, "avr",
|
||||
NULL, COMMAND_ANY, "avr flash specific commands");
|
||||
|
|
|
@ -588,7 +588,7 @@ static int cfi_intel_info(struct flash_bank *bank, char *buf, int buf_size)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int cfi_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int cfi_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
/*command_t *cfi_cmd = */
|
||||
register_command(cmd_ctx, NULL, "cfi", NULL, COMMAND_ANY, "flash bank cfi <base> <size> <chip_width> <bus_width> <targetNum> [jedec_probe/x16_as_x8]");
|
||||
|
|
|
@ -78,7 +78,7 @@ static int halted(struct target *target, const char *label)
|
|||
return false;
|
||||
}
|
||||
|
||||
static int davinci_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int davinci_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
static uint32_t ecosflash_get_flash_status(struct flash_bank *bank);
|
||||
static void ecosflash_set_flash_mode(struct flash_bank *bank,int mode);
|
||||
static uint32_t ecosflash_wait_status_busy(struct flash_bank *bank, uint32_t waitbits, int timeout);
|
||||
static int ecosflash_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
|
||||
static int ecosflash_handle_gpnvm_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc);
|
||||
#endif
|
||||
|
||||
struct ecosflash_flash_bank
|
||||
|
@ -334,7 +334,7 @@ static int ecosflash_probe(struct flash_bank *bank)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int ecosflash_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int ecosflash_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
register_command(cmd_ctx, NULL, "ecosflash", NULL, COMMAND_ANY, NULL);
|
||||
|
||||
|
@ -429,7 +429,7 @@ static uint32_t ecosflash_wait_status_busy(struct flash_bank *bank, uint32_t wai
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int ecosflash_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
static int ecosflash_handle_gpnvm_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc)
|
||||
{
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ FLASH_BANK_COMMAND_HANDLER(faux_flash_bank_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int faux_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int faux_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
|
|
@ -199,7 +199,7 @@ struct flash_bank *get_flash_bank_by_num(int num)
|
|||
}
|
||||
|
||||
int flash_command_get_bank_by_num(
|
||||
struct command_context_s *cmd_ctx, const char *str, struct flash_bank **bank)
|
||||
struct command_context *cmd_ctx, const char *str, struct flash_bank **bank)
|
||||
{
|
||||
unsigned bank_num;
|
||||
COMMAND_PARSE_NUMBER(uint, str, bank_num);
|
||||
|
@ -511,7 +511,7 @@ COMMAND_HANDLER(handle_flash_protect_check_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int flash_check_sector_parameters(struct command_context_s *cmd_ctx,
|
||||
static int flash_check_sector_parameters(struct command_context *cmd_ctx,
|
||||
uint32_t first, uint32_t last, uint32_t num_sectors)
|
||||
{
|
||||
if (!(first <= last)) {
|
||||
|
@ -1217,7 +1217,7 @@ int default_flash_blank_check(struct flash_bank *bank)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int flash_init_drivers(struct command_context_s *cmd_ctx)
|
||||
int flash_init_drivers(struct command_context *cmd_ctx)
|
||||
{
|
||||
register_jim(cmd_ctx, "ocd_flash_banks",
|
||||
jim_flash_banks, "return information about the flash banks");
|
||||
|
@ -1267,7 +1267,7 @@ int flash_init_drivers(struct command_context_s *cmd_ctx)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int flash_register_commands(struct command_context_s *cmd_ctx)
|
||||
int flash_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
flash_cmd = register_command(cmd_ctx, NULL, "flash",
|
||||
NULL, COMMAND_ANY, NULL);
|
||||
|
|
|
@ -97,7 +97,7 @@ struct flash_driver
|
|||
*
|
||||
* @returns ERROR_OK if successful; otherwise, an error code.
|
||||
*/
|
||||
int (*register_commands)(struct command_context_s *cmd_ctx);
|
||||
int (*register_commands)(struct command_context *cmd_ctx);
|
||||
|
||||
/**
|
||||
* Finish the "flash bank" command for @a bank. The
|
||||
|
@ -265,9 +265,9 @@ struct flash_bank
|
|||
};
|
||||
|
||||
/// Registers the 'flash' subsystem commands
|
||||
int flash_register_commands(struct command_context_s *cmd_ctx);
|
||||
int flash_register_commands(struct command_context *cmd_ctx);
|
||||
/// Initializes the 'flash' subsystem drivers
|
||||
int flash_init_drivers(struct command_context_s *cmd_ctx);
|
||||
int flash_init_drivers(struct command_context *cmd_ctx);
|
||||
|
||||
/**
|
||||
* Erases @a length bytes in the @a target flash, starting at @a addr.
|
||||
|
@ -323,7 +323,7 @@ struct flash_bank *get_flash_bank_by_num(int num);
|
|||
* @param bank On output, contians a pointer to the bank or NULL.
|
||||
* @returns ERROR_OK on success, or an error indicating the problem.
|
||||
*/
|
||||
int flash_command_get_bank_by_num(struct command_context_s *cmd_ctx,
|
||||
int flash_command_get_bank_by_num(struct command_context *cmd_ctx,
|
||||
const char *str, struct flash_bank **bank);
|
||||
/**
|
||||
* Returns the flash bank like get_flash_bank_by_num(), without probing.
|
||||
|
|
|
@ -776,7 +776,7 @@ COMMAND_HANDLER(lpc2000_handle_part_id_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int lpc2000_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int lpc2000_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
command_t *lpc2000_cmd = register_command(cmd_ctx, NULL, "lpc2000",
|
||||
NULL, COMMAND_ANY, NULL);
|
||||
|
|
|
@ -952,7 +952,7 @@ COMMAND_HANDLER(lpc2900_handle_secure_jtag_command)
|
|||
/**
|
||||
* Register private command handlers.
|
||||
*/
|
||||
static int lpc2900_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int lpc2900_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
command_t *lpc2900_cmd = register_command(cmd_ctx, NULL, "lpc2900",
|
||||
NULL, COMMAND_ANY, NULL);
|
||||
|
|
|
@ -873,7 +873,7 @@ COMMAND_HANDLER(handle_lpc3180_select_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int lpc3180_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int lpc3180_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
command_t *lpc3180_cmd = register_command(cmd_ctx, NULL, "lpc3180", NULL, COMMAND_ANY, "commands specific to the LPC3180 NAND flash controllers");
|
||||
|
||||
|
|
|
@ -1265,7 +1265,7 @@ COMMAND_HANDLER(mg_config_cmd)
|
|||
}
|
||||
}
|
||||
|
||||
int mflash_init_drivers(struct command_context_s *cmd_ctx)
|
||||
int mflash_init_drivers(struct command_context *cmd_ctx)
|
||||
{
|
||||
if (mflash_bank) {
|
||||
register_command(cmd_ctx, mflash_cmd, "probe", mg_probe_cmd, COMMAND_EXEC, NULL);
|
||||
|
@ -1320,7 +1320,7 @@ COMMAND_HANDLER(mg_bank_cmd)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int mflash_register_commands(struct command_context_s *cmd_ctx)
|
||||
int mflash_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
mflash_cmd = register_command(cmd_ctx, NULL, "mflash", NULL, COMMAND_ANY, NULL);
|
||||
register_command(cmd_ctx, mflash_cmd, "bank", mg_bank_cmd, COMMAND_CONFIG,
|
||||
|
|
|
@ -141,8 +141,8 @@ struct mflash_bank
|
|||
struct mg_drv_info *drv_info;
|
||||
};
|
||||
|
||||
int mflash_register_commands(struct command_context_s *cmd_ctx);
|
||||
int mflash_init_drivers(struct command_context_s *cmd_ctx);
|
||||
int mflash_register_commands(struct command_context *cmd_ctx);
|
||||
int mflash_init_drivers(struct command_context *cmd_ctx);
|
||||
|
||||
#define MG_MFLASH_SECTOR_SIZE (0x200) /* 512Bytes = 2^9 */
|
||||
#define MG_MFLASH_SECTOR_SIZE_MASK (0x200-1)
|
||||
|
|
|
@ -315,7 +315,7 @@ static int imx31_nand_ready (struct nand_device *nand, int timeout)
|
|||
return imx31_controller_ready (nand, timeout);
|
||||
}
|
||||
|
||||
static int imx31_register_commands (struct command_context_s *cmd_ctx)
|
||||
static int imx31_register_commands (struct command_context *cmd_ctx)
|
||||
{
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
|
|
@ -279,7 +279,7 @@ COMMAND_HANDLER(handle_nand_device_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int nand_register_commands(struct command_context_s *cmd_ctx)
|
||||
int nand_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
nand_cmd = register_command(cmd_ctx, NULL, "nand", NULL, COMMAND_ANY, "NAND specific commands");
|
||||
|
||||
|
@ -304,7 +304,7 @@ struct nand_device *get_nand_device_by_num(int num)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
int nand_command_get_device_by_num(struct command_context_s *cmd_ctx,
|
||||
int nand_command_get_device_by_num(struct command_context *cmd_ctx,
|
||||
const char *str, struct nand_device **nand)
|
||||
{
|
||||
unsigned num;
|
||||
|
@ -1602,7 +1602,7 @@ COMMAND_HANDLER(handle_nand_raw_access_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int nand_init(struct command_context_s *cmd_ctx)
|
||||
int nand_init(struct command_context *cmd_ctx)
|
||||
{
|
||||
if (!nand_devices)
|
||||
return ERROR_OK;
|
||||
|
|
|
@ -36,7 +36,7 @@ struct nand_flash_controller
|
|||
{
|
||||
char *name;
|
||||
__NAND_DEVICE_COMMAND((*nand_device_command));
|
||||
int (*register_commands)(struct command_context_s *cmd_ctx);
|
||||
int (*register_commands)(struct command_context *cmd_ctx);
|
||||
int (*init)(struct nand_device *nand);
|
||||
int (*reset)(struct nand_device *nand);
|
||||
int (*command)(struct nand_device *nand, uint8_t command);
|
||||
|
@ -226,11 +226,11 @@ int nand_calculate_ecc(struct nand_device *nand,
|
|||
int nand_calculate_ecc_kw(struct nand_device *nand,
|
||||
const uint8_t *dat, uint8_t *ecc_code);
|
||||
|
||||
int nand_register_commands(struct command_context_s *cmd_ctx);
|
||||
int nand_init(struct command_context_s *cmd_ctx);
|
||||
int nand_register_commands(struct command_context *cmd_ctx);
|
||||
int nand_init(struct command_context *cmd_ctx);
|
||||
|
||||
/// helper for parsing a nand device command argument string
|
||||
int nand_command_get_device_by_num(struct command_context_s *cmd_ctx,
|
||||
int nand_command_get_device_by_num(struct command_context *cmd_ctx,
|
||||
const char *str, struct nand_device **nand);
|
||||
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@ static int orion_nand_controller_ready(struct nand_device *nand, int timeout)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int orion_nand_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int orion_nand_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
|
|
@ -883,7 +883,7 @@ COMMAND_HANDLER(pic32mx_handle_pgm_word_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int pic32mx_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int pic32mx_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
command_t *pic32mx_cmd = register_command(cmd_ctx, NULL, "pic32mx",
|
||||
NULL, COMMAND_ANY, "pic32mx flash specific commands");
|
||||
|
|
|
@ -52,7 +52,7 @@ S3C24XX_DEVICE_COMMAND()
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int s3c24xx_register_commands(struct command_context_s *cmd_ctx)
|
||||
int s3c24xx_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ S3C24XX_DEVICE_COMMAND();
|
|||
return retval; \
|
||||
} while (0)
|
||||
|
||||
int s3c24xx_register_commands(struct command_context_s *cmd_ctx);
|
||||
int s3c24xx_register_commands(struct command_context *cmd_ctx);
|
||||
|
||||
int s3c24xx_reset(struct nand_device *nand);
|
||||
|
||||
|
|
|
@ -1160,7 +1160,7 @@ COMMAND_HANDLER(stellaris_handle_mass_erase_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int stellaris_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int stellaris_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
command_t *stm32x_cmd = register_command(cmd_ctx, NULL, "stellaris",
|
||||
NULL, COMMAND_ANY, "stellaris flash specific commands");
|
||||
|
|
|
@ -1181,7 +1181,7 @@ COMMAND_HANDLER(stm32x_handle_mass_erase_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int stm32x_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int stm32x_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
command_t *stm32x_cmd = register_command(cmd_ctx, NULL, "stm32x",
|
||||
NULL, COMMAND_ANY, "stm32x flash specific commands");
|
||||
|
|
|
@ -671,7 +671,7 @@ COMMAND_HANDLER(str7x_handle_disable_jtag_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int str7x_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int str7x_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
command_t *str7x_cmd = register_command(cmd_ctx, NULL, "str7x",
|
||||
NULL, COMMAND_ANY, "str7x flash specific commands");
|
||||
|
|
|
@ -675,7 +675,7 @@ COMMAND_HANDLER(str9x_handle_flash_config_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int str9x_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int str9x_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
command_t *str9x_cmd = register_command(cmd_ctx, NULL, "str9x",
|
||||
NULL, COMMAND_ANY, "str9x flash commands");
|
||||
|
|
|
@ -1163,7 +1163,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_disable_turbo_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int str9xpec_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int str9xpec_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
command_t *str9xpec_cmd = register_command(cmd_ctx, NULL, "str9xpec",
|
||||
NULL, COMMAND_ANY, "str9xpec flash specific commands");
|
||||
|
|
|
@ -817,7 +817,7 @@ static int tms470_erase_sector(struct flash_bank *bank, int sector)
|
|||
Implementation of Flash Driver Interfaces
|
||||
---------------------------------------------------------------------- */
|
||||
|
||||
static int tms470_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int tms470_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
command_t *tms470_cmd = register_command(cmd_ctx, NULL, "tms470", NULL, COMMAND_ANY, "applies to TI tms470 family");
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ COMMAND_HANDLER(handle_hello_command)
|
|||
return retval;
|
||||
}
|
||||
|
||||
int hello_register_commands(struct command_context_s *cmd_ctx)
|
||||
int hello_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
struct command_s *cmd = register_command(cmd_ctx, NULL, "hello",
|
||||
&handle_hello_command, COMMAND_ANY,
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
int fast_and_dangerous = 0;
|
||||
Jim_Interp *interp = NULL;
|
||||
|
||||
static int run_command(command_context_t *context,
|
||||
static int run_command(struct command_context *context,
|
||||
command_t *c, const char *words[], unsigned num_words);
|
||||
|
||||
static void tcl_output(void *privData, const char *file, unsigned line,
|
||||
|
@ -57,7 +57,7 @@ static void tcl_output(void *privData, const char *file, unsigned line,
|
|||
Jim_AppendString(interp, tclOutput, string, strlen(string));
|
||||
}
|
||||
|
||||
extern command_context_t *global_cmd_ctx;
|
||||
extern struct command_context *global_cmd_ctx;
|
||||
|
||||
void script_debug(Jim_Interp *interp, const char *name,
|
||||
unsigned argc, Jim_Obj *const *argv)
|
||||
|
@ -80,7 +80,7 @@ static int script_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
|
|||
{
|
||||
/* the private data is stashed in the interp structure */
|
||||
command_t *c;
|
||||
command_context_t *context;
|
||||
struct command_context *context;
|
||||
int retval;
|
||||
int i;
|
||||
int nwords;
|
||||
|
@ -226,7 +226,7 @@ static void command_add_child(struct command_s **head, struct command_s *c)
|
|||
cc->next = c;
|
||||
}
|
||||
|
||||
command_t* register_command(command_context_t *context,
|
||||
command_t* register_command(struct command_context *context,
|
||||
command_t *parent, char *name, command_handler_t handler,
|
||||
enum command_mode mode, char *help)
|
||||
{
|
||||
|
@ -274,7 +274,7 @@ command_t* register_command(command_context_t *context,
|
|||
return c;
|
||||
}
|
||||
|
||||
int unregister_all_commands(command_context_t *context)
|
||||
int unregister_all_commands(struct command_context *context)
|
||||
{
|
||||
command_t *c, *c2;
|
||||
|
||||
|
@ -306,7 +306,7 @@ int unregister_all_commands(command_context_t *context)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int unregister_command(command_context_t *context, char *name)
|
||||
int unregister_command(struct command_context *context, char *name)
|
||||
{
|
||||
command_t *c, *p = NULL, *c2;
|
||||
|
||||
|
@ -358,14 +358,14 @@ int unregister_command(command_context_t *context, char *name)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
void command_output_text(command_context_t *context, const char *data)
|
||||
void command_output_text(struct command_context *context, const char *data)
|
||||
{
|
||||
if (context && context->output_handler && data) {
|
||||
context->output_handler(context, data);
|
||||
}
|
||||
}
|
||||
|
||||
void command_print_sameline(command_context_t *context, const char *format, ...)
|
||||
void command_print_sameline(struct command_context *context, const char *format, ...)
|
||||
{
|
||||
char *string;
|
||||
|
||||
|
@ -389,7 +389,7 @@ void command_print_sameline(command_context_t *context, const char *format, ...)
|
|||
va_end(ap);
|
||||
}
|
||||
|
||||
void command_print(command_context_t *context, const char *format, ...)
|
||||
void command_print(struct command_context *context, const char *format, ...)
|
||||
{
|
||||
char *string;
|
||||
|
||||
|
@ -436,7 +436,7 @@ char *command_name(struct command_s *c, char delim)
|
|||
return __command_name(c, delim, 0);
|
||||
}
|
||||
|
||||
static int run_command(command_context_t *context,
|
||||
static int run_command(struct command_context *context,
|
||||
command_t *c, const char *words[], unsigned num_words)
|
||||
{
|
||||
int start_word = 0;
|
||||
|
@ -475,7 +475,7 @@ static int run_command(command_context_t *context,
|
|||
return retval;
|
||||
}
|
||||
|
||||
int command_run_line(command_context_t *context, char *line)
|
||||
int command_run_line(struct command_context *context, char *line)
|
||||
{
|
||||
/* all the parent commands have been registered with the interpreter
|
||||
* so, can just evaluate the line as a script and check for
|
||||
|
@ -545,7 +545,7 @@ int command_run_line(command_context_t *context, char *line)
|
|||
return retval;
|
||||
}
|
||||
|
||||
int command_run_linef(command_context_t *context, const char *format, ...)
|
||||
int command_run_linef(struct command_context *context, const char *format, ...)
|
||||
{
|
||||
int retval = ERROR_FAIL;
|
||||
char *string;
|
||||
|
@ -560,23 +560,23 @@ int command_run_linef(command_context_t *context, const char *format, ...)
|
|||
return retval;
|
||||
}
|
||||
|
||||
void command_set_output_handler(command_context_t* context,
|
||||
void command_set_output_handler(struct command_context* context,
|
||||
command_output_handler_t output_handler, void *priv)
|
||||
{
|
||||
context->output_handler = output_handler;
|
||||
context->output_handler_priv = priv;
|
||||
}
|
||||
|
||||
command_context_t* copy_command_context(command_context_t* context)
|
||||
struct command_context* copy_command_context(struct command_context* context)
|
||||
{
|
||||
command_context_t* copy_context = malloc(sizeof(command_context_t));
|
||||
struct command_context* copy_context = malloc(sizeof(struct command_context));
|
||||
|
||||
*copy_context = *context;
|
||||
|
||||
return copy_context;
|
||||
}
|
||||
|
||||
int command_done(command_context_t *context)
|
||||
int command_done(struct command_context *context)
|
||||
{
|
||||
free(context);
|
||||
context = NULL;
|
||||
|
@ -764,9 +764,9 @@ COMMAND_HANDLER(handle_fast_command)
|
|||
}
|
||||
|
||||
|
||||
command_context_t* command_init()
|
||||
struct command_context* command_init()
|
||||
{
|
||||
command_context_t* context = malloc(sizeof(command_context_t));
|
||||
struct command_context* context = malloc(sizeof(struct command_context));
|
||||
extern const char startup_tcl[];
|
||||
const char *HostOs;
|
||||
|
||||
|
@ -846,7 +846,7 @@ command_context_t* command_init()
|
|||
return context;
|
||||
}
|
||||
|
||||
int command_context_mode(command_context_t *cmd_ctx, enum command_mode mode)
|
||||
int command_context_mode(struct command_context *cmd_ctx, enum command_mode mode)
|
||||
{
|
||||
if (!cmd_ctx)
|
||||
return ERROR_INVALID_ARGUMENTS;
|
||||
|
@ -869,7 +869,7 @@ void process_jim_events(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
void register_jim(struct command_context_s *cmd_ctx, const char *name, int (*cmd)(Jim_Interp *interp, int argc, Jim_Obj *const *argv), const char *help)
|
||||
void register_jim(struct command_context *cmd_ctx, const char *name, int (*cmd)(Jim_Interp *interp, int argc, Jim_Obj *const *argv), const char *help)
|
||||
{
|
||||
Jim_CreateCommand(interp, name, cmd, NULL, NULL);
|
||||
|
||||
|
|
|
@ -51,13 +51,13 @@ enum command_mode
|
|||
COMMAND_ANY,
|
||||
};
|
||||
|
||||
struct command_context_s;
|
||||
struct command_context;
|
||||
|
||||
/// The type signature for command context's output handler.
|
||||
typedef int (*command_output_handler_t)(struct command_context_s *context,
|
||||
typedef int (*command_output_handler_t)(struct command_context *context,
|
||||
const char* line);
|
||||
|
||||
typedef struct command_context_s
|
||||
struct command_context
|
||||
{
|
||||
enum command_mode mode;
|
||||
struct command_s *commands;
|
||||
|
@ -78,7 +78,7 @@ typedef struct command_context_s
|
|||
*/
|
||||
command_output_handler_t output_handler;
|
||||
void *output_handler_priv;
|
||||
} command_context_t;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
|
@ -87,7 +87,7 @@ typedef struct command_context_s
|
|||
* defining all such derivative types using this macro.
|
||||
*/
|
||||
#define __COMMAND_HANDLER(name, extra...) \
|
||||
int name(struct command_context_s *cmd_ctx, \
|
||||
int name(struct command_context *cmd_ctx, \
|
||||
const char *args[], unsigned argc, ##extra)
|
||||
|
||||
/**
|
||||
|
@ -151,31 +151,31 @@ typedef struct command_s
|
|||
*/
|
||||
char *command_name(struct command_s *c, char delim);
|
||||
|
||||
command_t* register_command(command_context_t *context,
|
||||
command_t* register_command(struct command_context *context,
|
||||
command_t *parent, char *name, command_handler_t handler,
|
||||
enum command_mode mode, char *help);
|
||||
|
||||
int unregister_command(command_context_t *context, char *name);
|
||||
int unregister_all_commands(command_context_t *context);
|
||||
int unregister_command(struct command_context *context, char *name);
|
||||
int unregister_all_commands(struct command_context *context);
|
||||
|
||||
void command_set_output_handler(command_context_t* context,
|
||||
void command_set_output_handler(struct command_context* context,
|
||||
command_output_handler_t output_handler, void *priv);
|
||||
|
||||
command_context_t* copy_command_context(command_context_t* context);
|
||||
struct command_context* copy_command_context(struct command_context* context);
|
||||
|
||||
int command_context_mode(command_context_t *context, enum command_mode mode);
|
||||
int command_context_mode(struct command_context *context, enum command_mode mode);
|
||||
|
||||
command_context_t* command_init(void);
|
||||
int command_done(command_context_t *context);
|
||||
struct command_context* command_init(void);
|
||||
int command_done(struct command_context *context);
|
||||
|
||||
void command_print(command_context_t *context, const char *format, ...)
|
||||
void command_print(struct command_context *context, const char *format, ...)
|
||||
__attribute__ ((format (PRINTF_ATTRIBUTE_FORMAT, 2, 3)));
|
||||
void command_print_sameline(command_context_t *context, const char *format, ...)
|
||||
void command_print_sameline(struct command_context *context, const char *format, ...)
|
||||
__attribute__ ((format (PRINTF_ATTRIBUTE_FORMAT, 2, 3)));
|
||||
int command_run_line(command_context_t *context, char *line);
|
||||
int command_run_linef(command_context_t *context, const char *format, ...)
|
||||
int command_run_line(struct command_context *context, char *line);
|
||||
int command_run_linef(struct command_context *context, const char *format, ...)
|
||||
__attribute__ ((format (PRINTF_ATTRIBUTE_FORMAT, 2, 3)));
|
||||
void command_output_text(command_context_t *context, const char *data);
|
||||
void command_output_text(struct command_context *context, const char *data);
|
||||
|
||||
void process_jim_events(void);
|
||||
|
||||
|
@ -190,7 +190,7 @@ extern int fast_and_dangerous;
|
|||
|
||||
extern Jim_Interp *interp;
|
||||
|
||||
void register_jim(command_context_t *context, const char *name, int (*cmd)(Jim_Interp *interp, int argc, Jim_Obj *const *argv), const char *help);
|
||||
void register_jim(struct command_context *context, const char *name, int (*cmd)(Jim_Interp *interp, int argc, Jim_Obj *const *argv), const char *help);
|
||||
|
||||
long jim_global_long(const char *variable);
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ FILE *open_file_from_path (char *file, char *mode)
|
|||
}
|
||||
}
|
||||
|
||||
int parse_config_file(struct command_context_s *cmd_ctx)
|
||||
int parse_config_file(struct command_context *cmd_ctx)
|
||||
{
|
||||
int retval;
|
||||
char **cfg;
|
||||
|
|
|
@ -25,15 +25,15 @@
|
|||
|
||||
#include "command.h"
|
||||
|
||||
int parse_cmdline_args(struct command_context_s *cmd_ctx,
|
||||
int parse_cmdline_args(struct command_context *cmd_ctx,
|
||||
int argc, char *argv[]);
|
||||
|
||||
int parse_config_file(struct command_context_s *cmd_ctx);
|
||||
int parse_config_file(struct command_context *cmd_ctx);
|
||||
void add_config_command(const char *cfg);
|
||||
|
||||
void add_script_search_dir(const char *dir);
|
||||
|
||||
int configuration_output_handler(struct command_context_s *cmd_ctx,
|
||||
int configuration_output_handler(struct command_context *cmd_ctx,
|
||||
const char *line);
|
||||
|
||||
FILE *open_file_from_path(char *file, char *mode);
|
||||
|
|
|
@ -645,7 +645,7 @@ static int zylinjtag_Jim_Command_mac(Jim_Interp *interp, int argc,
|
|||
|
||||
|
||||
|
||||
int ioutil_init(struct command_context_s *cmd_ctx)
|
||||
int ioutil_init(struct command_context *cmd_ctx)
|
||||
{
|
||||
register_command(cmd_ctx, NULL, "rm", handle_rm_command, COMMAND_ANY,
|
||||
"remove file");
|
||||
|
|
|
@ -317,7 +317,7 @@ COMMAND_HANDLER(handle_log_output_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int log_register_commands(struct command_context_s *cmd_ctx)
|
||||
int log_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
start = timeval_ms();
|
||||
register_command(cmd_ctx, NULL, "log_output", handle_log_output_command,
|
||||
|
@ -328,7 +328,7 @@ int log_register_commands(struct command_context_s *cmd_ctx)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int log_init(struct command_context_s *cmd_ctx)
|
||||
int log_init(struct command_context *cmd_ctx)
|
||||
{
|
||||
/* set defaults for daemon configuration, if not set by cmdline or cfgfile */
|
||||
if (debug_level == -1)
|
||||
|
@ -344,7 +344,7 @@ int log_init(struct command_context_s *cmd_ctx)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int set_log_output(struct command_context_s *cmd_ctx, FILE *output)
|
||||
int set_log_output(struct command_context *cmd_ctx, FILE *output)
|
||||
{
|
||||
log_output = output;
|
||||
return ERROR_OK;
|
||||
|
|
|
@ -66,10 +66,10 @@ void log_printf_lf(enum log_levels level, const char *file, int line,
|
|||
const char *function, const char *format, ...)
|
||||
__attribute__ ((format (PRINTF_ATTRIBUTE_FORMAT, 5, 6)));
|
||||
|
||||
int log_init(struct command_context_s *cmd_ctx);
|
||||
int set_log_output(struct command_context_s *cmd_ctx, FILE *output);
|
||||
int log_init(struct command_context *cmd_ctx);
|
||||
int set_log_output(struct command_context *cmd_ctx, FILE *output);
|
||||
|
||||
int log_register_commands(struct command_context_s *cmd_ctx);
|
||||
int log_register_commands(struct command_context *cmd_ctx);
|
||||
|
||||
void keep_alive(void);
|
||||
void kept_alive(void);
|
||||
|
|
|
@ -46,7 +46,7 @@ static struct option long_options[] =
|
|||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
int configuration_output_handler(struct command_context_s *context, const char* line)
|
||||
int configuration_output_handler(struct command_context *context, const char* line)
|
||||
{
|
||||
LOG_USER_N("%s", line);
|
||||
|
||||
|
@ -108,7 +108,7 @@ static void add_default_dirs(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
int parse_cmdline_args(struct command_context_s *cmd_ctx, int argc, char *argv[])
|
||||
int parse_cmdline_args(struct command_context *cmd_ctx, int argc, char *argv[])
|
||||
{
|
||||
int c;
|
||||
char command_buffer[128];
|
||||
|
|
|
@ -540,7 +540,7 @@ COMMAND_HANDLER(amt_jtagaccel_handle_rtck_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int amt_jtagaccel_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int amt_jtagaccel_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
register_command(cmd_ctx, NULL, "parport_port",
|
||||
amt_jtagaccel_handle_parport_port_command, COMMAND_CONFIG,
|
||||
|
|
|
@ -59,12 +59,12 @@ static uint8_t usb_out_buffer[ARMJTAGEW_OUT_BUFFER_SIZE];
|
|||
static int armjtagew_execute_queue(void);
|
||||
static int armjtagew_speed(int speed);
|
||||
static int armjtagew_khz(int khz, int *jtag_speed);
|
||||
static int armjtagew_register_commands(struct command_context_s *cmd_ctx);
|
||||
static int armjtagew_register_commands(struct command_context *cmd_ctx);
|
||||
static int armjtagew_init(void);
|
||||
static int armjtagew_quit(void);
|
||||
|
||||
/* CLI command handler functions */
|
||||
static int armjtagew_handle_armjtagew_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
|
||||
static int armjtagew_handle_armjtagew_info_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc);
|
||||
|
||||
/* Queue command functions */
|
||||
static void armjtagew_end_state(tap_state_t state);
|
||||
|
@ -240,7 +240,7 @@ static int armjtagew_khz(int khz, int *jtag_speed)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int armjtagew_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int armjtagew_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
register_command(cmd_ctx, NULL, "armjtagew_info", armjtagew_handle_armjtagew_info_command, COMMAND_EXEC,
|
||||
"query armjtagew info");
|
||||
|
@ -520,7 +520,7 @@ static int armjtagew_get_version_info(void)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int armjtagew_handle_armjtagew_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
static int armjtagew_handle_armjtagew_info_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc)
|
||||
{
|
||||
if (armjtagew_get_version_info() == ERROR_OK)
|
||||
{
|
||||
|
|
|
@ -118,7 +118,7 @@ static void at91rm9200_write(int tck, int tms, int tdi);
|
|||
static void at91rm9200_reset(int trst, int srst);
|
||||
|
||||
static int at91rm9200_speed(int speed);
|
||||
static int at91rm9200_register_commands(struct command_context_s *cmd_ctx);
|
||||
static int at91rm9200_register_commands(struct command_context *cmd_ctx);
|
||||
static int at91rm9200_init(void);
|
||||
static int at91rm9200_quit(void);
|
||||
|
||||
|
@ -185,7 +185,7 @@ static int at91rm9200_speed(int speed)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int at91rm9200_handle_device_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
static int at91rm9200_handle_device_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc)
|
||||
{
|
||||
if (argc == 0)
|
||||
return ERROR_OK;
|
||||
|
@ -200,7 +200,7 @@ static int at91rm9200_handle_device_command(struct command_context_s *cmd_ctx, c
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int at91rm9200_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int at91rm9200_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
register_command(cmd_ctx, NULL, "at91rm9200_device", at91rm9200_handle_device_command,
|
||||
COMMAND_CONFIG, NULL);
|
||||
|
|
|
@ -1334,7 +1334,7 @@ void jtag_tap_free(struct jtag_tap *tap)
|
|||
free(tap);
|
||||
}
|
||||
|
||||
int jtag_interface_init(struct command_context_s *cmd_ctx)
|
||||
int jtag_interface_init(struct command_context *cmd_ctx)
|
||||
{
|
||||
if (jtag)
|
||||
return ERROR_OK;
|
||||
|
@ -1375,7 +1375,7 @@ int jtag_interface_init(struct command_context_s *cmd_ctx)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int jtag_init_inner(struct command_context_s *cmd_ctx)
|
||||
int jtag_init_inner(struct command_context *cmd_ctx)
|
||||
{
|
||||
struct jtag_tap *tap;
|
||||
int retval;
|
||||
|
@ -1461,7 +1461,7 @@ int jtag_interface_quit(void)
|
|||
}
|
||||
|
||||
|
||||
int jtag_init_reset(struct command_context_s *cmd_ctx)
|
||||
int jtag_init_reset(struct command_context *cmd_ctx)
|
||||
{
|
||||
int retval;
|
||||
|
||||
|
@ -1515,7 +1515,7 @@ int jtag_init_reset(struct command_context_s *cmd_ctx)
|
|||
return jtag_init_inner(cmd_ctx);
|
||||
}
|
||||
|
||||
int jtag_init(struct command_context_s *cmd_ctx)
|
||||
int jtag_init(struct command_context *cmd_ctx)
|
||||
{
|
||||
int retval;
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ static uint32_t dummy_data;
|
|||
|
||||
|
||||
static int dummy_speed(int speed);
|
||||
static int dummy_register_commands(struct command_context_s *cmd_ctx);
|
||||
static int dummy_register_commands(struct command_context *cmd_ctx);
|
||||
static int dummy_init(void);
|
||||
static int dummy_quit(void);
|
||||
static int dummy_khz(int khz, int *jtag_speed);
|
||||
|
@ -161,7 +161,7 @@ static int dummy_speed(int speed)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int dummy_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int dummy_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ static void ep93xx_write(int tck, int tms, int tdi);
|
|||
static void ep93xx_reset(int trst, int srst);
|
||||
|
||||
static int ep93xx_speed(int speed);
|
||||
static int ep93xx_register_commands(struct command_context_s *cmd_ctx);
|
||||
static int ep93xx_register_commands(struct command_context *cmd_ctx);
|
||||
static int ep93xx_init(void);
|
||||
static int ep93xx_quit(void);
|
||||
|
||||
|
@ -122,7 +122,7 @@ static int ep93xx_speed(int speed)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int ep93xx_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int ep93xx_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
|
||||
return ERROR_OK;
|
||||
|
|
|
@ -3969,7 +3969,7 @@ static void ktlink_blink(void)
|
|||
buffer_write(high_direction);
|
||||
}
|
||||
|
||||
static int ft2232_register_commands(struct command_context_s* cmd_ctx)
|
||||
static int ft2232_register_commands(struct command_context* cmd_ctx)
|
||||
{
|
||||
register_command(cmd_ctx, NULL, "ft2232_device_desc",
|
||||
ft2232_handle_device_desc_command, COMMAND_CONFIG,
|
||||
|
|
|
@ -562,7 +562,7 @@ COMMAND_HANDLER(gw16012_handle_parport_port_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int gw16012_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int gw16012_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
register_command(cmd_ctx, NULL, "parport_port",
|
||||
gw16012_handle_parport_port_command, COMMAND_CONFIG,
|
||||
|
|
|
@ -207,7 +207,7 @@ struct jtag_interface {
|
|||
* @param cmd_ctx The context in which commands should be registered.
|
||||
* @returns ERROR_OK on success, or an error code on failure.
|
||||
*/
|
||||
int (*register_commands)(struct command_context_s* cmd_ctx);
|
||||
int (*register_commands)(struct command_context* cmd_ctx);
|
||||
|
||||
/**
|
||||
* Interface driver must initalize any resources and connect to a
|
||||
|
|
|
@ -87,13 +87,13 @@ static int jlink_execute_queue(void);
|
|||
static int jlink_speed(int speed);
|
||||
static int jlink_speed_div(int speed, int* khz);
|
||||
static int jlink_khz(int khz, int *jtag_speed);
|
||||
static int jlink_register_commands(struct command_context_s *cmd_ctx);
|
||||
static int jlink_register_commands(struct command_context *cmd_ctx);
|
||||
static int jlink_init(void);
|
||||
static int jlink_quit(void);
|
||||
|
||||
/* CLI command handler functions */
|
||||
static int jlink_handle_jlink_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
|
||||
static int jlink_handle_jlink_hw_jtag_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
|
||||
static int jlink_handle_jlink_info_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc);
|
||||
static int jlink_handle_jlink_hw_jtag_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc);
|
||||
|
||||
/* Queue command functions */
|
||||
static void jlink_end_state(tap_state_t state);
|
||||
|
@ -290,7 +290,7 @@ static int jlink_khz(int khz, int *jtag_speed)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int jlink_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int jlink_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
|
||||
register_command(cmd_ctx, NULL, "jlink_info",
|
||||
|
@ -630,7 +630,7 @@ static int jlink_get_version_info(void)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int jlink_handle_jlink_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
static int jlink_handle_jlink_info_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc)
|
||||
{
|
||||
if (jlink_get_version_info() == ERROR_OK)
|
||||
{
|
||||
|
@ -641,7 +641,7 @@ static int jlink_handle_jlink_info_command(struct command_context_s *cmd_ctx, ch
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int jlink_handle_jlink_hw_jtag_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
static int jlink_handle_jlink_hw_jtag_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc)
|
||||
{
|
||||
switch (argc) {
|
||||
case 0:
|
||||
|
|
|
@ -315,7 +315,7 @@ bool jtag_will_verify_capture_ir(void);
|
|||
* Initialize interface upon startup. Return a successful no-op upon
|
||||
* subsequent invocations.
|
||||
*/
|
||||
int jtag_interface_init(struct command_context_s* cmd_ctx);
|
||||
int jtag_interface_init(struct command_context* cmd_ctx);
|
||||
|
||||
/// Shutdown the JTAG interface upon program exit.
|
||||
int jtag_interface_quit(void);
|
||||
|
@ -324,12 +324,12 @@ int jtag_interface_quit(void);
|
|||
* Initialize JTAG chain using only a RESET reset. If init fails,
|
||||
* try reset + init.
|
||||
*/
|
||||
int jtag_init(struct command_context_s* cmd_ctx);
|
||||
int jtag_init(struct command_context* cmd_ctx);
|
||||
|
||||
/// reset, then initialize JTAG chain
|
||||
int jtag_init_reset(struct command_context_s* cmd_ctx);
|
||||
int jtag_register_commands(struct command_context_s* cmd_ctx);
|
||||
int jtag_init_inner(struct command_context_s *cmd_ctx);
|
||||
int jtag_init_reset(struct command_context* cmd_ctx);
|
||||
int jtag_register_commands(struct command_context* cmd_ctx);
|
||||
int jtag_init_inner(struct command_context *cmd_ctx);
|
||||
|
||||
/**
|
||||
* @file
|
||||
|
|
|
@ -485,7 +485,7 @@ COMMAND_HANDLER(parport_handle_parport_toggling_time_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int parport_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int parport_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
register_command(cmd_ctx, NULL, "parport_port",
|
||||
parport_handle_parport_port_command, COMMAND_CONFIG,
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
static int presto_jtag_speed(int speed);
|
||||
static int presto_jtag_khz(int khz, int *jtag_speed);
|
||||
static int presto_jtag_speed_div(int speed, int *khz);
|
||||
static int presto_jtag_register_commands(struct command_context_s *cmd_ctx);
|
||||
static int presto_jtag_register_commands(struct command_context *cmd_ctx);
|
||||
static int presto_jtag_init(void);
|
||||
static int presto_jtag_quit(void);
|
||||
|
||||
|
@ -766,7 +766,7 @@ COMMAND_HANDLER(presto_handle_serial_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int presto_jtag_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int presto_jtag_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
register_command(cmd_ctx, NULL, "presto_serial", presto_handle_serial_command,
|
||||
COMMAND_CONFIG, NULL);
|
||||
|
|
|
@ -1574,7 +1574,7 @@ int rlink_khz(
|
|||
static
|
||||
int
|
||||
handle_dtc_directory_command(
|
||||
struct command_context_s *cmd_ctx,
|
||||
struct command_context *cmd_ctx,
|
||||
char *cmd,
|
||||
char **args,
|
||||
int argc
|
||||
|
@ -1592,7 +1592,7 @@ handle_dtc_directory_command(
|
|||
|
||||
|
||||
static
|
||||
int rlink_register_commands(struct command_context_s *cmd_ctx)
|
||||
int rlink_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
|
||||
#ifdef _DEBUG_JTAG_IO_
|
||||
|
|
|
@ -373,7 +373,7 @@ static int jim_jtag_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
|
|||
int e;
|
||||
Jim_Nvp *n;
|
||||
Jim_Obj *o;
|
||||
struct command_context_s *context;
|
||||
struct command_context *context;
|
||||
|
||||
enum {
|
||||
JTAG_CMD_INTERFACE,
|
||||
|
@ -1416,7 +1416,7 @@ COMMAND_HANDLER(handle_tms_sequence_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int jtag_register_commands(struct command_context_s *cmd_ctx)
|
||||
int jtag_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
register_jim(cmd_ctx, "jtag", jim_jtag_command,
|
||||
"perform jtag tap actions");
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
|
||||
static int usbprog_execute_queue(void);
|
||||
static int usbprog_speed(int speed);
|
||||
static int usbprog_register_commands(struct command_context_s *cmd_ctx);
|
||||
static int usbprog_register_commands(struct command_context *cmd_ctx);
|
||||
static int usbprog_init(void);
|
||||
static int usbprog_quit(void);
|
||||
|
||||
|
@ -120,7 +120,7 @@ static int usbprog_speed(int speed)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int usbprog_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int usbprog_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
|
|
@ -1880,7 +1880,7 @@ static void vsllink_debug_buffer(uint8_t *buffer, int length)
|
|||
}
|
||||
#endif // _DEBUG_USB_COMMS_ || _DEBUG_JTAG_IO_
|
||||
|
||||
static int vsllink_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int vsllink_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
register_command(cmd_ctx, NULL, "vsllink_usb_vid",
|
||||
vsllink_handle_usb_vid_command, COMMAND_CONFIG,
|
||||
|
|
|
@ -40,12 +40,12 @@ void zy1000_reset(int trst, int srst);
|
|||
|
||||
|
||||
int zy1000_speed(int speed);
|
||||
int zy1000_register_commands(struct command_context_s *cmd_ctx);
|
||||
int zy1000_register_commands(struct command_context *cmd_ctx);
|
||||
int zy1000_init(void);
|
||||
int zy1000_quit(void);
|
||||
|
||||
/* interface commands */
|
||||
int zy1000_handle_zy1000_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
|
||||
int zy1000_handle_zy1000_port_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc);
|
||||
|
||||
static int zy1000_khz(int khz, int *jtag_speed)
|
||||
{
|
||||
|
@ -225,7 +225,7 @@ static void setPower(bool power)
|
|||
}
|
||||
}
|
||||
|
||||
int handle_power_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
int handle_power_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc)
|
||||
{
|
||||
if (argc > 1)
|
||||
{
|
||||
|
@ -354,7 +354,7 @@ zylinjtag_Jim_Command_powerstatus(Jim_Interp *interp,
|
|||
return JIM_OK;
|
||||
}
|
||||
|
||||
int zy1000_register_commands(struct command_context_s *cmd_ctx)
|
||||
int zy1000_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
register_command(cmd_ctx, NULL, "power", handle_power_command, COMMAND_ANY,
|
||||
"power <on/off> - turn power switch to target on/off. No arguments - print status.");
|
||||
|
|
|
@ -106,7 +106,7 @@ static int log_target_callback_event_handler(struct target *target, enum target_
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int ioutil_init(struct command_context_s *cmd_ctx);
|
||||
int ioutil_init(struct command_context *cmd_ctx);
|
||||
|
||||
/* OpenOCD can't really handle failure of this command. Patches welcome! :-) */
|
||||
COMMAND_HANDLER(handle_init_command)
|
||||
|
@ -175,15 +175,15 @@ COMMAND_HANDLER(handle_init_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
command_context_t *global_cmd_ctx;
|
||||
struct command_context *global_cmd_ctx;
|
||||
|
||||
/// src/hello.c gives a simple example for writing new command modules
|
||||
int hello_register_commands(struct command_context_s *cmd_ctx);
|
||||
int hello_register_commands(struct command_context *cmd_ctx);
|
||||
|
||||
/* NB! this fn can be invoked outside this file for non PC hosted builds */
|
||||
command_context_t *setup_command_handler(void)
|
||||
struct command_context *setup_command_handler(void)
|
||||
{
|
||||
command_context_t *cmd_ctx;
|
||||
struct command_context *cmd_ctx;
|
||||
|
||||
global_cmd_ctx = cmd_ctx = command_init();
|
||||
|
||||
|
@ -246,7 +246,7 @@ int openocd_main(int argc, char *argv[])
|
|||
int ret;
|
||||
|
||||
/* initialize commandline interface */
|
||||
command_context_t *cmd_ctx;
|
||||
struct command_context *cmd_ctx;
|
||||
|
||||
cmd_ctx = setup_command_handler();
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ COMMAND_HANDLER(handle_pld_load_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int pld_init(struct command_context_s *cmd_ctx)
|
||||
int pld_init(struct command_context *cmd_ctx)
|
||||
{
|
||||
if (!pld_devices)
|
||||
return ERROR_OK;
|
||||
|
@ -199,7 +199,7 @@ int pld_init(struct command_context_s *cmd_ctx)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int pld_register_commands(struct command_context_s *cmd_ctx)
|
||||
int pld_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
pld_cmd = register_command(cmd_ctx, NULL, "pld", NULL, COMMAND_ANY, "programmable logic device commands");
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ struct pld_driver
|
|||
{
|
||||
char *name;
|
||||
__PLD_DEVICE_COMMAND((*pld_device_command));
|
||||
int (*register_commands)(struct command_context_s *cmd_ctx);
|
||||
int (*register_commands)(struct command_context *cmd_ctx);
|
||||
int (*load)(struct pld_device *pld_device, const char *filename);
|
||||
};
|
||||
|
||||
|
@ -44,9 +44,9 @@ struct pld_device
|
|||
struct pld_device *next;
|
||||
};
|
||||
|
||||
int pld_register_commands(struct command_context_s *cmd_ctx);
|
||||
int pld_register_commands(struct command_context *cmd_ctx);
|
||||
|
||||
int pld_init(struct command_context_s *cmd_ctx);
|
||||
int pld_init(struct command_context *cmd_ctx);
|
||||
|
||||
struct pld_device *get_pld_device_by_num(int num);
|
||||
|
||||
|
|
|
@ -233,7 +233,7 @@ PLD_DEVICE_COMMAND_HANDLER(virtex2_pld_device_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int virtex2_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int virtex2_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
command_t *virtex2_cmd = register_command(cmd_ctx, NULL, "virtex2",
|
||||
NULL, COMMAND_ANY, "virtex2 specific commands");
|
||||
|
|
|
@ -650,7 +650,7 @@ int gdb_output_con(struct connection *connection, const char* line)
|
|||
return retval;
|
||||
}
|
||||
|
||||
int gdb_output(struct command_context_s *context, const char* line)
|
||||
int gdb_output(struct command_context *context, const char* line)
|
||||
{
|
||||
/* this will be dumped to the log and also sent as an O packet if possible */
|
||||
LOG_USER_N("%s", line);
|
||||
|
@ -1556,7 +1556,7 @@ static int compare_bank (const void * a, const void * b)
|
|||
|
||||
int gdb_query_packet(struct connection *connection, struct target *target, char *packet, int packet_size)
|
||||
{
|
||||
command_context_t *cmd_ctx = connection->cmd_ctx;
|
||||
struct command_context *cmd_ctx = connection->cmd_ctx;
|
||||
struct gdb_connection *gdb_connection = connection->priv;
|
||||
|
||||
if (strstr(packet, "qRcmd,"))
|
||||
|
@ -2371,7 +2371,7 @@ COMMAND_HANDLER(handle_gdb_breakpoint_override_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int gdb_register_commands(command_context_t *command_context)
|
||||
int gdb_register_commands(struct command_context *command_context)
|
||||
{
|
||||
register_command(command_context, NULL, "gdb_sync",
|
||||
handle_gdb_sync_command, COMMAND_ANY,
|
||||
|
|
|
@ -55,7 +55,7 @@ struct gdb_service
|
|||
};
|
||||
|
||||
int gdb_init(void);
|
||||
int gdb_register_commands(command_context_t *command_context);
|
||||
int gdb_register_commands(struct command_context *command_context);
|
||||
|
||||
#define ERROR_GDB_BUFFER_TOO_SMALL (-800)
|
||||
#define ERROR_GDB_TIMEOUT (-801)
|
||||
|
|
|
@ -45,7 +45,7 @@ static int shutdown_openocd = 0;
|
|||
/* set when using pipes rather than tcp */
|
||||
int server_use_pipes = 0;
|
||||
|
||||
int add_connection(struct service *service, command_context_t *cmd_ctx)
|
||||
int add_connection(struct service *service, struct command_context *cmd_ctx)
|
||||
{
|
||||
socklen_t address_size;
|
||||
struct connection *c, **p;
|
||||
|
@ -288,7 +288,7 @@ int remove_services(void)
|
|||
extern void openocd_sleep_prelude(void);
|
||||
extern void openocd_sleep_postlude(void);
|
||||
|
||||
int server_loop(command_context_t *command_context)
|
||||
int server_loop(struct command_context *command_context)
|
||||
{
|
||||
struct service *service;
|
||||
|
||||
|
@ -541,7 +541,7 @@ COMMAND_HANDLER(handle_shutdown_command)
|
|||
return ERROR_COMMAND_CLOSE_CONNECTION;
|
||||
}
|
||||
|
||||
int server_register_commands(command_context_t *context)
|
||||
int server_register_commands(struct command_context *context)
|
||||
{
|
||||
register_command(context, NULL, "shutdown",
|
||||
handle_shutdown_command, COMMAND_ANY,
|
||||
|
|
|
@ -42,7 +42,7 @@ struct connection
|
|||
{
|
||||
int fd;
|
||||
struct sockaddr_in sin;
|
||||
command_context_t *cmd_ctx;
|
||||
struct command_context *cmd_ctx;
|
||||
struct service *service;
|
||||
int input_pending;
|
||||
void *priv;
|
||||
|
@ -77,9 +77,9 @@ int add_service(char *name, enum connection_type type, unsigned short port,
|
|||
int server_init(void);
|
||||
int server_quit(void);
|
||||
|
||||
int server_loop(command_context_t *command_context);
|
||||
int server_loop(struct command_context *command_context);
|
||||
|
||||
int server_register_commands(command_context_t *context);
|
||||
int server_register_commands(struct command_context *context);
|
||||
|
||||
/**
|
||||
* Defines an extended command handler function declaration to enable
|
||||
|
|
|
@ -175,7 +175,7 @@ COMMAND_HANDLER(handle_tcl_port_command)
|
|||
return CALL_COMMAND_HANDLER(server_port_command, &tcl_port);
|
||||
}
|
||||
|
||||
int tcl_register_commands(command_context_t *cmd_ctx)
|
||||
int tcl_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
register_command(cmd_ctx, NULL, "tcl_port",
|
||||
handle_tcl_port_command, COMMAND_CONFIG,
|
||||
|
|
|
@ -23,6 +23,6 @@
|
|||
#include "server.h"
|
||||
|
||||
int tcl_init(void);
|
||||
int tcl_register_commands(command_context_t *cmd_ctx);
|
||||
int tcl_register_commands(struct command_context *cmd_ctx);
|
||||
|
||||
#endif /* _TCL_SERVER_H_ */
|
||||
|
|
|
@ -94,7 +94,7 @@ int telnet_outputline(struct connection *connection, const char *line)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int telnet_output(struct command_context_s *cmd_ctx, const char* line)
|
||||
int telnet_output(struct command_context *cmd_ctx, const char* line)
|
||||
{
|
||||
struct connection *connection = cmd_ctx->output_handler_priv;
|
||||
|
||||
|
@ -198,7 +198,7 @@ int telnet_input(struct connection *connection)
|
|||
char buffer[TELNET_BUFFER_SIZE];
|
||||
char *buf_p;
|
||||
struct telnet_connection *t_con = connection->priv;
|
||||
command_context_t *command_context = connection->cmd_ctx;
|
||||
struct command_context *command_context = connection->cmd_ctx;
|
||||
|
||||
bytes_read = read_socket(connection->fd, buffer, TELNET_BUFFER_SIZE);
|
||||
|
||||
|
@ -616,7 +616,7 @@ COMMAND_HANDLER(handle_exit_command)
|
|||
return ERROR_COMMAND_CLOSE_CONNECTION;
|
||||
}
|
||||
|
||||
int telnet_register_commands(command_context_t *command_context)
|
||||
int telnet_register_commands(struct command_context *command_context)
|
||||
{
|
||||
register_command(command_context, NULL, "exit",
|
||||
&handle_exit_command, COMMAND_EXEC,
|
||||
|
|
|
@ -69,6 +69,6 @@ struct telnet_service
|
|||
};
|
||||
|
||||
int telnet_init(char *banner);
|
||||
int telnet_register_commands(command_context_t *command_context);
|
||||
int telnet_register_commands(struct command_context *command_context);
|
||||
|
||||
#endif /* TELNET_SERVER_H */
|
||||
|
|
|
@ -209,7 +209,7 @@ static int svf_check_tdo_para_index = 0;
|
|||
static int svf_read_command_from_file(int fd);
|
||||
static int svf_check_tdo(void);
|
||||
static int svf_add_check_para(uint8_t enabled, int buffer_offset, int bit_len);
|
||||
static int svf_run_command(struct command_context_s *cmd_ctx, char *cmd_str);
|
||||
static int svf_run_command(struct command_context *cmd_ctx, char *cmd_str);
|
||||
|
||||
static int svf_fd = 0;
|
||||
static char *svf_command_buffer = NULL;
|
||||
|
@ -750,7 +750,7 @@ static int svf_execute_tap(void)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int svf_run_command(struct command_context_s *cmd_ctx, char *cmd_str)
|
||||
static int svf_run_command(struct command_context *cmd_ctx, char *cmd_str)
|
||||
{
|
||||
char *argus[256], command;
|
||||
int num_of_argu = 0, i;
|
||||
|
@ -1460,7 +1460,7 @@ static int svf_run_command(struct command_context_s *cmd_ctx, char *cmd_str)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int svf_register_commands(struct command_context_s *cmd_ctx)
|
||||
int svf_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
register_command(cmd_ctx, NULL, "svf",
|
||||
&handle_svf_command, COMMAND_EXEC,
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "command.h"
|
||||
|
||||
int svf_register_commands(struct command_context_s *cmd_ctx);
|
||||
int svf_register_commands(struct command_context *cmd_ctx);
|
||||
|
||||
/**
|
||||
* svf_add_statemove() moves from the current state to @a goal_state.
|
||||
|
|
|
@ -1801,7 +1801,7 @@ static int arm11_target_create(struct target *target, Jim_Interp *interp)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int arm11_init_target(struct command_context_s *cmd_ctx,
|
||||
static int arm11_init_target(struct command_context *cmd_ctx,
|
||||
struct target *target)
|
||||
{
|
||||
/* Initialize anything we can set up without talking to the target */
|
||||
|
@ -2239,7 +2239,7 @@ struct target_type arm11_target = {
|
|||
};
|
||||
|
||||
|
||||
int arm11_register_commands(struct command_context_s *cmd_ctx)
|
||||
int arm11_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
FNC_INFO;
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ struct arm11_reg_state
|
|||
struct target * target;
|
||||
};
|
||||
|
||||
int arm11_register_commands(struct command_context_s *cmd_ctx);
|
||||
int arm11_register_commands(struct command_context *cmd_ctx);
|
||||
|
||||
int arm11_read_etm(struct arm11_common * arm11, uint8_t address, uint32_t *value);
|
||||
int arm11_write_etm(struct arm11_common * arm11, uint8_t address, uint32_t value);
|
||||
|
|
|
@ -211,7 +211,7 @@ static void arm720t_pre_restore_context(struct target *target)
|
|||
arm720t_write_cp15(target, 0xee060f10, arm720t->far_reg);
|
||||
}
|
||||
|
||||
static int arm720t_verify_pointer(struct command_context_s *cmd_ctx,
|
||||
static int arm720t_verify_pointer(struct command_context *cmd_ctx,
|
||||
struct arm720t_common *arm720t)
|
||||
{
|
||||
if (arm720t->common_magic != ARM720T_COMMON_MAGIC) {
|
||||
|
@ -371,7 +371,7 @@ static int arm720t_soft_reset_halt(struct target *target)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int arm720t_init_target(struct command_context_s *cmd_ctx, struct target *target)
|
||||
static int arm720t_init_target(struct command_context *cmd_ctx, struct target *target)
|
||||
{
|
||||
return arm7tdmi_init_target(cmd_ctx, target);
|
||||
}
|
||||
|
@ -490,7 +490,7 @@ static int arm720t_mcr(struct target *target, int cpnum, uint32_t op1, uint32_t
|
|||
return arm720t_write_cp15(target, mrc_opcode(cpnum, op1, op2, CRn, CRm), value);
|
||||
}
|
||||
|
||||
static int arm720t_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int arm720t_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
int retval;
|
||||
command_t *arm720t_cmd;
|
||||
|
|
|
@ -3119,7 +3119,7 @@ int arm7_9_init_arch_info(struct target *target, struct arm7_9_common *arm7_9)
|
|||
1, 1, target);
|
||||
}
|
||||
|
||||
int arm7_9_register_commands(struct command_context_s *cmd_ctx)
|
||||
int arm7_9_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
command_t *arm7_9_cmd;
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ target_to_arm7_9(struct target *target)
|
|||
armv4_5_common);
|
||||
}
|
||||
|
||||
int arm7_9_register_commands(struct command_context_s *cmd_ctx);
|
||||
int arm7_9_register_commands(struct command_context *cmd_ctx);
|
||||
|
||||
int arm7_9_poll(struct target *target);
|
||||
|
||||
|
|
|
@ -684,7 +684,7 @@ int arm7tdmi_examine(struct target *target)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int arm7tdmi_init_target(struct command_context_s *cmd_ctx, struct target *target)
|
||||
int arm7tdmi_init_target(struct command_context *cmd_ctx, struct target *target)
|
||||
{
|
||||
arm7tdmi_build_reg_cache(target);
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ struct arm7tdmi_common
|
|||
};
|
||||
|
||||
int arm7tdmi_init_arch_info(struct target *target, struct arm7tdmi_common *arm7tdmi, struct jtag_tap *tap);
|
||||
int arm7tdmi_init_target(struct command_context_s *cmd_ctx, struct target *target);
|
||||
int arm7tdmi_init_target(struct command_context *cmd_ctx, struct target *target);
|
||||
int arm7tdmi_examine(struct target *target);
|
||||
|
||||
#endif /* ARM7TDMI_H */
|
||||
|
|
|
@ -415,7 +415,7 @@ void arm920t_pre_restore_context(struct target *target)
|
|||
|
||||
static const char arm920_not[] = "target is not an ARM920";
|
||||
|
||||
static int arm920t_verify_pointer(struct command_context_s *cmd_ctx,
|
||||
static int arm920t_verify_pointer(struct command_context *cmd_ctx,
|
||||
struct arm920t_common *arm920t)
|
||||
{
|
||||
if (arm920t->common_magic != ARM920T_COMMON_MAGIC) {
|
||||
|
@ -1348,7 +1348,7 @@ static int arm920t_mcr(struct target *target, int cpnum, uint32_t op1, uint32_t
|
|||
}
|
||||
|
||||
/** Registers commands to access coprocessor, cache, and MMU resources. */
|
||||
int arm920t_register_commands(struct command_context_s *cmd_ctx)
|
||||
int arm920t_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
int retval;
|
||||
command_t *arm920t_cmd;
|
||||
|
|
|
@ -71,6 +71,6 @@ void arm920t_disable_mmu_caches(struct target *target,
|
|||
int mmu, int d_u_cache, int i_cache);
|
||||
void arm920t_enable_mmu_caches(struct target *target,
|
||||
int mmu, int d_u_cache, int i_cache);
|
||||
int arm920t_register_commands(struct command_context_s *cmd_ctx);
|
||||
int arm920t_register_commands(struct command_context *cmd_ctx);
|
||||
|
||||
#endif /* ARM920T_H */
|
||||
|
|
|
@ -474,7 +474,7 @@ static void arm926ejs_pre_restore_context(struct target *target)
|
|||
|
||||
static const char arm926_not[] = "target is not an ARM926";
|
||||
|
||||
static int arm926ejs_verify_pointer(struct command_context_s *cmd_ctx,
|
||||
static int arm926ejs_verify_pointer(struct command_context *cmd_ctx,
|
||||
struct arm926ejs_common *arm926)
|
||||
{
|
||||
if (arm926->common_magic != ARM926EJS_COMMON_MAGIC) {
|
||||
|
@ -818,7 +818,7 @@ static int arm926ejs_mmu(struct target *target, int *enabled)
|
|||
}
|
||||
|
||||
/** Registers commands to access coprocessor, cache, and debug resources. */
|
||||
int arm926ejs_register_commands(struct command_context_s *cmd_ctx)
|
||||
int arm926ejs_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
int retval;
|
||||
command_t *arm926ejs_cmd;
|
||||
|
|
|
@ -48,7 +48,7 @@ target_to_arm926(struct target *target)
|
|||
|
||||
int arm926ejs_init_arch_info(struct target *target,
|
||||
struct arm926ejs_common *arm926ejs, struct jtag_tap *tap);
|
||||
int arm926ejs_register_commands(struct command_context_s *cmd_ctx);
|
||||
int arm926ejs_register_commands(struct command_context *cmd_ctx);
|
||||
int arm926ejs_arch_state(struct target *target);
|
||||
int arm926ejs_write_memory(struct target *target,
|
||||
uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer);
|
||||
|
|
|
@ -57,7 +57,7 @@ static int arm966e_target_create(struct target *target, Jim_Interp *interp)
|
|||
return arm966e_init_arch_info(target, arm966e, target->tap);
|
||||
}
|
||||
|
||||
static int arm966e_verify_pointer(struct command_context_s *cmd_ctx,
|
||||
static int arm966e_verify_pointer(struct command_context *cmd_ctx,
|
||||
struct arm966e_common *arm966e)
|
||||
{
|
||||
if (arm966e->common_magic != ARM966E_COMMON_MAGIC) {
|
||||
|
@ -216,7 +216,7 @@ COMMAND_HANDLER(arm966e_handle_cp15_command)
|
|||
}
|
||||
|
||||
/** Registers commands used to access coprocessor resources. */
|
||||
int arm966e_register_commands(struct command_context_s *cmd_ctx)
|
||||
int arm966e_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
int retval;
|
||||
command_t *arm966e_cmd;
|
||||
|
|
|
@ -43,7 +43,7 @@ target_to_arm966(struct target *target)
|
|||
|
||||
int arm966e_init_arch_info(struct target *target,
|
||||
struct arm966e_common *arm966e, struct jtag_tap *tap);
|
||||
int arm966e_register_commands(struct command_context_s *cmd_ctx);
|
||||
int arm966e_register_commands(struct command_context *cmd_ctx);
|
||||
int arm966e_write_cp15(struct target *target, int reg_addr, uint32_t value);
|
||||
|
||||
#endif /* ARM966E_H */
|
||||
|
|
|
@ -779,7 +779,7 @@ int arm9tdmi_examine(struct target *target)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int arm9tdmi_init_target(struct command_context_s *cmd_ctx,
|
||||
int arm9tdmi_init_target(struct command_context *cmd_ctx,
|
||||
struct target *target)
|
||||
{
|
||||
arm9tdmi_build_reg_cache(target);
|
||||
|
@ -936,7 +936,7 @@ COMMAND_HANDLER(handle_arm9tdmi_catch_vectors_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int arm9tdmi_register_commands(struct command_context_s *cmd_ctx)
|
||||
int arm9tdmi_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
int retval;
|
||||
command_t *arm9tdmi_cmd;
|
||||
|
|
|
@ -51,12 +51,12 @@ enum arm9tdmi_vector_bit
|
|||
ARM9TDMI_FIQ_VECTOR = 0x80,
|
||||
};
|
||||
|
||||
int arm9tdmi_init_target(struct command_context_s *cmd_ctx,
|
||||
int arm9tdmi_init_target(struct command_context *cmd_ctx,
|
||||
struct target *target);
|
||||
int arm9tdmi_examine(struct target *target);
|
||||
int arm9tdmi_init_arch_info(struct target *target,
|
||||
struct arm9tdmi_common *arm9tdmi, struct jtag_tap *tap);
|
||||
int arm9tdmi_register_commands(struct command_context_s *cmd_ctx);
|
||||
int arm9tdmi_register_commands(struct command_context *cmd_ctx);
|
||||
|
||||
int arm9tdmi_clock_out(struct arm_jtag *jtag_info,
|
||||
uint32_t instr, uint32_t out, uint32_t *in, int sysspeed);
|
||||
|
|
|
@ -1022,7 +1022,7 @@ is_dap_cid_ok(uint32_t cid3, uint32_t cid2, uint32_t cid1, uint32_t cid0)
|
|||
&& ((cid1 & 0x0f) == 0) && cid0 == 0x0d;
|
||||
}
|
||||
|
||||
int dap_info_command(struct command_context_s *cmd_ctx, struct swjdp_common *swjdp, int apsel)
|
||||
int dap_info_command(struct command_context *cmd_ctx, struct swjdp_common *swjdp, int apsel)
|
||||
{
|
||||
|
||||
uint32_t dbgbase,apid;
|
||||
|
|
|
@ -156,7 +156,7 @@ int ahbap_debugport_init(struct swjdp_common *swjdp);
|
|||
|
||||
|
||||
/* Commands for user dap access */
|
||||
int dap_info_command(struct command_context_s *cmd_ctx,
|
||||
int dap_info_command(struct command_context *cmd_ctx,
|
||||
struct swjdp_common *swjdp, int apsel);
|
||||
|
||||
#define DAP_COMMAND_HANDLER(name) \
|
||||
|
|
|
@ -462,7 +462,7 @@ usage:
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int armv4_5_register_commands(struct command_context_s *cmd_ctx)
|
||||
int armv4_5_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
command_t *armv4_5_cmd;
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ int armv4_5_arch_state(struct target *target);
|
|||
int armv4_5_get_gdb_reg_list(struct target *target,
|
||||
struct reg **reg_list[], int *reg_list_size);
|
||||
|
||||
int armv4_5_register_commands(struct command_context_s *cmd_ctx);
|
||||
int armv4_5_register_commands(struct command_context *cmd_ctx);
|
||||
int armv4_5_init_arch_info(struct target *target, struct arm *armv4_5);
|
||||
|
||||
int armv4_5_run_algorithm(struct target *target,
|
||||
|
|
|
@ -87,7 +87,7 @@ int armv4_5_identify_cache(uint32_t cache_type_reg, struct armv4_5_cache_common
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int armv4_5_handle_cache_info_command(struct command_context_s *cmd_ctx, struct armv4_5_cache_common *armv4_5_cache)
|
||||
int armv4_5_handle_cache_info_command(struct command_context *cmd_ctx, struct armv4_5_cache_common *armv4_5_cache)
|
||||
{
|
||||
if (armv4_5_cache->ctype == -1)
|
||||
{
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "types.h"
|
||||
|
||||
struct command_context_s;
|
||||
struct command_context;
|
||||
|
||||
struct armv4_5_cachesize
|
||||
{
|
||||
|
@ -47,7 +47,7 @@ int armv4_5_identify_cache(uint32_t cache_type_reg,
|
|||
int armv4_5_cache_state(uint32_t cp15_control_reg,
|
||||
struct armv4_5_cache_common *cache);
|
||||
|
||||
int armv4_5_handle_cache_info_command(struct command_context_s *cmd_ctx,
|
||||
int armv4_5_handle_cache_info_command(struct command_context *cmd_ctx,
|
||||
struct armv4_5_cache_common *armv4_5_cache);
|
||||
|
||||
enum
|
||||
|
|
|
@ -361,7 +361,7 @@ usage:
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int armv7a_register_commands(struct command_context_s *cmd_ctx)
|
||||
int armv7a_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
command_t *arm_adi_v5_dap_cmd;
|
||||
command_t *armv7a_cmd;
|
||||
|
|
|
@ -152,7 +152,7 @@ struct armv7a_core_reg
|
|||
int armv7a_arch_state(struct target *target);
|
||||
struct reg_cache *armv7a_build_reg_cache(struct target *target,
|
||||
struct armv7a_common *armv7a_common);
|
||||
int armv7a_register_commands(struct command_context_s *cmd_ctx);
|
||||
int armv7a_register_commands(struct command_context *cmd_ctx);
|
||||
int armv7a_init_arch_info(struct target *target, struct armv7a_common *armv7a);
|
||||
|
||||
/* map psr mode bits to linear number */
|
||||
|
|
|
@ -832,7 +832,7 @@ COMMAND_HANDLER(handle_dap_info_command)
|
|||
}
|
||||
|
||||
/** Registers commands used to access DAP resources. */
|
||||
int armv7m_register_commands(struct command_context_s *cmd_ctx)
|
||||
int armv7m_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
command_t *arm_adi_v5_dap_cmd;
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ int armv7m_arch_state(struct target *target);
|
|||
int armv7m_get_gdb_reg_list(struct target *target,
|
||||
struct reg **reg_list[], int *reg_list_size);
|
||||
|
||||
int armv7m_register_commands(struct command_context_s *cmd_ctx);
|
||||
int armv7m_register_commands(struct command_context *cmd_ctx);
|
||||
int armv7m_init_arch_info(struct target *target, struct armv7m_common *armv7m);
|
||||
|
||||
int armv7m_run_algorithm(struct target *target,
|
||||
|
|
|
@ -29,11 +29,11 @@
|
|||
#define AVR_JTAG_INS_LEN 4
|
||||
|
||||
/* cli handling */
|
||||
int avr_register_commands(struct command_context_s *cmd_ctx);
|
||||
int avr_register_commands(struct command_context *cmd_ctx);
|
||||
|
||||
/* forward declarations */
|
||||
int avr_target_create(struct target *target, Jim_Interp *interp);
|
||||
int avr_init_target(struct command_context_s *cmd_ctx, struct target *target);
|
||||
int avr_init_target(struct command_context *cmd_ctx, struct target *target);
|
||||
|
||||
int avr_arch_state(struct target *target);
|
||||
int avr_poll(struct target *target);
|
||||
|
@ -96,7 +96,7 @@ struct target_type avr_target =
|
|||
.init_target = avr_init_target,
|
||||
};
|
||||
|
||||
int avr_register_commands(struct command_context_s *cmd_ctx)
|
||||
int avr_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
LOG_DEBUG("%s", __FUNCTION__);
|
||||
return ERROR_OK;
|
||||
|
@ -112,7 +112,7 @@ int avr_target_create(struct target *target, Jim_Interp *interp)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int avr_init_target(struct command_context_s *cmd_ctx, struct target *target)
|
||||
int avr_init_target(struct command_context *cmd_ctx, struct target *target)
|
||||
{
|
||||
LOG_DEBUG("%s", __FUNCTION__);
|
||||
return ERROR_OK;
|
||||
|
|
|
@ -1443,7 +1443,7 @@ static void cortex_a8_build_reg_cache(struct target *target)
|
|||
}
|
||||
|
||||
|
||||
static int cortex_a8_init_target(struct command_context_s *cmd_ctx,
|
||||
static int cortex_a8_init_target(struct command_context *cmd_ctx,
|
||||
struct target *target)
|
||||
{
|
||||
cortex_a8_build_reg_cache(target);
|
||||
|
@ -1546,7 +1546,7 @@ COMMAND_HANDLER(cortex_a8_handle_dbginit_command)
|
|||
}
|
||||
|
||||
|
||||
static int cortex_a8_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int cortex_a8_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
command_t *cortex_a8_cmd;
|
||||
int retval = ERROR_OK;
|
||||
|
|
|
@ -1435,7 +1435,7 @@ static int cortex_m3_bulk_write_memory(struct target *target, uint32_t address,
|
|||
return cortex_m3_write_memory(target, address, 4, count, buffer);
|
||||
}
|
||||
|
||||
static int cortex_m3_init_target(struct command_context_s *cmd_ctx,
|
||||
static int cortex_m3_init_target(struct command_context *cmd_ctx,
|
||||
struct target *target)
|
||||
{
|
||||
armv7m_build_reg_cache(target);
|
||||
|
@ -1759,7 +1759,7 @@ static int cortex_m3_target_create(struct target *target, Jim_Interp *interp)
|
|||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
static int cortex_m3_verify_pointer(struct command_context_s *cmd_ctx,
|
||||
static int cortex_m3_verify_pointer(struct command_context *cmd_ctx,
|
||||
struct cortex_m3_common *cm3)
|
||||
{
|
||||
if (cm3->common_magic != CORTEX_M3_COMMON_MAGIC) {
|
||||
|
@ -1928,7 +1928,7 @@ COMMAND_HANDLER(handle_cortex_m3_mask_interrupts_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int cortex_m3_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int cortex_m3_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
int retval;
|
||||
command_t *cortex_m3_cmd;
|
||||
|
|
|
@ -403,7 +403,7 @@ COMMAND_HANDLER(handle_etb_config_command)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int etb_register_commands(struct command_context_s *cmd_ctx)
|
||||
static int etb_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
command_t *etb_cmd = register_command(cmd_ctx, NULL, "etb",
|
||||
NULL, COMMAND_ANY, "Embedded Trace Buffer");
|
||||
|
|
|
@ -219,7 +219,7 @@ static int etm_reg_arch_type = -1;
|
|||
static int etm_get_reg(struct reg *reg);
|
||||
static int etm_read_reg_w_check(struct reg *reg,
|
||||
uint8_t* check_value, uint8_t* check_mask);
|
||||
static int etm_register_user_commands(struct command_context_s *cmd_ctx);
|
||||
static int etm_register_user_commands(struct command_context *cmd_ctx);
|
||||
static int etm_set_reg_w_exec(struct reg *reg, uint8_t *buf);
|
||||
static int etm_write_reg(struct reg *reg, uint32_t value);
|
||||
|
||||
|
@ -884,7 +884,7 @@ static int etmv1_data(struct etm_context *ctx, int size, uint32_t *data)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int etmv1_analyze_trace(struct etm_context *ctx, struct command_context_s *cmd_ctx)
|
||||
static int etmv1_analyze_trace(struct etm_context *ctx, struct command_context *cmd_ctx)
|
||||
{
|
||||
int retval;
|
||||
struct arm_instruction instruction;
|
||||
|
@ -2109,7 +2109,7 @@ COMMAND_HANDLER(handle_etm_analyze_command)
|
|||
return retval;
|
||||
}
|
||||
|
||||
int etm_register_commands(struct command_context_s *cmd_ctx)
|
||||
int etm_register_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
etm_cmd = register_command(cmd_ctx, NULL, "etm", NULL, COMMAND_ANY, "Embedded Trace Macrocell");
|
||||
|
||||
|
@ -2119,7 +2119,7 @@ int etm_register_commands(struct command_context_s *cmd_ctx)
|
|||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int etm_register_user_commands(struct command_context_s *cmd_ctx)
|
||||
static int etm_register_user_commands(struct command_context *cmd_ctx)
|
||||
{
|
||||
register_command(cmd_ctx, etm_cmd, "tracemode", handle_etm_tracemode_command,
|
||||
COMMAND_EXEC, "configure/display trace mode: "
|
||||
|
|
|
@ -126,7 +126,7 @@ struct etm_context;
|
|||
struct etm_capture_driver
|
||||
{
|
||||
char *name;
|
||||
int (*register_commands)(struct command_context_s *cmd_ctx);
|
||||
int (*register_commands)(struct command_context *cmd_ctx);
|
||||
int (*init)(struct etm_context *etm_ctx);
|
||||
trace_status_t (*status)(struct etm_context *etm_ctx);
|
||||
int (*read_trace)(struct etm_context *etm_ctx);
|
||||
|
@ -212,7 +212,7 @@ struct reg_cache* etm_build_reg_cache(struct target *target,
|
|||
|
||||
int etm_setup(struct target *target);
|
||||
|
||||
int etm_register_commands(struct command_context_s *cmd_ctx);
|
||||
int etm_register_commands(struct command_context *cmd_ctx);
|
||||
|
||||
#define ERROR_ETM_INVALID_DRIVER (-1300)
|
||||
#define ERROR_ETM_PORTMODE_NOT_SUPPORTED (-1301)
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue