Remove misleading typedef and redundant suffix from struct command_context.
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);
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);
#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();
externC void phi_init_all_network_interfaces(void);
-command_context_t *cmd_ctx;
+struct command_context *cmd_ctx;
static bool webRunning = false;
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;
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";
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[])
{
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);
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;
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;
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);
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");
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]");
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;
}
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
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);
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;
}
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;
}
}
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);
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)) {
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");
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);
*
* @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
};
/// 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.
* @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.
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);
/**
* 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);
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");
}
}
-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);
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,
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)
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;
}
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");
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;
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;
{
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);
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);
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;
}
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");
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;
}
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);
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");
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");
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");
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");
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");
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");
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,
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,
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)
{
/* 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;
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)
{
return c;
}
-int unregister_all_commands(command_context_t *context)
+int unregister_all_commands(struct command_context *context)
{
command_t *c, *c2;
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;
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;
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;
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;
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
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;
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;
}
-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;
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;
#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);
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;
*/
command_output_handler_t output_handler;
void *output_handler_priv;
-} command_context_t;
+};
/**
* 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)
/**
*/
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);
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);
}
}
-int parse_config_file(struct command_context_s *cmd_ctx)
+int parse_config_file(struct command_context *cmd_ctx)
{
int retval;
char **cfg;
#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);
-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");
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,
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)
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;
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);
{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);
#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];
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,
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);
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");
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)
{
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);
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;
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);
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;
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;
}
-int jtag_init_reset(struct command_context_s *cmd_ctx)
+int jtag_init_reset(struct command_context *cmd_ctx)
{
int retval;
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;
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);
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;
}
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);
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;
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,
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,
* @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
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);
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",
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)
{
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:
* 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);
* 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
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,
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);
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);
static
int
handle_dtc_directory_command(
- struct command_context_s *cmd_ctx,
+ struct command_context *cmd_ctx,
char *cmd,
char **args,
int argc
static
-int rlink_register_commands(struct command_context_s *cmd_ctx)
+int rlink_register_commands(struct command_context *cmd_ctx)
{
#ifdef _DEBUG_JTAG_IO_
int e;
Jim_Nvp *n;
Jim_Obj *o;
- struct command_context_s *context;
+ struct command_context *context;
enum {
JTAG_CMD_INTERFACE,
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");
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);
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;
}
}
#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,
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)
{
}
}
-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)
{
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.");
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)
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();
int ret;
/* initialize commandline interface */
- command_context_t *cmd_ctx;
+ struct command_context *cmd_ctx;
cmd_ctx = setup_command_handler();
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;
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");
{
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);
};
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);
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");
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);
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,"))
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,
};
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)
/* 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;
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;
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,
{
int fd;
struct sockaddr_in sin;
- command_context_t *cmd_ctx;
+ struct command_context *cmd_ctx;
struct service *service;
int input_pending;
void *priv;
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
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,
#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_ */
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;
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);
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,
};
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 */
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;
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;
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,
#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.
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 */
};
-int arm11_register_commands(struct command_context_s *cmd_ctx)
+int arm11_register_commands(struct command_context *cmd_ctx)
{
FNC_INFO;
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);
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) {
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);
}
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, 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;
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);
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);
};
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 */
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) {
}
/** 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;
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 */
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) {
}
/** 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;
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);
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) {
}
/** 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;
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 */
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);
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;
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);
&& ((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;
/* 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) \
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;
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,
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)
{
#include "types.h"
-struct command_context_s;
+struct command_context;
struct armv4_5_cachesize
{
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
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;
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 */
}
/** 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;
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,
#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);
.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;
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;
}
-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);
}
-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;
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);
/*--------------------------------------------------------------------------*/
-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) {
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;
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");
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);
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;
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");
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: "
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);
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)
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;
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;
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;
}
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,
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);
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;
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);
*/
-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)
{
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;
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);
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;
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;
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)
{
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;
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);
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");
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");
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 {
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) {
{
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 {
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;
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",
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)
struct reg;
struct trace;
-struct command_context_s;
+struct command_context;
/**
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(
*/
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);
/**
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;
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;
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;
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");
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 */
*/
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);
* 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).
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");
#include "types.h"
struct target;
-struct command_context_s;
+struct command_context;
struct trace_point
{
} 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)
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) {
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;
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);
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;
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,
#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)