From 66ee303456910f684244a20a0ac2e958d40b78cb Mon Sep 17 00:00:00 2001 From: Zachary T Welch Date: Mon, 23 Nov 2009 08:17:01 -0800 Subject: 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. --- src/target/arm720t.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/target/arm720t.c') diff --git a/src/target/arm720t.c b/src/target/arm720t.c index 52a311c4..bae2561a 100644 --- a/src/target/arm720t.c +++ b/src/target/arm720t.c @@ -503,6 +503,9 @@ static const struct command_registration arm720t_exec_command_handlers[] = { }; static const struct command_registration arm720t_command_handlers[] = { + { + .chain = arm7_9_command_handlers, + }, { .name = "arm720t", .mode = COMMAND_ANY, @@ -512,12 +515,6 @@ static const struct command_registration arm720t_command_handlers[] = { 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 = { @@ -555,7 +552,7 @@ struct target_type arm720t_target = .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, -- cgit v1.2.3