X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Ftarget%2Farm9tdmi.c;h=87ace05606fc0dd3e8b831297a99c184823d328d;hb=df95fe25a4f01db9e131272ee72ebbf328ede428;hp=a69e49e74b2c105058d90b5489f14e5ff7b92fe5;hpb=2861877b32a7a2f4022a1c3d9b66c9b4879878ac;p=openocd diff --git a/src/target/arm9tdmi.c b/src/target/arm9tdmi.c index a69e49e7..87ace056 100644 --- a/src/target/arm9tdmi.c +++ b/src/target/arm9tdmi.c @@ -664,7 +664,7 @@ static void arm9tdmi_branch_resume_thumb(struct target *target) LOG_DEBUG("-"); struct arm7_9_common *arm7_9 = target_to_arm7_9(target); - struct armv4_5_common_s *armv4_5 = &arm7_9->armv4_5_common; + struct arm *armv4_5 = &arm7_9->armv4_5_common; struct arm_jtag *jtag_info = &arm7_9->jtag_info; struct reg *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT]; @@ -751,10 +751,9 @@ void arm9tdmi_disable_single_step(struct target *target) static void arm9tdmi_build_reg_cache(struct target *target) { struct reg_cache **cache_p = register_get_last_cache_p(&target->reg_cache); - struct armv4_5_common_s *armv4_5 = target_to_armv4_5(target); + struct arm *armv4_5 = target_to_armv4_5(target); (*cache_p) = armv4_5_build_reg_cache(target, armv4_5); - armv4_5->core_cache = (*cache_p); } int arm9tdmi_init_target(struct command_context *cmd_ctx, @@ -909,20 +908,29 @@ COMMAND_HANDLER(handle_arm9tdmi_catch_vectors_command) return ERROR_OK; } +static const struct command_registration arm9tdmi_exec_command_handlers[] = { + { + .name = "vector_catch", + .handler = handle_arm9tdmi_catch_vectors_command, + .mode = COMMAND_EXEC, + .usage = "[all|none|reset|undef|swi|pabt|dabt|irq|fiq] ...", + }, + COMMAND_REGISTRATION_DONE +}; +static const struct command_registration arm9tdmi_command_handlers[] = { + { + .name = "arm9tdmi", + .mode = COMMAND_ANY, + .help = "arm9tdmi command group", + .chain = arm9tdmi_exec_command_handlers, + }, + COMMAND_REGISTRATION_DONE +}; + int arm9tdmi_register_commands(struct command_context *cmd_ctx) { - int retval; - struct command *arm9tdmi_cmd; - - retval = arm7_9_register_commands(cmd_ctx); - arm9tdmi_cmd = register_command(cmd_ctx, NULL, "arm9", - NULL, COMMAND_ANY, - "arm9 specific commands"); - register_command(cmd_ctx, arm9tdmi_cmd, "vector_catch", - handle_arm9tdmi_catch_vectors_command, COMMAND_EXEC, - "arm9 vector_catch [all|none|reset|undef|swi|pabt|dabt|irq|fiq] ..."); - - return retval; + arm7_9_register_commands(cmd_ctx); + return register_commands(cmd_ctx, NULL, arm9tdmi_command_handlers); } /** Holds methods for ARM9TDMI targets. */