From: Zachary T Welch Date: Fri, 13 Nov 2009 21:25:47 +0000 (-0800) Subject: command_context_t -> struct command_context X-Git-Tag: v0.4.0-rc1~619 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=98723c4ecdbe06f90c66f3abec27b792c3b38e34;p=openocd command_context_t -> struct command_context Remove misleading typedef and redundant suffix from struct command_context. --- diff --git a/src/ecosboard.c b/src/ecosboard.c index 455c93c0..38f32525 100644 --- a/src/ecosboard.c +++ b/src/ecosboard.c @@ -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); diff --git a/src/flash/at91sam3.c b/src/flash/at91sam3.c index b756e48f..4459364e 100644 --- a/src/flash/at91sam3.c +++ b/src/flash/at91sam3.c @@ -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; diff --git a/src/flash/at91sam7.c b/src/flash/at91sam7.c index 8f870bc0..18cfb986 100644 --- a/src/flash/at91sam7.c +++ b/src/flash/at91sam7.c @@ -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); diff --git a/src/flash/avrf.c b/src/flash/avrf.c index 9df254ea..ea9f0833 100644 --- a/src/flash/avrf.c +++ b/src/flash/avrf.c @@ -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"); diff --git a/src/flash/cfi.c b/src/flash/cfi.c index dd393de2..d49ddf31 100644 --- a/src/flash/cfi.c +++ b/src/flash/cfi.c @@ -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 [jedec_probe/x16_as_x8]"); diff --git a/src/flash/davinci_nand.c b/src/flash/davinci_nand.c index 4cef4084..413bcda4 100644 --- a/src/flash/davinci_nand.c +++ b/src/flash/davinci_nand.c @@ -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; } diff --git a/src/flash/ecos.c b/src/flash/ecos.c index da354073..0525fbe3 100644 --- a/src/flash/ecos.c +++ b/src/flash/ecos.c @@ -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; } diff --git a/src/flash/faux.c b/src/flash/faux.c index 55e9892c..b048fcb0 100644 --- a/src/flash/faux.c +++ b/src/flash/faux.c @@ -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; } diff --git a/src/flash/flash.c b/src/flash/flash.c index 96c63d54..32c1f490 100644 --- a/src/flash/flash.c +++ b/src/flash/flash.c @@ -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); diff --git a/src/flash/flash.h b/src/flash/flash.h index 202a5e52..4651fc36 100644 --- a/src/flash/flash.h +++ b/src/flash/flash.h @@ -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. diff --git a/src/flash/lpc2000.c b/src/flash/lpc2000.c index 36ebc0ec..f3d7e5b4 100644 --- a/src/flash/lpc2000.c +++ b/src/flash/lpc2000.c @@ -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); diff --git a/src/flash/lpc2900.c b/src/flash/lpc2900.c index d385a302..4cf20921 100644 --- a/src/flash/lpc2900.c +++ b/src/flash/lpc2900.c @@ -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); diff --git a/src/flash/lpc3180_nand_controller.c b/src/flash/lpc3180_nand_controller.c index 4a15e364..ffa50557 100644 --- a/src/flash/lpc3180_nand_controller.c +++ b/src/flash/lpc3180_nand_controller.c @@ -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"); diff --git a/src/flash/mflash.c b/src/flash/mflash.c index 698cd16e..029178d1 100644 --- a/src/flash/mflash.c +++ b/src/flash/mflash.c @@ -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, diff --git a/src/flash/mflash.h b/src/flash/mflash.h index a2bd5b3a..ed4a2cdd 100644 --- a/src/flash/mflash.h +++ b/src/flash/mflash.h @@ -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) diff --git a/src/flash/mx3_nand.c b/src/flash/mx3_nand.c index 6c699179..45d2a323 100644 --- a/src/flash/mx3_nand.c +++ b/src/flash/mx3_nand.c @@ -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; } diff --git a/src/flash/nand.c b/src/flash/nand.c index 48f65206..4094effc 100644 --- a/src/flash/nand.c +++ b/src/flash/nand.c @@ -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; diff --git a/src/flash/nand.h b/src/flash/nand.h index 80963095..afec9a77 100644 --- a/src/flash/nand.h +++ b/src/flash/nand.h @@ -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); diff --git a/src/flash/orion_nand.c b/src/flash/orion_nand.c index 0d4e1ea8..4235b085 100644 --- a/src/flash/orion_nand.c +++ b/src/flash/orion_nand.c @@ -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; } diff --git a/src/flash/pic32mx.c b/src/flash/pic32mx.c index e19ee950..bb3d69c1 100644 --- a/src/flash/pic32mx.c +++ b/src/flash/pic32mx.c @@ -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"); diff --git a/src/flash/s3c24xx_nand.c b/src/flash/s3c24xx_nand.c index 5b2d191f..75b8700c 100644 --- a/src/flash/s3c24xx_nand.c +++ b/src/flash/s3c24xx_nand.c @@ -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; } diff --git a/src/flash/s3c24xx_nand.h b/src/flash/s3c24xx_nand.h index 41c95f52..4829c7c4 100644 --- a/src/flash/s3c24xx_nand.h +++ b/src/flash/s3c24xx_nand.h @@ -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); diff --git a/src/flash/stellaris.c b/src/flash/stellaris.c index efda8590..910d047d 100644 --- a/src/flash/stellaris.c +++ b/src/flash/stellaris.c @@ -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"); diff --git a/src/flash/stm32x.c b/src/flash/stm32x.c index cf842fcf..abbf6cb6 100644 --- a/src/flash/stm32x.c +++ b/src/flash/stm32x.c @@ -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"); diff --git a/src/flash/str7x.c b/src/flash/str7x.c index fa235509..83070134 100644 --- a/src/flash/str7x.c +++ b/src/flash/str7x.c @@ -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"); diff --git a/src/flash/str9x.c b/src/flash/str9x.c index b3e8dffc..a06bd1ec 100644 --- a/src/flash/str9x.c +++ b/src/flash/str9x.c @@ -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"); diff --git a/src/flash/str9xpec.c b/src/flash/str9xpec.c index 6c42ce3e..03a8ea2e 100644 --- a/src/flash/str9xpec.c +++ b/src/flash/str9xpec.c @@ -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"); diff --git a/src/flash/tms470.c b/src/flash/tms470.c index 6e1516f3..a5f2f36a 100644 --- a/src/flash/tms470.c +++ b/src/flash/tms470.c @@ -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"); diff --git a/src/hello.c b/src/hello.c index 8a4f701d..267cc28e 100644 --- a/src/hello.c +++ b/src/hello.c @@ -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, diff --git a/src/helper/command.c b/src/helper/command.c index 3cd11d21..60a4a26e 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -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); diff --git a/src/helper/command.h b/src/helper/command.h index bddb053e..169852ef 100644 --- a/src/helper/command.h +++ b/src/helper/command.h @@ -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); diff --git a/src/helper/configuration.c b/src/helper/configuration.c index 3c44d6d4..1f7240d9 100644 --- a/src/helper/configuration.c +++ b/src/helper/configuration.c @@ -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; diff --git a/src/helper/configuration.h b/src/helper/configuration.h index 5d601485..9b77a256 100644 --- a/src/helper/configuration.h +++ b/src/helper/configuration.h @@ -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); diff --git a/src/helper/ioutil.c b/src/helper/ioutil.c index 3a629611..a9474a63 100644 --- a/src/helper/ioutil.c +++ b/src/helper/ioutil.c @@ -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"); diff --git a/src/helper/log.c b/src/helper/log.c index 1724becc..c6906543 100644 --- a/src/helper/log.c +++ b/src/helper/log.c @@ -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; diff --git a/src/helper/log.h b/src/helper/log.h index 5742897d..3bf9840a 100644 --- a/src/helper/log.h +++ b/src/helper/log.h @@ -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); diff --git a/src/helper/options.c b/src/helper/options.c index a0c9a9e9..3ffc6736 100644 --- a/src/helper/options.c +++ b/src/helper/options.c @@ -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]; diff --git a/src/jtag/amt_jtagaccel.c b/src/jtag/amt_jtagaccel.c index 87d9cd3c..3fb77f8e 100644 --- a/src/jtag/amt_jtagaccel.c +++ b/src/jtag/amt_jtagaccel.c @@ -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, diff --git a/src/jtag/arm-jtag-ew.c b/src/jtag/arm-jtag-ew.c index d2e3ff7d..0568d1c8 100644 --- a/src/jtag/arm-jtag-ew.c +++ b/src/jtag/arm-jtag-ew.c @@ -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) { diff --git a/src/jtag/at91rm9200.c b/src/jtag/at91rm9200.c index 70625753..dc9797e0 100644 --- a/src/jtag/at91rm9200.c +++ b/src/jtag/at91rm9200.c @@ -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); diff --git a/src/jtag/core.c b/src/jtag/core.c index 1c2e2655..1841dde9 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -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; diff --git a/src/jtag/dummy.c b/src/jtag/dummy.c index ce3cca35..324ea7e9 100644 --- a/src/jtag/dummy.c +++ b/src/jtag/dummy.c @@ -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; } diff --git a/src/jtag/ep93xx.c b/src/jtag/ep93xx.c index 6ae823e8..c679b216 100644 --- a/src/jtag/ep93xx.c +++ b/src/jtag/ep93xx.c @@ -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; diff --git a/src/jtag/ft2232.c b/src/jtag/ft2232.c index 3e7dd2a2..7d7a5383 100644 --- a/src/jtag/ft2232.c +++ b/src/jtag/ft2232.c @@ -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, diff --git a/src/jtag/gw16012.c b/src/jtag/gw16012.c index 1c5f6540..e24c23a6 100644 --- a/src/jtag/gw16012.c +++ b/src/jtag/gw16012.c @@ -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, diff --git a/src/jtag/interface.h b/src/jtag/interface.h index 57272985..05e4048b 100644 --- a/src/jtag/interface.h +++ b/src/jtag/interface.h @@ -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 diff --git a/src/jtag/jlink.c b/src/jtag/jlink.c index 9677f0e8..27d400d4 100644 --- a/src/jtag/jlink.c +++ b/src/jtag/jlink.c @@ -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: diff --git a/src/jtag/jtag.h b/src/jtag/jtag.h index e3f81489..30d62fd9 100644 --- a/src/jtag/jtag.h +++ b/src/jtag/jtag.h @@ -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 diff --git a/src/jtag/parport.c b/src/jtag/parport.c index b9396a99..399c00ad 100644 --- a/src/jtag/parport.c +++ b/src/jtag/parport.c @@ -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, diff --git a/src/jtag/presto.c b/src/jtag/presto.c index 154e3e17..b4ba3f44 100644 --- a/src/jtag/presto.c +++ b/src/jtag/presto.c @@ -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); diff --git a/src/jtag/rlink/rlink.c b/src/jtag/rlink/rlink.c index 9dd8b888..8f2f26fe 100644 --- a/src/jtag/rlink/rlink.c +++ b/src/jtag/rlink/rlink.c @@ -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_ diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c index 9d6169cc..75732ef0 100644 --- a/src/jtag/tcl.c +++ b/src/jtag/tcl.c @@ -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"); diff --git a/src/jtag/usbprog.c b/src/jtag/usbprog.c index 7abb0ca3..10dfe061 100644 --- a/src/jtag/usbprog.c +++ b/src/jtag/usbprog.c @@ -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; } diff --git a/src/jtag/vsllink.c b/src/jtag/vsllink.c index c404476f..0684dd3b 100644 --- a/src/jtag/vsllink.c +++ b/src/jtag/vsllink.c @@ -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, diff --git a/src/jtag/zy1000/zy1000.c b/src/jtag/zy1000/zy1000.c index 8f4d5e5f..1edf57f8 100644 --- a/src/jtag/zy1000/zy1000.c +++ b/src/jtag/zy1000/zy1000.c @@ -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 - turn power switch to target on/off. No arguments - print status."); diff --git a/src/openocd.c b/src/openocd.c index 8c99af07..78f220c7 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -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(); diff --git a/src/pld/pld.c b/src/pld/pld.c index e0a7eac5..f5f3303a 100644 --- a/src/pld/pld.c +++ b/src/pld/pld.c @@ -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"); diff --git a/src/pld/pld.h b/src/pld/pld.h index 4c4c64a7..b183e3e0 100644 --- a/src/pld/pld.h +++ b/src/pld/pld.h @@ -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); diff --git a/src/pld/virtex2.c b/src/pld/virtex2.c index e2ebb041..24bcd348 100644 --- a/src/pld/virtex2.c +++ b/src/pld/virtex2.c @@ -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"); diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index f49f352f..4151ec79 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -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, diff --git a/src/server/gdb_server.h b/src/server/gdb_server.h index de84e200..4513e8a0 100644 --- a/src/server/gdb_server.h +++ b/src/server/gdb_server.h @@ -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) diff --git a/src/server/server.c b/src/server/server.c index 5614ef98..7416784c 100644 --- a/src/server/server.c +++ b/src/server/server.c @@ -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, diff --git a/src/server/server.h b/src/server/server.h index 062691b0..5e862815 100644 --- a/src/server/server.h +++ b/src/server/server.h @@ -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 diff --git a/src/server/tcl_server.c b/src/server/tcl_server.c index eed483ca..40a0428d 100644 --- a/src/server/tcl_server.c +++ b/src/server/tcl_server.c @@ -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, diff --git a/src/server/tcl_server.h b/src/server/tcl_server.h index d6c9e10b..1f6ba62e 100644 --- a/src/server/tcl_server.h +++ b/src/server/tcl_server.h @@ -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_ */ diff --git a/src/server/telnet_server.c b/src/server/telnet_server.c index 93028b14..46d438e0 100644 --- a/src/server/telnet_server.c +++ b/src/server/telnet_server.c @@ -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, diff --git a/src/server/telnet_server.h b/src/server/telnet_server.h index c45a4236..7e398222 100644 --- a/src/server/telnet_server.h +++ b/src/server/telnet_server.h @@ -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 */ diff --git a/src/svf/svf.c b/src/svf/svf.c index 7e689fa3..814f3f22 100644 --- a/src/svf/svf.c +++ b/src/svf/svf.c @@ -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, diff --git a/src/svf/svf.h b/src/svf/svf.h index 329fea93..20a35550 100644 --- a/src/svf/svf.h +++ b/src/svf/svf.h @@ -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. diff --git a/src/target/arm11.c b/src/target/arm11.c index 970ffa2c..feaa17b6 100644 --- a/src/target/arm11.c +++ b/src/target/arm11.c @@ -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; diff --git a/src/target/arm11.h b/src/target/arm11.h index ae6a93ca..f890253a 100644 --- a/src/target/arm11.h +++ b/src/target/arm11.h @@ -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); diff --git a/src/target/arm720t.c b/src/target/arm720t.c index ad4b12e0..bdbc8dd3 100644 --- a/src/target/arm720t.c +++ b/src/target/arm720t.c @@ -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; diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index 2d3fe15d..87a64345 100644 --- a/src/target/arm7_9_common.c +++ b/src/target/arm7_9_common.c @@ -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; diff --git a/src/target/arm7_9_common.h b/src/target/arm7_9_common.h index 2c50b717..035c5fe3 100644 --- a/src/target/arm7_9_common.h +++ b/src/target/arm7_9_common.h @@ -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); diff --git a/src/target/arm7tdmi.c b/src/target/arm7tdmi.c index c4cda7de..029dce1c 100644 --- a/src/target/arm7tdmi.c +++ b/src/target/arm7tdmi.c @@ -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); diff --git a/src/target/arm7tdmi.h b/src/target/arm7tdmi.h index 4a0a1ed9..85b64bef 100644 --- a/src/target/arm7tdmi.h +++ b/src/target/arm7tdmi.h @@ -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 */ diff --git a/src/target/arm920t.c b/src/target/arm920t.c index 577bf26e..cd63d7bd 100644 --- a/src/target/arm920t.c +++ b/src/target/arm920t.c @@ -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; diff --git a/src/target/arm920t.h b/src/target/arm920t.h index 02f6da5c..567c8def 100644 --- a/src/target/arm920t.h +++ b/src/target/arm920t.h @@ -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 */ diff --git a/src/target/arm926ejs.c b/src/target/arm926ejs.c index b2f246f9..47a20cb1 100644 --- a/src/target/arm926ejs.c +++ b/src/target/arm926ejs.c @@ -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; diff --git a/src/target/arm926ejs.h b/src/target/arm926ejs.h index e6c46dc0..22081f4e 100644 --- a/src/target/arm926ejs.h +++ b/src/target/arm926ejs.h @@ -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); diff --git a/src/target/arm966e.c b/src/target/arm966e.c index b1ae48c3..6db7d79b 100644 --- a/src/target/arm966e.c +++ b/src/target/arm966e.c @@ -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; diff --git a/src/target/arm966e.h b/src/target/arm966e.h index 74e1a030..b58f3a24 100644 --- a/src/target/arm966e.h +++ b/src/target/arm966e.h @@ -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 */ diff --git a/src/target/arm9tdmi.c b/src/target/arm9tdmi.c index 5425582d..b910447f 100644 --- a/src/target/arm9tdmi.c +++ b/src/target/arm9tdmi.c @@ -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; diff --git a/src/target/arm9tdmi.h b/src/target/arm9tdmi.h index 5165dc88..34a63ee7 100644 --- a/src/target/arm9tdmi.h +++ b/src/target/arm9tdmi.h @@ -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); diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 751020fb..958844bb 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -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; diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h index 486d29f4..56b6206d 100644 --- a/src/target/arm_adi_v5.h +++ b/src/target/arm_adi_v5.h @@ -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) \ diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c index 097e6e73..f7d5d16c 100644 --- a/src/target/armv4_5.c +++ b/src/target/armv4_5.c @@ -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; diff --git a/src/target/armv4_5.h b/src/target/armv4_5.h index 472c2c1b..14dfa99e 100644 --- a/src/target/armv4_5.h +++ b/src/target/armv4_5.h @@ -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, diff --git a/src/target/armv4_5_cache.c b/src/target/armv4_5_cache.c index 793979e5..58fc0c1d 100644 --- a/src/target/armv4_5_cache.c +++ b/src/target/armv4_5_cache.c @@ -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) { diff --git a/src/target/armv4_5_cache.h b/src/target/armv4_5_cache.h index 456a32d3..1a82b671 100644 --- a/src/target/armv4_5_cache.h +++ b/src/target/armv4_5_cache.h @@ -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 diff --git a/src/target/armv7a.c b/src/target/armv7a.c index 9227219b..e40e8fdc 100644 --- a/src/target/armv7a.c +++ b/src/target/armv7a.c @@ -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; diff --git a/src/target/armv7a.h b/src/target/armv7a.h index 1b4884c3..5cdffd86 100644 --- a/src/target/armv7a.h +++ b/src/target/armv7a.h @@ -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 */ diff --git a/src/target/armv7m.c b/src/target/armv7m.c index 9c2e95c3..a7405840 100644 --- a/src/target/armv7m.c +++ b/src/target/armv7m.c @@ -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; diff --git a/src/target/armv7m.h b/src/target/armv7m.h index 7debd353..7f8190bf 100644 --- a/src/target/armv7m.h +++ b/src/target/armv7m.h @@ -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, diff --git a/src/target/avrt.c b/src/target/avrt.c index 43715614..cabb2725 100644 --- a/src/target/avrt.c +++ b/src/target/avrt.c @@ -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; diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index 586b9ea6..6c613634 100644 --- a/src/target/cortex_a8.c +++ b/src/target/cortex_a8.c @@ -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; diff --git a/src/target/cortex_m3.c b/src/target/cortex_m3.c index eea9c880..bb0b0c41 100644 --- a/src/target/cortex_m3.c +++ b/src/target/cortex_m3.c @@ -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; diff --git a/src/target/etb.c b/src/target/etb.c index b6981513..903951f5 100644 --- a/src/target/etb.c +++ b/src/target/etb.c @@ -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"); diff --git a/src/target/etm.c b/src/target/etm.c index cc92098d..ee064ebc 100644 --- a/src/target/etm.c +++ b/src/target/etm.c @@ -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: " diff --git a/src/target/etm.h b/src/target/etm.h index 1ca9b938..b74c6d90 100644 --- a/src/target/etm.h +++ b/src/target/etm.h @@ -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) diff --git a/src/target/etm_dummy.c b/src/target/etm_dummy.c index 598c7993..8301fb06 100644 --- a/src/target/etm_dummy.c +++ b/src/target/etm_dummy.c @@ -58,7 +58,7 @@ COMMAND_HANDLER(handle_etm_dummy_config_command) return ERROR_OK; } -static int etm_dummy_register_commands(struct command_context_s *cmd_ctx) +static int etm_dummy_register_commands(struct command_context *cmd_ctx) { command_t *etm_dummy_cmd; diff --git a/src/target/feroceon.c b/src/target/feroceon.c index d64b53f5..96a048ac 100644 --- a/src/target/feroceon.c +++ b/src/target/feroceon.c @@ -577,7 +577,7 @@ int feroceon_bulk_write_memory(struct target *target, uint32_t address, uint32_t return retval; } -int feroceon_init_target(struct command_context_s *cmd_ctx, struct target *target) +int feroceon_init_target(struct command_context *cmd_ctx, struct target *target) { arm9tdmi_init_target(cmd_ctx, target); return ERROR_OK; diff --git a/src/target/mips32.c b/src/target/mips32.c index c6ea66f3..fe22dd57 100644 --- a/src/target/mips32.c +++ b/src/target/mips32.c @@ -331,7 +331,7 @@ int mips32_init_arch_info(struct target *target, struct mips32_common *mips32, s return ERROR_OK; } -int mips32_register_commands(struct command_context_s *cmd_ctx) +int mips32_register_commands(struct command_context *cmd_ctx) { return ERROR_OK; } diff --git a/src/target/mips32.h b/src/target/mips32.h index b3e0bc40..7a4ba575 100644 --- a/src/target/mips32.h +++ b/src/target/mips32.h @@ -146,7 +146,7 @@ int mips32_enable_interrupts(struct target *target, int enable); int mips32_examine(struct target *target); -int mips32_register_commands(struct command_context_s *cmd_ctx); +int mips32_register_commands(struct command_context *cmd_ctx); int mips32_invalidate_core_regs(struct target *target); int mips32_get_gdb_reg_list(struct target *target, diff --git a/src/target/mips_m4k.c b/src/target/mips_m4k.c index 94a73280..6dd00ad5 100644 --- a/src/target/mips_m4k.c +++ b/src/target/mips_m4k.c @@ -39,8 +39,8 @@ int mips_m4k_resume(struct target *target, int current, uint32_t address, int ha int mips_m4k_step(struct target *target, int current, uint32_t address, int handle_breakpoints); int mips_m4k_read_memory(struct target *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer); int mips_m4k_write_memory(struct target *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer); -int mips_m4k_register_commands(struct command_context_s *cmd_ctx); -int mips_m4k_init_target(struct command_context_s *cmd_ctx, struct target *target); +int mips_m4k_register_commands(struct command_context *cmd_ctx); +int mips_m4k_init_target(struct command_context *cmd_ctx, struct target *target); int mips_m4k_target_create(struct target *target, Jim_Interp *interp); int mips_m4k_examine(struct target *target); @@ -902,7 +902,7 @@ int mips_m4k_write_memory(struct target *target, uint32_t address, uint32_t size return mips32_dmaacc_write_mem(ejtag_info, address, size, count, (void *)buffer); } -int mips_m4k_register_commands(struct command_context_s *cmd_ctx) +int mips_m4k_register_commands(struct command_context *cmd_ctx) { int retval; @@ -910,7 +910,7 @@ int mips_m4k_register_commands(struct command_context_s *cmd_ctx) return retval; } -int mips_m4k_init_target(struct command_context_s *cmd_ctx, struct target *target) +int mips_m4k_init_target(struct command_context *cmd_ctx, struct target *target) { mips32_build_reg_cache(target); diff --git a/src/target/oocd_trace.c b/src/target/oocd_trace.c index 390c75d8..c2e13618 100644 --- a/src/target/oocd_trace.c +++ b/src/target/oocd_trace.c @@ -30,7 +30,7 @@ */ -static int oocd_trace_register_commands(struct command_context_s *cmd_ctx); +static int oocd_trace_register_commands(struct command_context *cmd_ctx); static int oocd_trace_read_reg(struct oocd_trace *oocd_trace, int reg, uint32_t *value) { @@ -407,7 +407,7 @@ COMMAND_HANDLER(handle_oocd_trace_resync_command) return ERROR_OK; } -int oocd_trace_register_commands(struct command_context_s *cmd_ctx) +int oocd_trace_register_commands(struct command_context *cmd_ctx) { command_t *oocd_trace_cmd; diff --git a/src/target/target.c b/src/target/target.c index ca440a7d..85c228a0 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -336,7 +336,7 @@ static struct target *get_target_by_num(int num) return NULL; } -struct target* get_current_target(command_context_t *cmd_ctx) +struct target* get_current_target(struct command_context *cmd_ctx) { struct target *target = get_target_by_num(cmd_ctx->current_target); @@ -425,7 +425,7 @@ int target_resume(struct target *target, int current, uint32_t address, int hand return retval; } -int target_process_reset(struct command_context_s *cmd_ctx, enum target_reset_mode reset_mode) +int target_process_reset(struct command_context *cmd_ctx, enum target_reset_mode reset_mode) { char buf[100]; int retval; @@ -754,7 +754,7 @@ err_write_phys_memory(struct target *target, uint32_t address, return ERROR_FAIL; } -int target_init(struct command_context_s *cmd_ctx) +int target_init(struct command_context *cmd_ctx) { struct target *target; int retval; @@ -2201,7 +2201,7 @@ COMMAND_HANDLER(handle_step_command) return target->type->step(target, current_pc, addr, 1); } -static void handle_md_output(struct command_context_s *cmd_ctx, +static void handle_md_output(struct command_context *cmd_ctx, struct target *target, uint32_t address, unsigned size, unsigned count, const uint8_t *buffer) { @@ -2709,7 +2709,7 @@ COMMAND_HANDLER(handle_test_image_command) return CALL_COMMAND_HANDLER(handle_verify_image_command_internal, 0); } -static int handle_bp_command_list(struct command_context_s *cmd_ctx) +static int handle_bp_command_list(struct command_context *cmd_ctx) { struct target *target = get_current_target(cmd_ctx); struct breakpoint *breakpoint = target->breakpoints; @@ -2737,7 +2737,7 @@ static int handle_bp_command_list(struct command_context_s *cmd_ctx) return ERROR_OK; } -static int handle_bp_command_set(struct command_context_s *cmd_ctx, +static int handle_bp_command_set(struct command_context *cmd_ctx, uint32_t addr, uint32_t length, int hw) { struct target *target = get_current_target(cmd_ctx); @@ -3132,7 +3132,7 @@ static int new_int_array_element(Jim_Interp * interp, const char *varname, int i static int jim_mem2array(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { - command_context_t *context; + struct command_context *context; struct target *target; context = Jim_GetAssocData(interp, "context"); @@ -3321,7 +3321,7 @@ static int get_int_array_element(Jim_Interp * interp, const char *varname, int i static int jim_array2mem(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { - command_context_t *context; + struct command_context *context; struct target *target; context = Jim_GetAssocData(interp, "context"); @@ -3822,7 +3822,7 @@ static int tcl_target_func(Jim_Interp *interp, int argc, Jim_Obj *const *argv) uint8_t target_buf[32]; Jim_Nvp *n; struct target *target; - struct command_context_s *cmd_ctx; + struct command_context *cmd_ctx; int e; enum { @@ -4238,7 +4238,7 @@ static int target_create(Jim_GetOptInfo *goi) int e; int x; struct target *target; - struct command_context_s *cmd_ctx; + struct command_context *cmd_ctx; cmd_ctx = Jim_GetAssocData(goi->interp, "context"); if (goi->argc < 3) { @@ -4390,7 +4390,7 @@ static int jim_target(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { int x,r,e; jim_wide w; - struct command_context_s *cmd_ctx; + struct command_context *cmd_ctx; struct target *target; Jim_GetOptInfo goi; enum tcmd { @@ -4679,7 +4679,7 @@ COMMAND_HANDLER(handle_fast_load_command) static int jim_mcrmrc(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { - command_context_t *context; + struct command_context *context; struct target *target; int retval; @@ -4763,7 +4763,7 @@ static int jim_mcrmrc(Jim_Interp *interp, int argc, Jim_Obj *const *argv) return JIM_OK; } -int target_register_commands(struct command_context_s *cmd_ctx) +int target_register_commands(struct command_context *cmd_ctx) { register_command(cmd_ctx, NULL, "targets", @@ -4776,7 +4776,7 @@ int target_register_commands(struct command_context_s *cmd_ctx) return ERROR_OK; } -int target_register_user_commands(struct command_context_s *cmd_ctx) +int target_register_user_commands(struct command_context *cmd_ctx) { int retval = ERROR_OK; if ((retval = target_request_register_commands(cmd_ctx)) != ERROR_OK) diff --git a/src/target/target.h b/src/target/target.h index 5f29e7f4..914d62fd 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -34,7 +34,7 @@ struct reg; struct trace; -struct command_context_s; +struct command_context; /** @@ -241,12 +241,12 @@ struct target_timer_callback struct target_timer_callback *next; }; -int target_register_commands(struct command_context_s *cmd_ctx); -int target_register_user_commands(struct command_context_s *cmd_ctx); -int target_init(struct command_context_s *cmd_ctx); +int target_register_commands(struct command_context *cmd_ctx); +int target_register_user_commands(struct command_context *cmd_ctx); +int target_init(struct command_context *cmd_ctx); int target_examine(void); int handle_target(void *priv); -int target_process_reset(struct command_context_s *cmd_ctx, +int target_process_reset(struct command_context *cmd_ctx, enum target_reset_mode reset_mode); int target_register_event_callback( @@ -278,7 +278,7 @@ int target_call_timer_callbacks(void); */ int target_call_timer_callbacks_now(void); -struct target* get_current_target(struct command_context_s *cmd_ctx); +struct target* get_current_target(struct command_context *cmd_ctx); struct target *get_target(const char *id); /** diff --git a/src/target/target_request.c b/src/target/target_request.c index f1bb243d..1f02be6f 100644 --- a/src/target/target_request.c +++ b/src/target/target_request.c @@ -150,7 +150,7 @@ int target_request(struct target *target, uint32_t request) return ERROR_OK; } -static int add_debug_msg_receiver(struct command_context_s *cmd_ctx, struct target *target) +static int add_debug_msg_receiver(struct command_context *cmd_ctx, struct target *target) { struct debug_msg_receiver **p = &target->dbgmsg; @@ -178,7 +178,7 @@ static int add_debug_msg_receiver(struct command_context_s *cmd_ctx, struct targ return ERROR_OK; } -static struct debug_msg_receiver* find_debug_msg_receiver(struct command_context_s *cmd_ctx, struct target *target) +static struct debug_msg_receiver* find_debug_msg_receiver(struct command_context *cmd_ctx, struct target *target) { int do_all_targets = 0; struct debug_msg_receiver **p = &target->dbgmsg; @@ -211,7 +211,7 @@ static struct debug_msg_receiver* find_debug_msg_receiver(struct command_context return NULL; } -int delete_debug_msg_receiver(struct command_context_s *cmd_ctx, struct target *target) +int delete_debug_msg_receiver(struct command_context *cmd_ctx, struct target *target) { struct debug_msg_receiver **p; struct debug_msg_receiver *c; @@ -299,7 +299,7 @@ COMMAND_HANDLER(handle_target_request_debugmsgs_command) return ERROR_OK; } -int target_request_register_commands(struct command_context_s *cmd_ctx) +int target_request_register_commands(struct command_context *cmd_ctx) { target_request_cmd = register_command(cmd_ctx, NULL, "target_request", NULL, COMMAND_ANY, "target_request commands"); diff --git a/src/target/target_request.h b/src/target/target_request.h index 1fa7e8b4..cc9f3b9a 100644 --- a/src/target/target_request.h +++ b/src/target/target_request.h @@ -38,13 +38,13 @@ typedef enum target_req_cmd struct debug_msg_receiver { - command_context_t *cmd_ctx; + struct command_context *cmd_ctx; struct debug_msg_receiver *next; }; int target_request(struct target *target, uint32_t request); -int delete_debug_msg_receiver(struct command_context_s *cmd_ctx, +int delete_debug_msg_receiver(struct command_context *cmd_ctx, struct target *target); -int target_request_register_commands(struct command_context_s *cmd_ctx); +int target_request_register_commands(struct command_context *cmd_ctx); #endif /* TARGET_REQUEST_H */ diff --git a/src/target/target_type.h b/src/target/target_type.h index 32c58abb..f601b191 100644 --- a/src/target/target_type.h +++ b/src/target/target_type.h @@ -151,7 +151,7 @@ struct target_type */ int (*run_algorithm)(struct target *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_param, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info); - int (*register_commands)(struct command_context_s *cmd_ctx); + int (*register_commands)(struct command_context *cmd_ctx); /* called when target is created */ int (*target_create)(struct target *target, Jim_Interp *interp); @@ -177,7 +177,7 @@ struct target_type * It is illegal to talk to the target at this stage as this fn is invoked * before the JTAG chain has been examined/verified * */ - int (*init_target)(struct command_context_s *cmd_ctx, struct target *target); + int (*init_target)(struct command_context *cmd_ctx, struct target *target); /* translate from virtual to physical address. Default implementation is successful * no-op(i.e. virtual==physical). diff --git a/src/target/trace.c b/src/target/trace.c index bb57978c..aa8fb294 100644 --- a/src/target/trace.c +++ b/src/target/trace.c @@ -156,7 +156,7 @@ COMMAND_HANDLER(handle_trace_history_command) return ERROR_OK; } -int trace_register_commands(struct command_context_s *cmd_ctx) +int trace_register_commands(struct command_context *cmd_ctx) { command_t *trace_cmd = register_command(cmd_ctx, NULL, "trace", NULL, COMMAND_ANY, "trace commands"); diff --git a/src/target/trace.h b/src/target/trace.h index 483f9429..d6fd63e4 100644 --- a/src/target/trace.h +++ b/src/target/trace.h @@ -23,7 +23,7 @@ #include "types.h" struct target; -struct command_context_s; +struct command_context; struct trace_point { @@ -52,7 +52,7 @@ typedef enum trace_status } trace_status_t; int trace_point(struct target *target, uint32_t number); -int trace_register_commands(struct command_context_s *cmd_ctx); +int trace_register_commands(struct command_context *cmd_ctx); #define ERROR_TRACE_IMAGE_UNAVAILABLE -(1500) #define ERROR_TRACE_INSTRUCTION_UNAVAILABLE -(1501) diff --git a/src/target/xscale.c b/src/target/xscale.c index ccf23b49..73c1ba1c 100644 --- a/src/target/xscale.c +++ b/src/target/xscale.c @@ -146,7 +146,7 @@ static int xscale_set_reg_u32(struct reg *reg, uint32_t value) static const char xscale_not[] = "target is not an XScale"; -static int xscale_verify_pointer(struct command_context_s *cmd_ctx, +static int xscale_verify_pointer(struct command_context *cmd_ctx, struct xscale_common *xscale) { if (xscale->common_magic != XSCALE_COMMON_MAGIC) { @@ -2630,7 +2630,7 @@ static int xscale_branch_address(struct xscale_trace_data *trace_data, return 0; } -static int xscale_analyze_trace(struct target *target, command_context_t *cmd_ctx) +static int xscale_analyze_trace(struct target *target, struct command_context *cmd_ctx) { struct xscale_common *xscale = target_to_xscale(target); int next_pc_ok = 0; @@ -2860,7 +2860,7 @@ static void xscale_build_reg_cache(struct target *target) xscale->reg_cache = (*cache_p); } -static int xscale_init_target(struct command_context_s *cmd_ctx, +static int xscale_init_target(struct command_context *cmd_ctx, struct target *target) { xscale_build_reg_cache(target); @@ -3575,7 +3575,7 @@ COMMAND_HANDLER(xscale_handle_cp15) return ERROR_OK; } -static int xscale_register_commands(struct command_context_s *cmd_ctx) +static int xscale_register_commands(struct command_context *cmd_ctx) { command_t *xscale_cmd; diff --git a/src/xsvf/xsvf.c b/src/xsvf/xsvf.c index c6daf5fd..3fe2c0fd 100644 --- a/src/xsvf/xsvf.c +++ b/src/xsvf/xsvf.c @@ -1050,7 +1050,7 @@ COMMAND_HANDLER(handle_xsvf_command) return ERROR_OK; } -int xsvf_register_commands(struct command_context_s *cmd_ctx) +int xsvf_register_commands(struct command_context *cmd_ctx) { register_command(cmd_ctx, NULL, "xsvf", &handle_xsvf_command, COMMAND_EXEC, diff --git a/src/xsvf/xsvf.h b/src/xsvf/xsvf.h index 93cccf0a..2153a2dd 100644 --- a/src/xsvf/xsvf.h +++ b/src/xsvf/xsvf.h @@ -22,7 +22,7 @@ #include "command.h" -int xsvf_register_commands(struct command_context_s *cmd_ctx); +int xsvf_register_commands(struct command_context *cmd_ctx); #define ERROR_XSVF_EOF (-200) #define ERROR_XSVF_FAILED (-201)