From 17a9dea53a71e9d7e241262725f3dd707b620d37 Mon Sep 17 00:00:00 2001 From: Zachary T Welch Date: Mon, 23 Nov 2009 15:03:04 -0800 Subject: add jim_handler to command_registration Adding jim_handler field to command_registration allows removing the register_jim helper. All command registrations now go through the register_command{,s}() functions. --- src/jtag/tcl.c | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) (limited to 'src/jtag') diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c index 6b420211..bc290788 100644 --- a/src/jtag/tcl.c +++ b/src/jtag/tcl.c @@ -1529,26 +1529,37 @@ static const struct command_registration jtag_command_handlers[] = { .help = "choose short(default) or long tms_sequence", .usage = "", }, + // jim commands + { + .name = "jtag", + .mode = COMMAND_ANY, + .jim_handler = &jim_jtag_command, + .help = "perform jtag tap actions", + }, + { + .name = "drscan", + .mode = COMMAND_EXEC, + .jim_handler = &Jim_Command_drscan, + .help = "execute DR scan " + " ...", + }, + { + .name = "flush_count", + .mode = COMMAND_EXEC, + .jim_handler = &Jim_Command_flush_count, + .help = "returns number of times the JTAG queue has been flushed", + }, + { + .name = "pathmove", + .mode = COMMAND_EXEC, + .jim_handler = &Jim_Command_pathmove, + .usage = ",,... ", + .help = "move JTAG to state1 then to state2, state3, etc.", + }, COMMAND_REGISTRATION_DONE }; int jtag_register_commands(struct command_context *cmd_ctx) { - register_jim(cmd_ctx, "jtag", jim_jtag_command, - "perform jtag tap actions"); - - register_jim(cmd_ctx, "drscan", Jim_Command_drscan, - "execute DR scan " - " ..."); - - register_jim(cmd_ctx, "flush_count", Jim_Command_flush_count, - "returns number of times the JTAG queue has been flushed"); - - register_jim(cmd_ctx, "pathmove", Jim_Command_pathmove, - ",,... " - "- move JTAG to state1 then to state2, state3, etc."); - return register_commands(cmd_ctx, NULL, jtag_command_handlers); } - - -- cgit v1.2.3