From: Zachary T Welch Date: Sun, 15 Nov 2009 17:12:44 +0000 (-0800) Subject: arm-jtag-ew,jlink: switch to COMMAND_HANDLER X-Git-Tag: v0.4.0-rc1~596 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f30136603e4cc8b2db0112a32f26959d5201e58c;p=openocd 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. --- 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 */