diff options
author | Zachary T Welch <zw@superlucidity.net> | 2009-11-23 08:17:01 -0800 |
---|---|---|
committer | Zachary T Welch <zw@superlucidity.net> | 2009-11-24 21:37:36 -0800 |
commit | 66ee303456910f684244a20a0ac2e958d40b78cb (patch) | |
tree | 3a5f06b0ee9e3978ebc9d836aac622b752e251ad /src/target/arm11.c | |
parent | 144e3678bd2d518388b6c2d7f3d2a912a9ac2abd (diff) | |
download | riscv-openocd-66ee303456910f684244a20a0ac2e958d40b78cb.zip riscv-openocd-66ee303456910f684244a20a0ac2e958d40b78cb.tar.gz riscv-openocd-66ee303456910f684244a20a0ac2e958d40b78cb.tar.bz2 |
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/arm11.c')
-rw-r--r-- | src/target/arm11.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/target/arm11.c b/src/target/arm11.c index 835234c..7c6d39c 100644 --- a/src/target/arm11.c +++ b/src/target/arm11.c @@ -1617,6 +1617,12 @@ static const struct command_registration arm11_any_command_handlers[] = { }; static const struct command_registration arm11_command_handlers[] = { { + .chain = arm_command_handlers, + }, + { + .chain = etm_command_handlers, + }, + { .name = "arm11", .mode = COMMAND_ANY, .help = "ARM11 command group", @@ -1625,13 +1631,6 @@ static const struct command_registration arm11_command_handlers[] = { COMMAND_REGISTRATION_DONE }; -static int arm11_register_commands(struct command_context *cmd_ctx) -{ - armv4_5_register_commands(cmd_ctx); - etm_register_commands(cmd_ctx); - return register_commands(cmd_ctx, NULL, arm11_command_handlers); -} - /** Holds methods for ARM11xx targets. */ struct target_type arm11_target = { .name = "arm11", @@ -1666,7 +1665,7 @@ struct target_type arm11_target = { .run_algorithm = armv4_5_run_algorithm, - .register_commands = arm11_register_commands, + .commands = arm11_command_handlers, .target_create = arm11_target_create, .init_target = arm11_init_target, .examine = arm11_examine, |