aboutsummaryrefslogtreecommitdiff
path: root/src/target/arm9tdmi.c
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-23 07:43:05 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-24 21:37:35 -0800
commitd1eca9a74c7c57ba6a3210c51b2a10cc5adb22e1 (patch)
treec39bbed9daf9dd0845803d28e79b7dbd495b32ec /src/target/arm9tdmi.c
parent69908ddbd04fc9382d02819e296bb4384ef78810 (diff)
downloadriscv-openocd-d1eca9a74c7c57ba6a3210c51b2a10cc5adb22e1.zip
riscv-openocd-d1eca9a74c7c57ba6a3210c51b2a10cc5adb22e1.tar.gz
riscv-openocd-d1eca9a74c7c57ba6a3210c51b2a10cc5adb22e1.tar.bz2
arm9tdmi: use register_commands()
Diffstat (limited to 'src/target/arm9tdmi.c')
-rw-r--r--src/target/arm9tdmi.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/target/arm9tdmi.c b/src/target/arm9tdmi.c
index f965429..87ace05 100644
--- a/src/target/arm9tdmi.c
+++ b/src/target/arm9tdmi.c
@@ -908,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 = COMMAND_REGISTER(cmd_ctx, NULL, "arm9",
- NULL, COMMAND_ANY,
- "arm9 specific commands");
- COMMAND_REGISTER(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. */