summaryrefslogtreecommitdiff
path: root/src/target/cortex_m3.c
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-23 08:17:01 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-24 21:37:36 -0800
commit66ee303456910f684244a20a0ac2e958d40b78cb (patch)
tree3a5f06b0ee9e3978ebc9d836aac622b752e251ad /src/target/cortex_m3.c
parent144e3678bd2d518388b6c2d7f3d2a912a9ac2abd (diff)
downloadopenocd+libswd-66ee303456910f684244a20a0ac2e958d40b78cb.tar.gz
openocd+libswd-66ee303456910f684244a20a0ac2e958d40b78cb.tar.bz2
openocd+libswd-66ee303456910f684244a20a0ac2e958d40b78cb.tar.xz
openocd+libswd-66ee303456910f684244a20a0ac2e958d40b78cb.zip
remove target_type register_command callback
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.
Diffstat (limited to 'src/target/cortex_m3.c')
-rw-r--r--src/target/cortex_m3.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/target/cortex_m3.c b/src/target/cortex_m3.c
index be81af98..7cfe540a 100644
--- a/src/target/cortex_m3.c
+++ b/src/target/cortex_m3.c
@@ -1938,6 +1938,12 @@ static const struct command_registration cortex_m3_exec_command_handlers[] = {
};
static const struct command_registration cortex_m3_command_handlers[] = {
{
+ .chain = arm_command_handlers,
+ },
+ {
+ .chain = armv7m_command_handlers,
+ },
+ {
.name = "cortex_m3",
.mode = COMMAND_ANY,
.help = "Cortex-M3 command group",
@@ -1946,12 +1952,6 @@ static const struct command_registration cortex_m3_command_handlers[] = {
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",
@@ -1984,7 +1984,7 @@ struct target_type cortexm3_target =
.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,