aboutsummaryrefslogtreecommitdiff
path: root/src/target/arm720t.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
commite905fe6e756453daf27cd064285aa9cddf31b1ef (patch)
tree2c7cc285896365882295813fe668edd31a38294a /src/target/arm720t.c
parentb40f265f9cb9e6be4c979e7f4e10072822dcb5c7 (diff)
downloadriscv-openocd-e905fe6e756453daf27cd064285aa9cddf31b1ef.zip
riscv-openocd-e905fe6e756453daf27cd064285aa9cddf31b1ef.tar.gz
riscv-openocd-e905fe6e756453daf27cd064285aa9cddf31b1ef.tar.bz2
arm720t: use register_commands()
Diffstat (limited to 'src/target/arm720t.c')
-rw-r--r--src/target/arm720t.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/src/target/arm720t.c b/src/target/arm720t.c
index 4ca80e1..52a311c 100644
--- a/src/target/arm720t.c
+++ b/src/target/arm720t.c
@@ -491,23 +491,31 @@ static int arm720t_mcr(struct target *target, int cpnum, uint32_t op1, uint32_t
return arm720t_write_cp15(target, mrc_opcode(cpnum, op1, op2, CRn, CRm), value);
}
-static int arm720t_register_commands(struct command_context *cmd_ctx)
-{
- int retval;
- struct command *arm720t_cmd;
-
-
- retval = arm7_9_register_commands(cmd_ctx);
-
- arm720t_cmd = COMMAND_REGISTER(cmd_ctx, NULL, "arm720t",
- NULL, COMMAND_ANY,
- "arm720t specific commands");
+static const struct command_registration arm720t_exec_command_handlers[] = {
+ {
+ .name = "cp15",
+ .handler = arm720t_handle_cp15_command,
+ .mode = COMMAND_EXEC,
+ .usage = "<opcode> [value]",
+ .help = "display/modify cp15 register",
+ },
+ COMMAND_REGISTRATION_DONE
+};
- COMMAND_REGISTER(cmd_ctx, arm720t_cmd, "cp15",
- arm720t_handle_cp15_command, COMMAND_EXEC,
- "display/modify cp15 register <opcode> [value]");
+static const struct command_registration arm720t_command_handlers[] = {
+ {
+ .name = "arm720t",
+ .mode = COMMAND_ANY,
+ .help = "arm720t command group",
+ .chain = arm720t_exec_command_handlers,
+ },
+ COMMAND_REGISTRATION_DONE
+};
- return ERROR_OK;
+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. */