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/arm920t.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/target/arm920t.c') diff --git a/src/target/arm920t.c b/src/target/arm920t.c index 1e6019cb..e6c2eed8 100644 --- a/src/target/arm920t.c +++ b/src/target/arm920t.c @@ -1396,7 +1396,10 @@ static const struct command_registration arm920t_exec_command_handlers[] = { }, COMMAND_REGISTRATION_DONE }; -static const struct command_registration arm920t_command_handlers[] = { +const struct command_registration arm920t_command_handlers[] = { + { + .chain = arm9tdmi_command_handlers, + }, { .name = "arm920t", .mode = COMMAND_ANY, @@ -1406,13 +1409,6 @@ static const struct command_registration arm920t_command_handlers[] = { COMMAND_REGISTRATION_DONE }; -/** Registers commands to access coprocessor, cache, and MMU resources. */ -int arm920t_register_commands(struct command_context *cmd_ctx) -{ - arm9tdmi_register_commands(cmd_ctx); - return register_commands(cmd_ctx, NULL, arm920t_command_handlers); -} - /** Holds methods for ARM920 targets. */ struct target_type arm920t_target = { @@ -1452,7 +1448,7 @@ struct target_type arm920t_target = .add_watchpoint = arm7_9_add_watchpoint, .remove_watchpoint = arm7_9_remove_watchpoint, - .register_commands = arm920t_register_commands, + .commands = arm920t_command_handlers, .target_create = arm920t_target_create, .init_target = arm9tdmi_init_target, .examine = arm7_9_examine, -- cgit v1.2.3