Commit db6c2871 authored by Zachary T Welch's avatar Zachary T Welch
Browse files

svf,xsvf,arm7_9_common: trim forard declarations

Remove forward declarations by reordering command registration.
parent 84172192
......@@ -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;
}
......@@ -39,16 +39,6 @@
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;
}
......@@ -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 */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment