Uses chaining of command_registration structures to eliminate all
target_type register_callback routines. Exports the command_handler
registration arrays for those target types that are used by others.
31 files changed:
COMMAND_REGISTRATION_DONE
};
static const struct command_registration arm11_command_handlers[] = {
COMMAND_REGISTRATION_DONE
};
static const struct command_registration arm11_command_handlers[] = {
+ {
+ .chain = arm_command_handlers,
+ },
+ {
+ .chain = etm_command_handlers,
+ },
{
.name = "arm11",
.mode = COMMAND_ANY,
{
.name = "arm11",
.mode = COMMAND_ANY,
COMMAND_REGISTRATION_DONE
};
COMMAND_REGISTRATION_DONE
};
-static int arm11_register_commands(struct command_context *cmd_ctx)
-{
- armv4_5_register_commands(cmd_ctx);
- etm_register_commands(cmd_ctx);
- return register_commands(cmd_ctx, NULL, arm11_command_handlers);
-}
-
/** Holds methods for ARM11xx targets. */
struct target_type arm11_target = {
.name = "arm11",
/** Holds methods for ARM11xx targets. */
struct target_type arm11_target = {
.name = "arm11",
.run_algorithm = armv4_5_run_algorithm,
.run_algorithm = armv4_5_run_algorithm,
- .register_commands = arm11_register_commands,
+ .commands = arm11_command_handlers,
.target_create = arm11_target_create,
.init_target = arm11_init_target,
.examine = arm11_examine,
.target_create = arm11_target_create,
.init_target = arm11_init_target,
.examine = arm11_examine,
};
static const struct command_registration arm720t_command_handlers[] = {
};
static const struct command_registration arm720t_command_handlers[] = {
+ {
+ .chain = arm7_9_command_handlers,
+ },
{
.name = "arm720t",
.mode = COMMAND_ANY,
{
.name = "arm720t",
.mode = COMMAND_ANY,
COMMAND_REGISTRATION_DONE
};
COMMAND_REGISTRATION_DONE
};
-static int arm720t_register_commands(struct command_context *cmd_ctx)
-{
- arm7_9_register_commands(cmd_ctx);
- return register_commands(cmd_ctx, NULL, arm720t_command_handlers);
-}
-
/** Holds methods for ARM720 targets. */
struct target_type arm720t_target =
{
/** Holds methods for ARM720 targets. */
struct target_type arm720t_target =
{
.add_watchpoint = arm7_9_add_watchpoint,
.remove_watchpoint = arm7_9_remove_watchpoint,
.add_watchpoint = arm7_9_add_watchpoint,
.remove_watchpoint = arm7_9_remove_watchpoint,
- .register_commands = arm720t_register_commands,
+ .commands = arm720t_command_handlers,
.target_create = arm720t_target_create,
.init_target = arm720t_init_target,
.examine = arm7_9_examine,
.target_create = arm720t_target_create,
.init_target = arm720t_init_target,
.examine = arm7_9_examine,
},
COMMAND_REGISTRATION_DONE
};
},
COMMAND_REGISTRATION_DONE
};
-static const struct command_registration arm7_9_command_handlers[] = {
+const struct command_registration arm7_9_command_handlers[] = {
+ {
+ .chain = arm_command_handlers,
+ },
+ {
+ .chain = etm_command_handlers,
+ },
{
.name = "arm7_9",
.mode = COMMAND_ANY,
{
.name = "arm7_9",
.mode = COMMAND_ANY,
},
COMMAND_REGISTRATION_DONE
};
},
COMMAND_REGISTRATION_DONE
};
-
-int arm7_9_register_commands(struct command_context *cmd_ctx)
-{
- armv4_5_register_commands(cmd_ctx);
- etm_register_commands(cmd_ctx);
- return register_commands(cmd_ctx, NULL, arm7_9_command_handlers);
-}
return arm7_9->common_magic == ARM7_9_COMMON_MAGIC;
}
return arm7_9->common_magic == ARM7_9_COMMON_MAGIC;
}
-int arm7_9_register_commands(struct command_context *cmd_ctx);
+extern const struct command_registration arm7_9_command_handlers[];
int arm7_9_poll(struct target *target);
int arm7_9_poll(struct target *target);
.add_watchpoint = arm7_9_add_watchpoint,
.remove_watchpoint = arm7_9_remove_watchpoint,
.add_watchpoint = arm7_9_add_watchpoint,
.remove_watchpoint = arm7_9_remove_watchpoint,
- .register_commands = arm7_9_register_commands,
+ .commands = arm7_9_command_handlers,
.target_create = arm7tdmi_target_create,
.init_target = arm7tdmi_init_target,
.examine = arm7_9_examine,
.target_create = arm7tdmi_target_create,
.init_target = arm7tdmi_init_target,
.examine = arm7_9_examine,
},
COMMAND_REGISTRATION_DONE
};
},
COMMAND_REGISTRATION_DONE
};
-static const struct command_registration arm920t_command_handlers[] = {
+const struct command_registration arm920t_command_handlers[] = {
+ {
+ .chain = arm9tdmi_command_handlers,
+ },
{
.name = "arm920t",
.mode = COMMAND_ANY,
{
.name = "arm920t",
.mode = COMMAND_ANY,
COMMAND_REGISTRATION_DONE
};
COMMAND_REGISTRATION_DONE
};
-/** Registers commands to access coprocessor, cache, and MMU resources. */
-int arm920t_register_commands(struct command_context *cmd_ctx)
-{
- arm9tdmi_register_commands(cmd_ctx);
- return register_commands(cmd_ctx, NULL, arm920t_command_handlers);
-}
-
/** Holds methods for ARM920 targets. */
struct target_type arm920t_target =
{
/** Holds methods for ARM920 targets. */
struct target_type arm920t_target =
{
.add_watchpoint = arm7_9_add_watchpoint,
.remove_watchpoint = arm7_9_remove_watchpoint,
.add_watchpoint = arm7_9_add_watchpoint,
.remove_watchpoint = arm7_9_remove_watchpoint,
- .register_commands = arm920t_register_commands,
+ .commands = arm920t_command_handlers,
.target_create = arm920t_target_create,
.init_target = arm9tdmi_init_target,
.examine = arm7_9_examine,
.target_create = arm920t_target_create,
.init_target = arm9tdmi_init_target,
.examine = arm7_9_examine,
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 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 *cmd_ctx);
+
+extern const struct command_registration arm920t_command_handlers[];
},
COMMAND_REGISTRATION_DONE
};
},
COMMAND_REGISTRATION_DONE
};
-static const struct command_registration arm926ejs_command_handlers[] = {
+const struct command_registration arm926ejs_command_handlers[] = {
+ {
+ .chain = arm9tdmi_command_handlers,
+ },
{
.name = "arm926ejs",
.mode = COMMAND_ANY,
{
.name = "arm926ejs",
.mode = COMMAND_ANY,
COMMAND_REGISTRATION_DONE
};
COMMAND_REGISTRATION_DONE
};
-/** Registers commands to access coprocessor, cache, and debug resources. */
-int arm926ejs_register_commands(struct command_context *cmd_ctx)
-{
- arm9tdmi_register_commands(cmd_ctx);
- return register_commands(cmd_ctx, NULL, arm926ejs_command_handlers);
-}
-
/** Holds methods for ARM926 targets. */
struct target_type arm926ejs_target =
{
/** Holds methods for ARM926 targets. */
struct target_type arm926ejs_target =
{
.add_watchpoint = arm7_9_add_watchpoint,
.remove_watchpoint = arm7_9_remove_watchpoint,
.add_watchpoint = arm7_9_add_watchpoint,
.remove_watchpoint = arm7_9_remove_watchpoint,
- .register_commands = arm926ejs_register_commands,
+ .commands = arm926ejs_command_handlers,
.target_create = arm926ejs_target_create,
.init_target = arm9tdmi_init_target,
.examine = arm7_9_examine,
.target_create = arm926ejs_target_create,
.init_target = arm9tdmi_init_target,
.examine = arm7_9_examine,
int arm926ejs_init_arch_info(struct target *target,
struct arm926ejs_common *arm926ejs, struct jtag_tap *tap);
int arm926ejs_init_arch_info(struct target *target,
struct arm926ejs_common *arm926ejs, struct jtag_tap *tap);
-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);
int arm926ejs_soft_reset_halt(struct target *target);
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);
int arm926ejs_soft_reset_halt(struct target *target);
+extern const struct command_registration arm926ejs_command_handlers[];
+
COMMAND_REGISTRATION_DONE
};
COMMAND_REGISTRATION_DONE
};
-static const struct command_registration arm966e_command_handlers[] = {
+const struct command_registration arm966e_command_handlers[] = {
+ {
+ .chain = arm9tdmi_command_handlers,
+ },
{
.name = "arm966e",
.mode = COMMAND_ANY,
{
.name = "arm966e",
.mode = COMMAND_ANY,
COMMAND_REGISTRATION_DONE
};
COMMAND_REGISTRATION_DONE
};
-/** Registers commands used to access coprocessor resources. */
-int arm966e_register_commands(struct command_context *cmd_ctx)
-{
- arm9tdmi_register_commands(cmd_ctx);
- return register_commands(cmd_ctx, NULL, arm966e_command_handlers);
-}
-
/** Holds methods for ARM966 targets. */
struct target_type arm966e_target =
{
/** Holds methods for ARM966 targets. */
struct target_type arm966e_target =
{
.add_watchpoint = arm7_9_add_watchpoint,
.remove_watchpoint = arm7_9_remove_watchpoint,
.add_watchpoint = arm7_9_add_watchpoint,
.remove_watchpoint = arm7_9_remove_watchpoint,
- .register_commands = arm966e_register_commands,
+ .commands = arm966e_command_handlers,
.target_create = arm966e_target_create,
.init_target = arm9tdmi_init_target,
.examine = arm7_9_examine,
.target_create = arm966e_target_create,
.init_target = arm9tdmi_init_target,
.examine = arm7_9_examine,
int arm966e_init_arch_info(struct target *target,
struct arm966e_common *arm966e, struct jtag_tap *tap);
int arm966e_init_arch_info(struct target *target,
struct arm966e_common *arm966e, struct jtag_tap *tap);
-int arm966e_register_commands(struct command_context *cmd_ctx);
int arm966e_write_cp15(struct target *target, int reg_addr, uint32_t value);
int arm966e_write_cp15(struct target *target, int reg_addr, uint32_t value);
+extern const struct command_registration arm966e_command_handlers[];
+
},
COMMAND_REGISTRATION_DONE
};
},
COMMAND_REGISTRATION_DONE
};
-static const struct command_registration arm9tdmi_command_handlers[] = {
+const struct command_registration arm9tdmi_command_handlers[] = {
+ {
+ .chain = arm7_9_command_handlers,
+ },
{
.name = "arm9tdmi",
.mode = COMMAND_ANY,
{
.name = "arm9tdmi",
.mode = COMMAND_ANY,
COMMAND_REGISTRATION_DONE
};
COMMAND_REGISTRATION_DONE
};
-int arm9tdmi_register_commands(struct command_context *cmd_ctx)
-{
- arm7_9_register_commands(cmd_ctx);
- return register_commands(cmd_ctx, NULL, arm9tdmi_command_handlers);
-}
-
/** Holds methods for ARM9TDMI targets. */
struct target_type arm9tdmi_target =
{
/** Holds methods for ARM9TDMI targets. */
struct target_type arm9tdmi_target =
{
.add_watchpoint = arm7_9_add_watchpoint,
.remove_watchpoint = arm7_9_remove_watchpoint,
.add_watchpoint = arm7_9_add_watchpoint,
.remove_watchpoint = arm7_9_remove_watchpoint,
- .register_commands = arm9tdmi_register_commands,
+ .commands = arm9tdmi_command_handlers,
.target_create = arm9tdmi_target_create,
.init_target = arm9tdmi_init_target,
.examine = arm7_9_examine,
.target_create = arm9tdmi_target_create,
.init_target = arm9tdmi_init_target,
.examine = arm7_9_examine,
struct target *target);
int arm9tdmi_init_arch_info(struct target *target,
struct arm7_9_common *arm7_9, struct jtag_tap *tap);
struct target *target);
int arm9tdmi_init_arch_info(struct target *target,
struct arm7_9_common *arm7_9, struct jtag_tap *tap);
-int arm9tdmi_register_commands(struct command_context *cmd_ctx);
+extern const struct command_registration arm9tdmi_command_handlers[];
int arm9tdmi_clock_out(struct arm_jtag *jtag_info,
uint32_t instr, uint32_t out, uint32_t *in, int sysspeed);
int arm9tdmi_clock_out(struct arm_jtag *jtag_info,
uint32_t instr, uint32_t out, uint32_t *in, int sysspeed);
},
COMMAND_REGISTRATION_DONE
};
},
COMMAND_REGISTRATION_DONE
};
-static const struct command_registration arm_command_handlers[] = {
+const struct command_registration arm_command_handlers[] = {
{
.name = "arm",
.mode = COMMAND_ANY,
{
.name = "arm",
.mode = COMMAND_ANY,
COMMAND_REGISTRATION_DONE
};
COMMAND_REGISTRATION_DONE
};
-int armv4_5_register_commands(struct command_context *cmd_ctx)
-{
- return register_commands(cmd_ctx, NULL, arm_command_handlers);
-}
-
int armv4_5_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int *reg_list_size)
{
struct arm *armv4_5 = target_to_armv4_5(target);
int armv4_5_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int *reg_list_size)
{
struct arm *armv4_5 = target_to_armv4_5(target);
#define ARMV4_5_H
#include "target.h"
#define ARMV4_5_H
#include "target.h"
typedef enum armv4_5_mode
{
typedef enum armv4_5_mode
{
int armv4_5_get_gdb_reg_list(struct target *target,
struct reg **reg_list[], int *reg_list_size);
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 *cmd_ctx);
+extern const struct command_registration arm_command_handlers[];
+
int armv4_5_init_arch_info(struct target *target, struct arm *armv4_5);
int armv4_5_run_algorithm(struct target *target,
int armv4_5_init_arch_info(struct target *target, struct arm *armv4_5);
int armv4_5_run_algorithm(struct target *target,
},
COMMAND_REGISTRATION_DONE
};
},
COMMAND_REGISTRATION_DONE
};
-static const struct command_registration armv7a_command_handlers[] = {
+const struct command_registration armv7a_command_handlers[] = {
{
.name = "dap",
.mode = COMMAND_ANY,
{
.name = "dap",
.mode = COMMAND_ANY,
COMMAND_REGISTRATION_DONE
};
COMMAND_REGISTRATION_DONE
};
-int armv7a_register_commands(struct command_context *cmd_ctx)
-{
- return register_commands(cmd_ctx, NULL, armv7a_command_handlers);
-}
int armv7a_arch_state(struct target *target);
struct reg_cache *armv7a_build_reg_cache(struct target *target,
struct armv7a_common *armv7a_common);
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 *cmd_ctx);
int armv7a_init_arch_info(struct target *target, struct armv7a_common *armv7a);
int armv7a_init_arch_info(struct target *target, struct armv7a_common *armv7a);
+extern const struct command_registration armv7a_command_handlers[];
+
},
COMMAND_REGISTRATION_DONE
};
},
COMMAND_REGISTRATION_DONE
};
-static const struct command_registration armv7m_command_handlers[] = {
+const struct command_registration armv7m_command_handlers[] = {
{
.name = "dap",
.mode = COMMAND_ANY,
{
.name = "dap",
.mode = COMMAND_ANY,
},
COMMAND_REGISTRATION_DONE
};
},
COMMAND_REGISTRATION_DONE
};
-
-int armv7m_register_commands(struct command_context *cmd_ctx)
-{
- return register_commands(cmd_ctx, NULL, armv7m_command_handlers);
-}
int armv7m_get_gdb_reg_list(struct target *target,
struct reg **reg_list[], int *reg_list_size);
int armv7m_get_gdb_reg_list(struct target *target,
struct reg **reg_list[], int *reg_list_size);
-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,
int armv7m_init_arch_info(struct target *target, struct armv7m_common *armv7m);
int armv7m_run_algorithm(struct target *target,
int armv7m_blank_check_memory(struct target *target,
uint32_t address, uint32_t count, uint32_t* blank);
int armv7m_blank_check_memory(struct target *target,
uint32_t address, uint32_t count, uint32_t* blank);
+extern const struct command_registration armv7m_command_handlers[];
+
/* Thumb mode instructions
*/
/* Thumb mode instructions
*/
#define AVR_JTAG_INS_LEN 4
#define AVR_JTAG_INS_LEN 4
-/* cli handling */
-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 *cmd_ctx, struct target *target);
/* forward declarations */
int avr_target_create(struct target *target, Jim_Interp *interp);
int avr_init_target(struct command_context *cmd_ctx, struct target *target);
.add_watchpoint = avr_add_watchpoint,
.remove_watchpoint = avr_remove_watchpoint,
*/
.add_watchpoint = avr_add_watchpoint,
.remove_watchpoint = avr_remove_watchpoint,
*/
- .register_commands = avr_register_commands,
.target_create = avr_target_create,
.init_target = avr_init_target,
};
.target_create = avr_target_create,
.init_target = avr_init_target,
};
-int avr_register_commands(struct command_context *cmd_ctx)
-{
- LOG_DEBUG("%s", __FUNCTION__);
- return ERROR_OK;
-}
-
int avr_target_create(struct target *target, Jim_Interp *interp)
{
struct avr_common *avr = calloc(1, sizeof(struct avr_common));
int avr_target_create(struct target *target, Jim_Interp *interp)
{
struct avr_common *avr = calloc(1, sizeof(struct avr_common));
COMMAND_REGISTRATION_DONE
};
static const struct command_registration cortex_a8_command_handlers[] = {
COMMAND_REGISTRATION_DONE
};
static const struct command_registration cortex_a8_command_handlers[] = {
+ {
+ .chain = arm_command_handlers,
+ },
+ {
+ .chain = armv7a_command_handlers,
+ },
{
.name = "cortex_a8",
.mode = COMMAND_ANY,
{
.name = "cortex_a8",
.mode = COMMAND_ANY,
COMMAND_REGISTRATION_DONE
};
COMMAND_REGISTRATION_DONE
};
-static int cortex_a8_register_commands(struct command_context *cmd_ctx)
-{
- armv4_5_register_commands(cmd_ctx);
- armv7a_register_commands(cmd_ctx);
- return register_commands(cmd_ctx, NULL, cortex_a8_command_handlers);
-}
-
struct target_type cortexa8_target = {
.name = "cortex_a8",
struct target_type cortexa8_target = {
.name = "cortex_a8",
.add_watchpoint = NULL,
.remove_watchpoint = NULL,
.add_watchpoint = NULL,
.remove_watchpoint = NULL,
- .register_commands = cortex_a8_register_commands,
+ .commands = cortex_a8_command_handlers,
.target_create = cortex_a8_target_create,
.init_target = cortex_a8_init_target,
.examine = cortex_a8_examine,
.target_create = cortex_a8_target_create,
.init_target = cortex_a8_init_target,
.examine = cortex_a8_examine,
COMMAND_REGISTRATION_DONE
};
static const struct command_registration cortex_m3_command_handlers[] = {
COMMAND_REGISTRATION_DONE
};
static const struct command_registration cortex_m3_command_handlers[] = {
+ {
+ .chain = arm_command_handlers,
+ },
+ {
+ .chain = armv7m_command_handlers,
+ },
{
.name = "cortex_m3",
.mode = COMMAND_ANY,
{
.name = "cortex_m3",
.mode = COMMAND_ANY,
COMMAND_REGISTRATION_DONE
};
COMMAND_REGISTRATION_DONE
};
-static int cortex_m3_register_commands(struct command_context *cmd_ctx)
-{
- armv7m_register_commands(cmd_ctx);
- return register_commands(cmd_ctx, NULL, cortex_m3_command_handlers);
-}
-
struct target_type cortexm3_target =
{
.name = "cortex_m3",
struct target_type cortexm3_target =
{
.name = "cortex_m3",
.add_watchpoint = cortex_m3_add_watchpoint,
.remove_watchpoint = cortex_m3_remove_watchpoint,
.add_watchpoint = cortex_m3_add_watchpoint,
.remove_watchpoint = cortex_m3_remove_watchpoint,
- .register_commands = cortex_m3_register_commands,
+ .commands = cortex_m3_command_handlers,
.target_create = cortex_m3_target_create,
.init_target = cortex_m3_init_target,
.examine = cortex_m3_examine,
.target_create = cortex_m3_target_create,
.init_target = cortex_m3_init_target,
.examine = cortex_m3_examine,
},
COMMAND_REGISTRATION_DONE
};
},
COMMAND_REGISTRATION_DONE
};
-static const struct command_registration etm_command_handlers[] = {
+const struct command_registration etm_command_handlers[] = {
{
.name = "etm",
.mode = COMMAND_ANY,
{
.name = "etm",
.mode = COMMAND_ANY,
COMMAND_REGISTRATION_DONE
};
COMMAND_REGISTRATION_DONE
};
-int etm_register_commands(struct command_context *cmd_ctx)
-{
- return register_commands(cmd_ctx, NULL, etm_command_handlers);
-}
-
static const struct command_registration etm_exec_command_handlers[] = {
{
.name = "tracemode", handle_etm_tracemode_command,
static const struct command_registration etm_exec_command_handlers[] = {
{
.name = "tracemode", handle_etm_tracemode_command,
int etm_setup(struct target *target);
int etm_setup(struct target *target);
-int etm_register_commands(struct command_context *cmd_ctx);
+extern const struct command_registration etm_command_handlers[];
#define ERROR_ETM_INVALID_DRIVER (-1300)
#define ERROR_ETM_PORTMODE_NOT_SUPPORTED (-1301)
#define ERROR_ETM_INVALID_DRIVER (-1300)
#define ERROR_ETM_PORTMODE_NOT_SUPPORTED (-1301)
.add_watchpoint = arm7_9_add_watchpoint,
.remove_watchpoint = arm7_9_remove_watchpoint,
.add_watchpoint = arm7_9_add_watchpoint,
.remove_watchpoint = arm7_9_remove_watchpoint,
- .register_commands = arm920t_register_commands,
+ .commands = arm920t_command_handlers,
.target_create = fa526_target_create,
.init_target = arm9tdmi_init_target,
.examine = arm7_9_examine,
.target_create = fa526_target_create,
.init_target = arm9tdmi_init_target,
.examine = arm7_9_examine,
.add_watchpoint = arm7_9_add_watchpoint,
.remove_watchpoint = arm7_9_remove_watchpoint,
.add_watchpoint = arm7_9_add_watchpoint,
.remove_watchpoint = arm7_9_remove_watchpoint,
- .register_commands = arm926ejs_register_commands,
+ .commands = arm926ejs_command_handlers,
.target_create = feroceon_target_create,
.init_target = feroceon_init_target,
.examine = feroceon_examine,
.target_create = feroceon_target_create,
.init_target = feroceon_init_target,
.examine = feroceon_examine,
.add_watchpoint = arm7_9_add_watchpoint,
.remove_watchpoint = arm7_9_remove_watchpoint,
.add_watchpoint = arm7_9_add_watchpoint,
.remove_watchpoint = arm7_9_remove_watchpoint,
- .register_commands = arm966e_register_commands,
+ .commands = arm966e_command_handlers,
.target_create = dragonite_target_create,
.init_target = feroceon_init_target,
.examine = feroceon_examine,
.target_create = dragonite_target_create,
.init_target = feroceon_init_target,
.examine = feroceon_examine,
-int mips32_register_commands(struct command_context *cmd_ctx)
-{
- return ERROR_OK;
-}
-
int mips32_run_algorithm(struct target *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info)
{
/*TODO*/
int mips32_run_algorithm(struct target *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info)
{
/*TODO*/
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_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 *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_init_target(struct command_context *cmd_ctx, struct target *target);
int mips_m4k_target_create(struct target *target, Jim_Interp *interp);
.add_watchpoint = mips_m4k_add_watchpoint,
.remove_watchpoint = mips_m4k_remove_watchpoint,
.add_watchpoint = mips_m4k_add_watchpoint,
.remove_watchpoint = mips_m4k_remove_watchpoint,
- .register_commands = mips_m4k_register_commands,
.target_create = mips_m4k_target_create,
.init_target = mips_m4k_init_target,
.examine = mips_m4k_examine,
.target_create = mips_m4k_target_create,
.init_target = mips_m4k_init_target,
.examine = mips_m4k_examine,
return mips32_dmaacc_write_mem(ejtag_info, address, size, count, (void *)buffer);
}
return mips32_dmaacc_write_mem(ejtag_info, address, size, count, (void *)buffer);
}
-int mips_m4k_register_commands(struct command_context *cmd_ctx)
-{
- int retval;
-
- retval = mips32_register_commands(cmd_ctx);
- return retval;
-}
-
int mips_m4k_init_target(struct command_context *cmd_ctx, struct target *target)
{
mips32_build_reg_cache(target);
int mips_m4k_init_target(struct command_context *cmd_ctx, struct target *target)
{
mips32_build_reg_cache(target);
if (!target->variant)
target->variant = strdup("");
if (!target->variant)
target->variant = strdup("");
+ cp = Jim_GetString(new_cmd, NULL);
+ target->cmd_name = strdup(cp);
+
/* create the target specific commands */
/* create the target specific commands */
- if (target->type->register_commands) {
- (*(target->type->register_commands))(cmd_ctx);
+ if (target->type->commands) {
+ e = register_commands(cmd_ctx, NULL, target->type->commands);
+ if (ERROR_OK != e)
+ LOG_ERROR("unable to register '%s' commands", cp);
}
if (target->type->target_create) {
(*(target->type->target_create))(target, goi->interp);
}
if (target->type->target_create) {
(*(target->type->target_create))(target, goi->interp);
- cp = Jim_GetString(new_cmd, NULL);
- target->cmd_name = strdup(cp);
-
/* now - create the new target name command */
e = Jim_CreateCommand(goi->interp,
/* name */
/* now - create the new target name command */
e = Jim_CreateCommand(goi->interp,
/* name */
*/
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 (*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 *cmd_ctx);
+ const struct command_registration *commands;
/* called when target is created */
int (*target_create)(struct target *target, Jim_Interp *interp);
/* called when target is created */
int (*target_create)(struct target *target, Jim_Interp *interp);
COMMAND_REGISTRATION_DONE
};
static const struct command_registration xscale_command_handlers[] = {
COMMAND_REGISTRATION_DONE
};
static const struct command_registration xscale_command_handlers[] = {
+ {
+ .chain = arm_command_handlers,
+ },
{
.name = "xscale",
.mode = COMMAND_ANY,
{
.name = "xscale",
.mode = COMMAND_ANY,
COMMAND_REGISTRATION_DONE
};
COMMAND_REGISTRATION_DONE
};
-static int xscale_register_commands(struct command_context *cmd_ctx)
-{
-
- armv4_5_register_commands(cmd_ctx);
-
- return ERROR_OK;
-}
-
struct target_type xscale_target =
{
.name = "xscale",
struct target_type xscale_target =
{
.name = "xscale",
.add_watchpoint = xscale_add_watchpoint,
.remove_watchpoint = xscale_remove_watchpoint,
.add_watchpoint = xscale_add_watchpoint,
.remove_watchpoint = xscale_remove_watchpoint,
- .register_commands = xscale_register_commands,
+ .commands = xscale_command_handlers,
.target_create = xscale_target_create,
.init_target = xscale_init_target,
.target_create = xscale_target_create,
.init_target = xscale_init_target,
Linking to existing account procedure
If you already have an account and want to add another login method
you
MUST first sign in with your existing account and
then change URL to read
https://review.openocd.org/login/?link
to get to this page again but this time it'll work for linking. Thank you.
SSH host keys fingerprints
1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=.. |
|+o.. . |
|*.o . . |
|+B . . . |
|Bo. = o S |
|Oo.+ + = |
|oB=.* = . o |
| =+=.+ + E |
|. .=o . o |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)