summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-15 09:12:44 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-15 09:12:44 -0800
commitf30136603e4cc8b2db0112a32f26959d5201e58c (patch)
treeb16edfb45d05611e64d36a75f3059dd80ae4467f /src
parent673196887325188af843a9cc153c3cde86b25321 (diff)
downloadopenocd+libswd-f30136603e4cc8b2db0112a32f26959d5201e58c.tar.gz
openocd+libswd-f30136603e4cc8b2db0112a32f26959d5201e58c.tar.bz2
openocd+libswd-f30136603e4cc8b2db0112a32f26959d5201e58c.tar.xz
openocd+libswd-f30136603e4cc8b2db0112a32f26959d5201e58c.zip
arm-jtag-ew,jlink: switch to COMMAND_HANDLER
These drivers were overlooked during the recent upgrade. Convert them, moving their registration routines to eliminate their declarations.
Diffstat (limited to 'src')
-rw-r--r--src/jtag/arm-jtag-ew.c20
-rw-r--r--src/jtag/jlink.c32
2 files changed, 23 insertions, 29 deletions
diff --git a/src/jtag/arm-jtag-ew.c b/src/jtag/arm-jtag-ew.c
index 0568d1c8..18b353ac 100644
--- a/src/jtag/arm-jtag-ew.c
+++ b/src/jtag/arm-jtag-ew.c
@@ -63,9 +63,6 @@ static int armjtagew_register_commands(struct command_context *cmd_ctx);
static int armjtagew_init(void);
static int armjtagew_quit(void);
-/* CLI command handler functions */
-static int armjtagew_handle_armjtagew_info_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc);
-
/* Queue command functions */
static void armjtagew_end_state(tap_state_t state);
static void armjtagew_state_move(void);
@@ -240,13 +237,6 @@ static int armjtagew_khz(int khz, int *jtag_speed)
return ERROR_OK;
}
-static int armjtagew_register_commands(struct command_context *cmd_ctx)
-{
- register_command(cmd_ctx, NULL, "armjtagew_info", armjtagew_handle_armjtagew_info_command, COMMAND_EXEC,
- "query armjtagew info");
- return ERROR_OK;
-}
-
static int armjtagew_init(void)
{
int check_cnt;
@@ -520,7 +510,7 @@ static int armjtagew_get_version_info(void)
return ERROR_OK;
}
-static int armjtagew_handle_armjtagew_info_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(armjtagew_handle_armjtagew_info_command)
{
if (armjtagew_get_version_info() == ERROR_OK)
{
@@ -531,6 +521,14 @@ static int armjtagew_handle_armjtagew_info_command(struct command_context *cmd_c
return ERROR_OK;
}
+static int armjtagew_register_commands(struct command_context *cmd_ctx)
+{
+ register_command(cmd_ctx, NULL, "armjtagew_info",
+ &armjtagew_handle_armjtagew_info_command, COMMAND_EXEC,
+ "query armjtagew info");
+ return ERROR_OK;
+}
+
/***************************************************************************/
/* ARM-JTAG-EW tap functions */
diff --git a/src/jtag/jlink.c b/src/jtag/jlink.c
index 27d400d4..24221357 100644
--- a/src/jtag/jlink.c
+++ b/src/jtag/jlink.c
@@ -91,10 +91,6 @@ static int jlink_register_commands(struct command_context *cmd_ctx);
static int jlink_init(void);
static int jlink_quit(void);
-/* CLI command handler functions */
-static int jlink_handle_jlink_info_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc);
-static int jlink_handle_jlink_hw_jtag_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc);
-
/* Queue command functions */
static void jlink_end_state(tap_state_t state);
static void jlink_state_move(void);
@@ -290,18 +286,6 @@ static int jlink_khz(int khz, int *jtag_speed)
return ERROR_OK;
}
-static int jlink_register_commands(struct command_context *cmd_ctx)
-{
-
- register_command(cmd_ctx, NULL, "jlink_info",
- &jlink_handle_jlink_info_command, COMMAND_EXEC,
- "query jlink info");
- register_command(cmd_ctx, NULL, "jlink_hw_jtag",
- &jlink_handle_jlink_hw_jtag_command, COMMAND_EXEC,
- "set/get jlink hw jtag command version [2 | 3]");
- return ERROR_OK;
-}
-
static int jlink_init(void)
{
int i;
@@ -630,7 +614,7 @@ static int jlink_get_version_info(void)
return ERROR_OK;
}
-static int jlink_handle_jlink_info_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(jlink_handle_jlink_info_command)
{
if (jlink_get_version_info() == ERROR_OK)
{
@@ -641,7 +625,7 @@ static int jlink_handle_jlink_info_command(struct command_context *cmd_ctx, char
return ERROR_OK;
}
-static int jlink_handle_jlink_hw_jtag_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(jlink_handle_jlink_hw_jtag_command)
{
switch (argc) {
case 0:
@@ -665,6 +649,18 @@ static int jlink_handle_jlink_hw_jtag_command(struct command_context *cmd_ctx, c
return ERROR_OK;
}
+static int jlink_register_commands(struct command_context *cmd_ctx)
+{
+
+ register_command(cmd_ctx, NULL, "jlink_info",
+ &jlink_handle_jlink_info_command, COMMAND_EXEC,
+ "query jlink info");
+ register_command(cmd_ctx, NULL, "jlink_hw_jtag",
+ &jlink_handle_jlink_hw_jtag_command, COMMAND_EXEC,
+ "set/get jlink hw jtag command version [2 | 3]");
+ return ERROR_OK;
+}
+
/***************************************************************************/
/* J-Link tap functions */