Browse Source

command_context_t -> struct command_context

Remove misleading typedef and redundant suffix from struct command_context.
tags/v0.4.0-rc1
Zachary T Welch 12 years ago
parent
commit
98723c4ecd
100 changed files with 230 additions and 230 deletions
  1. +8
    -8
      src/ecosboard.c
  2. +2
    -2
      src/flash/at91sam3.c
  3. +1
    -1
      src/flash/at91sam7.c
  4. +1
    -1
      src/flash/avrf.c
  5. +1
    -1
      src/flash/cfi.c
  6. +1
    -1
      src/flash/davinci_nand.c
  7. +3
    -3
      src/flash/ecos.c
  8. +1
    -1
      src/flash/faux.c
  9. +4
    -4
      src/flash/flash.c
  10. +4
    -4
      src/flash/flash.h
  11. +1
    -1
      src/flash/lpc2000.c
  12. +1
    -1
      src/flash/lpc2900.c
  13. +1
    -1
      src/flash/lpc3180_nand_controller.c
  14. +2
    -2
      src/flash/mflash.c
  15. +2
    -2
      src/flash/mflash.h
  16. +1
    -1
      src/flash/mx3_nand.c
  17. +3
    -3
      src/flash/nand.c
  18. +4
    -4
      src/flash/nand.h
  19. +1
    -1
      src/flash/orion_nand.c
  20. +1
    -1
      src/flash/pic32mx.c
  21. +1
    -1
      src/flash/s3c24xx_nand.c
  22. +1
    -1
      src/flash/s3c24xx_nand.h
  23. +1
    -1
      src/flash/stellaris.c
  24. +1
    -1
      src/flash/stm32x.c
  25. +1
    -1
      src/flash/str7x.c
  26. +1
    -1
      src/flash/str9x.c
  27. +1
    -1
      src/flash/str9xpec.c
  28. +1
    -1
      src/flash/tms470.c
  29. +1
    -1
      src/hello.c
  30. +20
    -20
      src/helper/command.c
  31. +19
    -19
      src/helper/command.h
  32. +1
    -1
      src/helper/configuration.c
  33. +3
    -3
      src/helper/configuration.h
  34. +1
    -1
      src/helper/ioutil.c
  35. +3
    -3
      src/helper/log.c
  36. +3
    -3
      src/helper/log.h
  37. +2
    -2
      src/helper/options.c
  38. +1
    -1
      src/jtag/amt_jtagaccel.c
  39. +4
    -4
      src/jtag/arm-jtag-ew.c
  40. +3
    -3
      src/jtag/at91rm9200.c
  41. +4
    -4
      src/jtag/core.c
  42. +2
    -2
      src/jtag/dummy.c
  43. +2
    -2
      src/jtag/ep93xx.c
  44. +1
    -1
      src/jtag/ft2232.c
  45. +1
    -1
      src/jtag/gw16012.c
  46. +1
    -1
      src/jtag/interface.h
  47. +6
    -6
      src/jtag/jlink.c
  48. +5
    -5
      src/jtag/jtag.h
  49. +1
    -1
      src/jtag/parport.c
  50. +2
    -2
      src/jtag/presto.c
  51. +2
    -2
      src/jtag/rlink/rlink.c
  52. +2
    -2
      src/jtag/tcl.c
  53. +2
    -2
      src/jtag/usbprog.c
  54. +1
    -1
      src/jtag/vsllink.c
  55. +4
    -4
      src/jtag/zy1000/zy1000.c
  56. +6
    -6
      src/openocd.c
  57. +2
    -2
      src/pld/pld.c
  58. +3
    -3
      src/pld/pld.h
  59. +1
    -1
      src/pld/virtex2.c
  60. +3
    -3
      src/server/gdb_server.c
  61. +1
    -1
      src/server/gdb_server.h
  62. +3
    -3
      src/server/server.c
  63. +3
    -3
      src/server/server.h
  64. +1
    -1
      src/server/tcl_server.c
  65. +1
    -1
      src/server/tcl_server.h
  66. +3
    -3
      src/server/telnet_server.c
  67. +1
    -1
      src/server/telnet_server.h
  68. +3
    -3
      src/svf/svf.c
  69. +1
    -1
      src/svf/svf.h
  70. +2
    -2
      src/target/arm11.c
  71. +1
    -1
      src/target/arm11.h
  72. +3
    -3
      src/target/arm720t.c
  73. +1
    -1
      src/target/arm7_9_common.c
  74. +1
    -1
      src/target/arm7_9_common.h
  75. +1
    -1
      src/target/arm7tdmi.c
  76. +1
    -1
      src/target/arm7tdmi.h
  77. +2
    -2
      src/target/arm920t.c
  78. +1
    -1
      src/target/arm920t.h
  79. +2
    -2
      src/target/arm926ejs.c
  80. +1
    -1
      src/target/arm926ejs.h
  81. +2
    -2
      src/target/arm966e.c
  82. +1
    -1
      src/target/arm966e.h
  83. +2
    -2
      src/target/arm9tdmi.c
  84. +2
    -2
      src/target/arm9tdmi.h
  85. +1
    -1
      src/target/arm_adi_v5.c
  86. +1
    -1
      src/target/arm_adi_v5.h
  87. +1
    -1
      src/target/armv4_5.c
  88. +1
    -1
      src/target/armv4_5.h
  89. +1
    -1
      src/target/armv4_5_cache.c
  90. +2
    -2
      src/target/armv4_5_cache.h
  91. +1
    -1
      src/target/armv7a.c
  92. +1
    -1
      src/target/armv7a.h
  93. +1
    -1
      src/target/armv7m.c
  94. +1
    -1
      src/target/armv7m.h
  95. +4
    -4
      src/target/avrt.c
  96. +2
    -2
      src/target/cortex_a8.c
  97. +3
    -3
      src/target/cortex_m3.c
  98. +1
    -1
      src/target/etb.c
  99. +4
    -4
      src/target/etm.c
  100. +2
    -2
      src/target/etm.h

+ 8
- 8
src/ecosboard.c View File

@@ -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);


+ 2
- 2
src/flash/at91sam3.c View File

@@ -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;



+ 1
- 1
src/flash/at91sam7.c View File

@@ -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);


+ 1
- 1
src/flash/avrf.c View File

@@ -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");


+ 1
- 1
src/flash/cfi.c View File

@@ -588,7 +588,7 @@ static int cfi_intel_info(struct flash_bank *bank, char *buf, int buf_size)
return ERROR_OK;
}

static int cfi_register_commands(struct command_context_s *cmd_ctx)
static int cfi_register_commands(struct command_context *cmd_ctx)
{
/*command_t *cfi_cmd = */
register_command(cmd_ctx, NULL, "cfi", NULL, COMMAND_ANY, "flash bank cfi <base> <size> <chip_width> <bus_width> <targetNum> [jedec_probe/x16_as_x8]");


+ 1
- 1
src/flash/davinci_nand.c View File

@@ -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;
}


+ 3
- 3
src/flash/ecos.c View File

@@ -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;
}


+ 1
- 1
src/flash/faux.c View File

@@ -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;
}


+ 4
- 4
src/flash/flash.c View File

@@ -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);


+ 4
- 4
src/flash/flash.h View File

@@ -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.


+ 1
- 1
src/flash/lpc2000.c View File

@@ -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);


+ 1
- 1
src/flash/lpc2900.c View File

@@ -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);


+ 1
- 1
src/flash/lpc3180_nand_controller.c View File

@@ -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");



+ 2
- 2
src/flash/mflash.c View File

@@ -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,


+ 2
- 2
src/flash/mflash.h View File

@@ -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)


+ 1
- 1
src/flash/mx3_nand.c View File

@@ -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;
}


+ 3
- 3
src/flash/nand.c View File

@@ -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;


+ 4
- 4
src/flash/nand.h View File

@@ -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);




+ 1
- 1
src/flash/orion_nand.c View File

@@ -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;
}


+ 1
- 1
src/flash/pic32mx.c View File

@@ -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");


+ 1
- 1
src/flash/s3c24xx_nand.c View File

@@ -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;
}


+ 1
- 1
src/flash/s3c24xx_nand.h View File

@@ -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);



+ 1
- 1
src/flash/stellaris.c View File

@@ -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");


+ 1
- 1
src/flash/stm32x.c View File

@@ -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");


+ 1
- 1
src/flash/str7x.c View File

@@ -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");


+ 1
- 1
src/flash/str9x.c View File

@@ -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");


+ 1
- 1
src/flash/str9xpec.c View File

@@ -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");


+ 1
- 1
src/flash/tms470.c View File

@@ -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");



+ 1
- 1
src/hello.c View File

@@ -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,


+ 20
- 20
src/helper/command.c View File

@@ -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);



+ 19
- 19
src/helper/command.h View File

@@ -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);



+ 1
- 1
src/helper/configuration.c View File

@@ -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;


+ 3
- 3
src/helper/configuration.h View File

@@ -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);


+ 1
- 1
src/helper/ioutil.c View File

@@ -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");


+ 3
- 3
src/helper/log.c View File

@@ -317,7 +317,7 @@ COMMAND_HANDLER(handle_log_output_command)
return ERROR_OK;
}

int log_register_commands(struct command_context_s *cmd_ctx)
int log_register_commands(struct command_context *cmd_ctx)
{
start = timeval_ms();
register_command(cmd_ctx, NULL, "log_output", handle_log_output_command,
@@ -328,7 +328,7 @@ int log_register_commands(struct command_context_s *cmd_ctx)
return ERROR_OK;
}

int log_init(struct command_context_s *cmd_ctx)
int log_init(struct command_context *cmd_ctx)
{
/* set defaults for daemon configuration, if not set by cmdline or cfgfile */
if (debug_level == -1)
@@ -344,7 +344,7 @@ int log_init(struct command_context_s *cmd_ctx)
return ERROR_OK;
}

int set_log_output(struct command_context_s *cmd_ctx, FILE *output)
int set_log_output(struct command_context *cmd_ctx, FILE *output)
{
log_output = output;
return ERROR_OK;


+ 3
- 3
src/helper/log.h View File

@@ -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);


+ 2
- 2
src/helper/options.c View File

@@ -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];


+ 1
- 1
src/jtag/amt_jtagaccel.c View File

@@ -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,


+ 4
- 4
src/jtag/arm-jtag-ew.c View File

@@ -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)
{


+ 3
- 3
src/jtag/at91rm9200.c View File

@@ -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);


+ 4
- 4
src/jtag/core.c View File

@@ -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;



+ 2
- 2
src/jtag/dummy.c View File

@@ -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;
}


+ 2
- 2
src/jtag/ep93xx.c View File

@@ -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;


+ 1
- 1
src/jtag/ft2232.c View File

@@ -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,


+ 1
- 1
src/jtag/gw16012.c View File

@@ -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,


+ 1
- 1
src/jtag/interface.h View File

@@ -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


+ 6
- 6
src/jtag/jlink.c View File

@@ -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:


+ 5
- 5
src/jtag/jtag.h View File

@@ -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


+ 1
- 1
src/jtag/parport.c View File

@@ -485,7 +485,7 @@ COMMAND_HANDLER(parport_handle_parport_toggling_time_command)
return ERROR_OK;
}

static int parport_register_commands(struct command_context_s *cmd_ctx)
static int parport_register_commands(struct command_context *cmd_ctx)
{
register_command(cmd_ctx, NULL, "parport_port",
parport_handle_parport_port_command, COMMAND_CONFIG,


+ 2
- 2
src/jtag/presto.c View File

@@ -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);


+ 2
- 2
src/jtag/rlink/rlink.c View File

@@ -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_


+ 2
- 2
src/jtag/tcl.c View File

@@ -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");


+ 2
- 2
src/jtag/usbprog.c View File

@@ -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;
}


+ 1
- 1
src/jtag/vsllink.c View File

@@ -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,


+ 4
- 4
src/jtag/zy1000/zy1000.c View File

@@ -40,12 +40,12 @@ void zy1000_reset(int trst, int srst);


int zy1000_speed(int speed);
int zy1000_register_commands(struct command_context_s *cmd_ctx);
int zy1000_register_commands(struct command_context *cmd_ctx);
int zy1000_init(void);
int zy1000_quit(void);

/* interface commands */
int zy1000_handle_zy1000_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
int zy1000_handle_zy1000_port_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc);

static int zy1000_khz(int khz, int *jtag_speed)
{
@@ -225,7 +225,7 @@ static void setPower(bool power)
}
}

int handle_power_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
int handle_power_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc)
{
if (argc > 1)
{
@@ -354,7 +354,7 @@ zylinjtag_Jim_Command_powerstatus(Jim_Interp *interp,
return JIM_OK;
}

int zy1000_register_commands(struct command_context_s *cmd_ctx)
int zy1000_register_commands(struct command_context *cmd_ctx)
{
register_command(cmd_ctx, NULL, "power", handle_power_command, COMMAND_ANY,
"power <on/off> - turn power switch to target on/off. No arguments - print status.");


+ 6
- 6
src/openocd.c View File

@@ -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();



+ 2
- 2
src/pld/pld.c View File

@@ -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");



+ 3
- 3
src/pld/pld.h View File

@@ -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);



+ 1
- 1
src/pld/virtex2.c View File

@@ -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");


+ 3
- 3
src/server/gdb_server.c View File

@@ -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,


+ 1
- 1
src/server/gdb_server.h View File

@@ -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)


+ 3
- 3
src/server/server.c View File

@@ -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,


+ 3
- 3
src/server/server.h View File

@@ -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


+ 1
- 1
src/server/tcl_server.c View File

@@ -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,


+ 1
- 1
src/server/tcl_server.h View File

@@ -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_ */

+ 3
- 3
src/server/telnet_server.c View File

@@ -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,


+ 1
- 1
src/server/telnet_server.h View File

@@ -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 */

+ 3
- 3
src/svf/svf.c View File

@@ -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,


+ 1
- 1
src/svf/svf.h View File

@@ -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.


+ 2
- 2
src/target/arm11.c View File

@@ -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;



+ 1
- 1
src/target/arm11.h View File

@@ -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);


+ 3
- 3
src/target/arm720t.c View File

@@ -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;


+ 1
- 1
src/target/arm7_9_common.c View File

@@ -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;



+ 1
- 1
src/target/arm7_9_common.h View File

@@ -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);



+ 1
- 1
src/target/arm7tdmi.c View File

@@ -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);



+ 1
- 1
src/target/arm7tdmi.h View File

@@ -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 */

+ 2
- 2
src/target/arm920t.c View File

@@ -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;


+ 1
- 1
src/target/arm920t.h View File

@@ -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 */

+ 2
- 2
src/target/arm926ejs.c View File

@@ -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)