]> git.sur5r.net Git - openocd/commitdiff
svf,xsvf,arm7_9_common: trim forard declarations
authorZachary T Welch <zw@superlucidity.net>
Tue, 10 Nov 2009 05:24:45 +0000 (21:24 -0800)
committerZachary T Welch <zw@superlucidity.net>
Tue, 10 Nov 2009 05:39:46 +0000 (21:39 -0800)
Remove forward declarations by reordering command registration.

src/svf/svf.c
src/target/arm7_9_common.c
src/xsvf/xsvf.c

index 9c597bf7d68e1711cfc2149be61a563bfe109557..ba6ed1b779e24cde2a3276ec5b74811acd67cfa4 100644 (file)
@@ -210,7 +210,6 @@ static int svf_read_command_from_file(int fd);
 static int svf_check_tdo(void);
 static int svf_add_check_para(uint8_t enabled, int buffer_offset, int bit_len);
 static int svf_run_command(struct command_context_s *cmd_ctx, char *cmd_str);
-static int handle_svf_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
 
 static int svf_fd = 0;
 static char *svf_command_buffer = NULL;
@@ -225,14 +224,6 @@ static int svf_buffer_index = 0, svf_buffer_size = 0;
 static int svf_quiet = 0;
 
 
-int svf_register_commands(struct command_context_s *cmd_ctx)
-{
-       register_command(cmd_ctx, NULL, "svf", handle_svf_command,
-               COMMAND_EXEC, "run svf <file>");
-
-       return ERROR_OK;
-}
-
 static void svf_free_xxd_para(svf_xxr_para_t *para)
 {
        if (NULL != para)
@@ -1468,3 +1459,12 @@ static int svf_run_command(struct command_context_s *cmd_ctx, char *cmd_str)
 
        return ERROR_OK;
 }
+
+int svf_register_commands(struct command_context_s *cmd_ctx)
+{
+       register_command(cmd_ctx, NULL, "svf",
+                       &handle_svf_command, COMMAND_EXEC,
+                       "run svf <file>");
+
+       return ERROR_OK;
+}
index b251ec5b9bd51e95be7569f3fcb503a03cd7f427..a3c6a56c40b74002dc17c72f7766190ca3dda8a1 100644 (file)
 
 int arm7_9_debug_entry(target_t *target);
 
-/* command handler forward declarations */
-int handle_arm7_9_write_xpsr_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-int handle_arm7_9_write_xpsr_im8_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-int handle_arm7_9_read_core_reg_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-int handle_arm7_9_write_core_reg_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-int handle_arm7_9_dbgrq_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-int handle_arm7_9_fast_memory_access_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-int handle_arm7_9_dcc_downloads_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-int handle_arm7_9_etm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-
 /**
  * Clear watchpoints for an ARM7/9 target.
  *
@@ -2881,31 +2871,6 @@ int arm7_9_blank_check_memory(struct target_s *target, uint32_t address, uint32_
        return ERROR_OK;
 }
 
-int arm7_9_register_commands(struct command_context_s *cmd_ctx)
-{
-       command_t *arm7_9_cmd;
-
-       arm7_9_cmd = register_command(cmd_ctx, NULL, "arm7_9", NULL, COMMAND_ANY, "arm7/9 specific commands");
-
-       register_command(cmd_ctx, arm7_9_cmd, "write_xpsr", handle_arm7_9_write_xpsr_command, COMMAND_EXEC, "write program status register <value> <not cpsr | spsr>");
-       register_command(cmd_ctx, arm7_9_cmd, "write_xpsr_im8", handle_arm7_9_write_xpsr_im8_command, COMMAND_EXEC, "write program status register <8bit immediate> <rotate> <not cpsr | spsr>");
-
-       register_command(cmd_ctx, arm7_9_cmd, "write_core_reg", handle_arm7_9_write_core_reg_command, COMMAND_EXEC, "write core register <num> <mode> <value>");
-
-       register_command(cmd_ctx, arm7_9_cmd, "dbgrq", handle_arm7_9_dbgrq_command,
-               COMMAND_ANY, "use EmbeddedICE dbgrq instead of breakpoint for target halt requests <enable | disable>");
-       register_command(cmd_ctx, arm7_9_cmd, "fast_memory_access", handle_arm7_9_fast_memory_access_command,
-                COMMAND_ANY, "use fast memory accesses instead of slower but potentially safer accesses <enable | disable>");
-       register_command(cmd_ctx, arm7_9_cmd, "dcc_downloads", handle_arm7_9_dcc_downloads_command,
-               COMMAND_ANY, "use DCC downloads for larger memory writes <enable | disable>");
-
-       armv4_5_register_commands(cmd_ctx);
-
-       etm_register_commands(cmd_ctx);
-
-       return ERROR_OK;
-}
-
 int handle_arm7_9_write_xpsr_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
 {
        uint32_t value;
@@ -3178,3 +3143,41 @@ int arm7_9_init_arch_info(target_t *target, arm7_9_common_t *arm7_9)
 
        return ERROR_OK;
 }
+
+int arm7_9_register_commands(struct command_context_s *cmd_ctx)
+{
+       command_t *arm7_9_cmd;
+
+       arm7_9_cmd = register_command(cmd_ctx, NULL, "arm7_9",
+                       NULL, COMMAND_ANY, "arm7/9 specific commands");
+
+       register_command(cmd_ctx, arm7_9_cmd, "write_xpsr",
+                       handle_arm7_9_write_xpsr_command, COMMAND_EXEC,
+                       "write program status register <value> <not cpsr | spsr>");
+       register_command(cmd_ctx, arm7_9_cmd, "write_xpsr_im8",
+                       handle_arm7_9_write_xpsr_im8_command, COMMAND_EXEC,
+                       "write program status register "
+                       "<8bit immediate> <rotate> <not cpsr | spsr>");
+
+       register_command(cmd_ctx, arm7_9_cmd, "write_core_reg",
+                       handle_arm7_9_write_core_reg_command, COMMAND_EXEC,
+                       "write core register <num> <mode> <value>");
+
+       register_command(cmd_ctx, arm7_9_cmd, "dbgrq",
+                       handle_arm7_9_dbgrq_command, COMMAND_ANY,
+                       "use EmbeddedICE dbgrq instead of breakpoint "
+                       "for target halt requests <enable | disable>");
+       register_command(cmd_ctx, arm7_9_cmd, "fast_memory_access",
+                       handle_arm7_9_fast_memory_access_command, COMMAND_ANY,
+                       "use fast memory accesses instead of slower "
+                       "but potentially safer accesses <enable | disable>");
+       register_command(cmd_ctx, arm7_9_cmd, "dcc_downloads",
+                       handle_arm7_9_dcc_downloads_command, COMMAND_ANY,
+                       "use DCC downloads for larger memory writes <enable | disable>");
+
+       armv4_5_register_commands(cmd_ctx);
+
+       etm_register_commands(cmd_ctx);
+
+       return ERROR_OK;
+}
index 719470ee0d79d37aee4a13282b516d0c2266298b..17af9eadd783e7481c3a33f8a605222bee337cda 100644 (file)
@@ -123,7 +123,6 @@ LSDR 1  TDI  (0)
 
 #define XSTATE_MAX_PATH 12
 
-static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
 
 static int xsvf_fd = 0;
 
@@ -161,14 +160,6 @@ static tap_state_t xsvf_to_tap(int xsvf_state)
 
 
 
-int xsvf_register_commands(struct command_context_s *cmd_ctx)
-{
-       register_command(cmd_ctx, NULL, "xsvf", handle_xsvf_command,
-               COMMAND_EXEC, "run xsvf <file> [virt2] [quiet]");
-
-       return ERROR_OK;
-}
-
 static int xsvf_read_buffer(int num_bits, int fd, uint8_t* buf)
 {
        int num_bytes;
@@ -1059,6 +1050,14 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
        return ERROR_OK;
 }
 
+int xsvf_register_commands(struct command_context_s *cmd_ctx)
+{
+       register_command(cmd_ctx, NULL, "xsvf",
+                       &handle_xsvf_command, COMMAND_EXEC,
+                       "run xsvf <file> [virt2] [quiet]");
+
+       return ERROR_OK;
+}
 
 #if 0   /* this comment style used to try and keep uncrustify from adding * at begin of line */