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

reg_t -> struct reg

Remove misleading typedef and redundant suffix from struct reg.
parent ac927559
...@@ -863,7 +863,7 @@ static int gdb_reg_pos(target_t *target, int pos, int len) ...@@ -863,7 +863,7 @@ static int gdb_reg_pos(target_t *target, int pos, int len)
* The format of reg->value is little endian * The format of reg->value is little endian
* *
*/ */
void gdb_str_to_target(target_t *target, char *tstr, reg_t *reg) void gdb_str_to_target(target_t *target, char *tstr, struct reg *reg)
{ {
int i; int i;
...@@ -917,7 +917,7 @@ void gdb_target_to_reg(target_t *target, char *tstr, int str_len, uint8_t *bin) ...@@ -917,7 +917,7 @@ void gdb_target_to_reg(target_t *target, char *tstr, int str_len, uint8_t *bin)
int gdb_get_registers_packet(struct connection *connection, target_t *target, char* packet, int packet_size) int gdb_get_registers_packet(struct connection *connection, target_t *target, char* packet, int packet_size)
{ {
reg_t **reg_list; struct reg **reg_list;
int reg_list_size; int reg_list_size;
int retval; int retval;
int reg_packet_size = 0; int reg_packet_size = 0;
...@@ -968,7 +968,7 @@ int gdb_get_registers_packet(struct connection *connection, target_t *target, ch ...@@ -968,7 +968,7 @@ int gdb_get_registers_packet(struct connection *connection, target_t *target, ch
int gdb_set_registers_packet(struct connection *connection, target_t *target, char *packet, int packet_size) int gdb_set_registers_packet(struct connection *connection, target_t *target, char *packet, int packet_size)
{ {
int i; int i;
reg_t **reg_list; struct reg **reg_list;
int reg_list_size; int reg_list_size;
int retval; int retval;
char *packet_p; char *packet_p;
...@@ -1019,7 +1019,7 @@ int gdb_set_registers_packet(struct connection *connection, target_t *target, ch ...@@ -1019,7 +1019,7 @@ int gdb_set_registers_packet(struct connection *connection, target_t *target, ch
free(bin_buf); free(bin_buf);
} }
/* free reg_t *reg_list[] array allocated by get_gdb_reg_list */ /* free struct reg *reg_list[] array allocated by get_gdb_reg_list */
free(reg_list); free(reg_list);
gdb_put_packet(connection, "OK", 2); gdb_put_packet(connection, "OK", 2);
...@@ -1031,7 +1031,7 @@ int gdb_get_register_packet(struct connection *connection, target_t *target, cha ...@@ -1031,7 +1031,7 @@ int gdb_get_register_packet(struct connection *connection, target_t *target, cha
{ {
char *reg_packet; char *reg_packet;
int reg_num = strtoul(packet + 1, NULL, 16); int reg_num = strtoul(packet + 1, NULL, 16);
reg_t **reg_list; struct reg **reg_list;
int reg_list_size; int reg_list_size;
int retval; int retval;
...@@ -1067,7 +1067,7 @@ int gdb_set_register_packet(struct connection *connection, target_t *target, cha ...@@ -1067,7 +1067,7 @@ int gdb_set_register_packet(struct connection *connection, target_t *target, cha
char *separator; char *separator;
uint8_t *bin_buf; uint8_t *bin_buf;
int reg_num = strtoul(packet + 1, &separator, 16); int reg_num = strtoul(packet + 1, &separator, 16);
reg_t **reg_list; struct reg **reg_list;
int reg_list_size; int reg_list_size;
int retval; int retval;
struct reg_arch_type *arch_type; struct reg_arch_type *arch_type;
......
...@@ -248,14 +248,14 @@ enum arm11_regcache_ids ...@@ -248,14 +248,14 @@ enum arm11_regcache_ids
static uint8_t arm11_gdb_dummy_fp_value[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static uint8_t arm11_gdb_dummy_fp_value[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static reg_t arm11_gdb_dummy_fp_reg = static struct reg arm11_gdb_dummy_fp_reg =
{ {
"GDB dummy floating-point register", arm11_gdb_dummy_fp_value, 0, 1, 96, NULL, 0, NULL, 0 "GDB dummy floating-point register", arm11_gdb_dummy_fp_value, 0, 1, 96, NULL, 0, NULL, 0
}; };
static uint8_t arm11_gdb_dummy_fps_value[] = {0, 0, 0, 0}; static uint8_t arm11_gdb_dummy_fps_value[] = {0, 0, 0, 0};
static reg_t arm11_gdb_dummy_fps_reg = static struct reg arm11_gdb_dummy_fps_reg =
{ {
"GDB dummy floating-point status register", arm11_gdb_dummy_fps_value, 0, 1, 32, NULL, 0, NULL, 0 "GDB dummy floating-point status register", arm11_gdb_dummy_fps_value, 0, 1, 32, NULL, 0, NULL, 0
}; };
...@@ -266,8 +266,8 @@ static int arm11_step(struct target_s *target, int current, ...@@ -266,8 +266,8 @@ static int arm11_step(struct target_s *target, int current,
uint32_t address, int handle_breakpoints); uint32_t address, int handle_breakpoints);
/* helpers */ /* helpers */
static int arm11_build_reg_cache(target_t *target); static int arm11_build_reg_cache(target_t *target);
static int arm11_set_reg(reg_t *reg, uint8_t *buf); static int arm11_set_reg(struct reg *reg, uint8_t *buf);
static int arm11_get_reg(reg_t *reg); static int arm11_get_reg(struct reg *reg);
static void arm11_record_register_history(struct arm11_common * arm11); static void arm11_record_register_history(struct arm11_common * arm11);
static void arm11_dump_reg_changes(struct arm11_common * arm11); static void arm11_dump_reg_changes(struct arm11_common * arm11);
...@@ -1245,14 +1245,14 @@ static int arm11_soft_reset_halt(struct target_s *target) ...@@ -1245,14 +1245,14 @@ static int arm11_soft_reset_halt(struct target_s *target)
/* target register access for gdb */ /* target register access for gdb */
static int arm11_get_gdb_reg_list(struct target_s *target, static int arm11_get_gdb_reg_list(struct target_s *target,
struct reg_s **reg_list[], int *reg_list_size) struct reg **reg_list[], int *reg_list_size)
{ {
FNC_INFO; FNC_INFO;
struct arm11_common * arm11 = target->arch_info; struct arm11_common * arm11 = target->arch_info;
*reg_list_size = ARM11_GDB_REGISTER_COUNT; *reg_list_size = ARM11_GDB_REGISTER_COUNT;
*reg_list = malloc(sizeof(reg_t*) * ARM11_GDB_REGISTER_COUNT); *reg_list = malloc(sizeof(struct reg*) * ARM11_GDB_REGISTER_COUNT);
for (size_t i = 16; i < 24; i++) for (size_t i = 16; i < 24; i++)
{ {
...@@ -1657,7 +1657,7 @@ static int arm11_run_algorithm(struct target_s *target, ...@@ -1657,7 +1657,7 @@ static int arm11_run_algorithm(struct target_s *target,
// Set register parameters // Set register parameters
for (int i = 0; i < num_reg_params; i++) for (int i = 0; i < num_reg_params; i++)
{ {
reg_t *reg = register_get_by_name(arm11->core_cache, reg_params[i].reg_name, 0); struct reg *reg = register_get_by_name(arm11->core_cache, reg_params[i].reg_name, 0);
if (!reg) if (!reg)
{ {
LOG_ERROR("BUG: register '%s' not found", reg_params[i].reg_name); LOG_ERROR("BUG: register '%s' not found", reg_params[i].reg_name);
...@@ -1742,7 +1742,7 @@ static int arm11_run_algorithm(struct target_s *target, ...@@ -1742,7 +1742,7 @@ static int arm11_run_algorithm(struct target_s *target,
{ {
if (reg_params[i].direction != PARAM_OUT) if (reg_params[i].direction != PARAM_OUT)
{ {
reg_t *reg = register_get_by_name(arm11->core_cache, reg_params[i].reg_name, 0); struct reg *reg = register_get_by_name(arm11->core_cache, reg_params[i].reg_name, 0);
if (!reg) if (!reg)
{ {
LOG_ERROR("BUG: register '%s' not found", reg_params[i].reg_name); LOG_ERROR("BUG: register '%s' not found", reg_params[i].reg_name);
...@@ -1891,7 +1891,7 @@ static int arm11_examine(struct target_s *target) ...@@ -1891,7 +1891,7 @@ static int arm11_examine(struct target_s *target)
/** Load a register that is marked !valid in the register cache */ /** Load a register that is marked !valid in the register cache */
static int arm11_get_reg(reg_t *reg) static int arm11_get_reg(struct reg *reg)
{ {
FNC_INFO; FNC_INFO;
...@@ -1914,7 +1914,7 @@ static int arm11_get_reg(reg_t *reg) ...@@ -1914,7 +1914,7 @@ static int arm11_get_reg(reg_t *reg)
} }
/** Change a value in the register cache */ /** Change a value in the register cache */
static int arm11_set_reg(reg_t *reg, uint8_t *buf) static int arm11_set_reg(struct reg *reg, uint8_t *buf)
{ {
FNC_INFO; FNC_INFO;
...@@ -1934,7 +1934,7 @@ static int arm11_build_reg_cache(target_t *target) ...@@ -1934,7 +1934,7 @@ static int arm11_build_reg_cache(target_t *target)
struct arm11_common *arm11 = target->arch_info; struct arm11_common *arm11 = target->arch_info;
NEW(struct reg_cache, cache, 1); NEW(struct reg_cache, cache, 1);
NEW(reg_t, reg_list, ARM11_REGCACHE_COUNT); NEW(struct reg, reg_list, ARM11_REGCACHE_COUNT);
NEW(struct arm11_reg_state, arm11_reg_states, ARM11_REGCACHE_COUNT); NEW(struct arm11_reg_state, arm11_reg_states, ARM11_REGCACHE_COUNT);
if (arm11_regs_arch_type == -1) if (arm11_regs_arch_type == -1)
...@@ -1970,7 +1970,7 @@ static int arm11_build_reg_cache(target_t *target) ...@@ -1970,7 +1970,7 @@ static int arm11_build_reg_cache(target_t *target)
for (i = 0; i < ARM11_REGCACHE_COUNT; i++) for (i = 0; i < ARM11_REGCACHE_COUNT; i++)
{ {
reg_t * r = reg_list + i; struct reg * r = reg_list + i;
const struct arm11_reg_defs * rd = arm11_reg_defs + i; const struct arm11_reg_defs * rd = arm11_reg_defs + i;
struct arm11_reg_state * rs = arm11_reg_states + i; struct arm11_reg_state * rs = arm11_reg_states + i;
......
...@@ -104,7 +104,7 @@ struct arm11_common ...@@ -104,7 +104,7 @@ struct arm11_common
/** \name Shadow registers to save processor state */ /** \name Shadow registers to save processor state */
/*@{*/ /*@{*/
reg_t * reg_list; /**< target register list */ struct reg * reg_list; /**< target register list */
uint32_t reg_values[ARM11_REGCACHE_COUNT]; /**< data for registers */ uint32_t reg_values[ARM11_REGCACHE_COUNT]; /**< data for registers */
/*@}*/ /*@}*/
......
...@@ -304,7 +304,7 @@ static int arm720t_soft_reset_halt(struct target_s *target) ...@@ -304,7 +304,7 @@ static int arm720t_soft_reset_halt(struct target_s *target)
{ {
int retval = ERROR_OK; int retval = ERROR_OK;
struct arm720t_common *arm720t = target_to_arm720(target); struct arm720t_common *arm720t = target_to_arm720(target);
reg_t *dbg_stat = &arm720t->arm7tdmi_common.arm7_9_common struct reg *dbg_stat = &arm720t->arm7tdmi_common.arm7_9_common
.eice_cache->reg_list[EICE_DBG_STAT]; .eice_cache->reg_list[EICE_DBG_STAT];
struct armv4_5_common_s *armv4_5 = &arm720t->arm7tdmi_common struct armv4_5_common_s *armv4_5 = &arm720t->arm7tdmi_common
.arm7_9_common.armv4_5_common; .arm7_9_common.armv4_5_common;
......
...@@ -704,7 +704,7 @@ int arm7_9_execute_sys_speed(struct target_s *target) ...@@ -704,7 +704,7 @@ int arm7_9_execute_sys_speed(struct target_s *target)
int retval; int retval;
struct arm7_9_common *arm7_9 = target_to_arm7_9(target); struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
struct arm_jtag *jtag_info = &arm7_9->jtag_info; struct arm_jtag *jtag_info = &arm7_9->jtag_info;
reg_t *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT]; struct reg *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT];
/* set RESTART instruction */ /* set RESTART instruction */
jtag_set_end_state(TAP_IDLE); jtag_set_end_state(TAP_IDLE);
...@@ -757,7 +757,7 @@ int arm7_9_execute_fast_sys_speed(struct target_s *target) ...@@ -757,7 +757,7 @@ int arm7_9_execute_fast_sys_speed(struct target_s *target)
struct arm7_9_common *arm7_9 = target_to_arm7_9(target); struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
struct arm_jtag *jtag_info = &arm7_9->jtag_info; struct arm_jtag *jtag_info = &arm7_9->jtag_info;
reg_t *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT]; struct reg *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT];
/* set RESTART instruction */ /* set RESTART instruction */
jtag_set_end_state(TAP_IDLE); jtag_set_end_state(TAP_IDLE);
...@@ -834,7 +834,7 @@ int arm7_9_handle_target_request(void *priv) ...@@ -834,7 +834,7 @@ int arm7_9_handle_target_request(void *priv)
return ERROR_OK; return ERROR_OK;
struct arm7_9_common *arm7_9 = target_to_arm7_9(target); struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
struct arm_jtag *jtag_info = &arm7_9->jtag_info; struct arm_jtag *jtag_info = &arm7_9->jtag_info;
reg_t *dcc_control = &arm7_9->eice_cache->reg_list[EICE_COMMS_CTRL]; struct reg *dcc_control = &arm7_9->eice_cache->reg_list[EICE_COMMS_CTRL];
if (!target->dbg_msg_enabled) if (!target->dbg_msg_enabled)
return ERROR_OK; return ERROR_OK;
...@@ -891,7 +891,7 @@ int arm7_9_poll(target_t *target) ...@@ -891,7 +891,7 @@ int arm7_9_poll(target_t *target)
{ {
int retval; int retval;
struct arm7_9_common *arm7_9 = target_to_arm7_9(target); struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
reg_t *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT]; struct reg *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT];
/* read debug status register */ /* read debug status register */
embeddedice_read_reg(dbg_stat); embeddedice_read_reg(dbg_stat);
...@@ -931,7 +931,7 @@ int arm7_9_poll(target_t *target) ...@@ -931,7 +931,7 @@ int arm7_9_poll(target_t *target)
if (check_pc) if (check_pc)
{ {
reg_t *reg = register_get_by_name(target->reg_cache, "pc", 1); struct reg *reg = register_get_by_name(target->reg_cache, "pc", 1);
uint32_t t=*((uint32_t *)reg->value); uint32_t t=*((uint32_t *)reg->value);
if (t != 0) if (t != 0)
{ {
...@@ -1115,7 +1115,7 @@ int arm7_9_deassert_reset(target_t *target) ...@@ -1115,7 +1115,7 @@ int arm7_9_deassert_reset(target_t *target)
int arm7_9_clear_halt(target_t *target) int arm7_9_clear_halt(target_t *target)
{ {
struct arm7_9_common *arm7_9 = target_to_arm7_9(target); struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
reg_t *dbg_ctrl = &arm7_9->eice_cache->reg_list[EICE_DBG_CTRL]; struct reg *dbg_ctrl = &arm7_9->eice_cache->reg_list[EICE_DBG_CTRL];
/* we used DBGRQ only if we didn't come out of reset */ /* we used DBGRQ only if we didn't come out of reset */
if (!arm7_9->debug_entry_from_reset && arm7_9->use_dbgrq) if (!arm7_9->debug_entry_from_reset && arm7_9->use_dbgrq)
...@@ -1173,8 +1173,8 @@ int arm7_9_soft_reset_halt(struct target_s *target) ...@@ -1173,8 +1173,8 @@ int arm7_9_soft_reset_halt(struct target_s *target)
{ {
struct arm7_9_common *arm7_9 = target_to_arm7_9(target); struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
struct armv4_5_common_s *armv4_5 = &arm7_9->armv4_5_common; struct armv4_5_common_s *armv4_5 = &arm7_9->armv4_5_common;
reg_t *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT]; struct reg *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT];
reg_t *dbg_ctrl = &arm7_9->eice_cache->reg_list[EICE_DBG_CTRL]; struct reg *dbg_ctrl = &arm7_9->eice_cache->reg_list[EICE_DBG_CTRL];
int i; int i;
int retval; int retval;
...@@ -1291,7 +1291,7 @@ int arm7_9_halt(target_t *target) ...@@ -1291,7 +1291,7 @@ int arm7_9_halt(target_t *target)
} }
struct arm7_9_common *arm7_9 = target_to_arm7_9(target); struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
reg_t *dbg_ctrl = &arm7_9->eice_cache->reg_list[EICE_DBG_CTRL]; struct reg *dbg_ctrl = &arm7_9->eice_cache->reg_list[EICE_DBG_CTRL];
LOG_DEBUG("target->state: %s", LOG_DEBUG("target->state: %s",
target_state_name(target)); target_state_name(target));
...@@ -1354,8 +1354,8 @@ int arm7_9_debug_entry(target_t *target) ...@@ -1354,8 +1354,8 @@ int arm7_9_debug_entry(target_t *target)
int retval; int retval;
struct arm7_9_common *arm7_9 = target_to_arm7_9(target); struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
struct armv4_5_common_s *armv4_5 = &arm7_9->armv4_5_common; struct armv4_5_common_s *armv4_5 = &arm7_9->armv4_5_common;
reg_t *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT]; struct reg *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT];
reg_t *dbg_ctrl = &arm7_9->eice_cache->reg_list[EICE_DBG_CTRL]; struct reg *dbg_ctrl = &arm7_9->eice_cache->reg_list[EICE_DBG_CTRL];
#ifdef _DEBUG_ARM7_9_ #ifdef _DEBUG_ARM7_9_
LOG_DEBUG("-"); LOG_DEBUG("-");
...@@ -1599,7 +1599,7 @@ int arm7_9_restore_context(target_t *target) ...@@ -1599,7 +1599,7 @@ int arm7_9_restore_context(target_t *target)
{ {
struct arm7_9_common *arm7_9 = target_to_arm7_9(target); struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
struct armv4_5_common_s *armv4_5 = &arm7_9->armv4_5_common; struct armv4_5_common_s *armv4_5 = &arm7_9->armv4_5_common;
reg_t *reg; struct reg *reg;
struct armv4_5_core_reg *reg_arch_info; struct armv4_5_core_reg *reg_arch_info;
enum armv4_5_mode current_mode = armv4_5->core_mode; enum armv4_5_mode current_mode = armv4_5->core_mode;
int i, j; int i, j;
...@@ -1803,7 +1803,7 @@ int arm7_9_resume(struct target_s *target, int current, uint32_t address, int ha ...@@ -1803,7 +1803,7 @@ int arm7_9_resume(struct target_s *target, int current, uint32_t address, int ha
struct arm7_9_common *arm7_9 = target_to_arm7_9(target); struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
struct armv4_5_common_s *armv4_5 = &arm7_9->armv4_5_common; struct armv4_5_common_s *armv4_5 = &arm7_9->armv4_5_common;
struct breakpoint *breakpoint = target->breakpoints; struct breakpoint *breakpoint = target->breakpoints;
reg_t *dbg_ctrl = &arm7_9->eice_cache->reg_list[EICE_DBG_CTRL]; struct reg *dbg_ctrl = &arm7_9->eice_cache->reg_list[EICE_DBG_CTRL];
int err, retval = ERROR_OK; int err, retval = ERROR_OK;
LOG_DEBUG("-"); LOG_DEBUG("-");
...@@ -2409,7 +2409,7 @@ int arm7_9_write_memory(struct target_s *target, uint32_t address, uint32_t size ...@@ -2409,7 +2409,7 @@ int arm7_9_write_memory(struct target_s *target, uint32_t address, uint32_t size
{ {
struct arm7_9_common *arm7_9 = target_to_arm7_9(target); struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
struct armv4_5_common_s *armv4_5 = &arm7_9->armv4_5_common; struct armv4_5_common_s *armv4_5 = &arm7_9->armv4_5_common;
reg_t *dbg_ctrl = &arm7_9->eice_cache->reg_list[EICE_DBG_CTRL]; struct reg *dbg_ctrl = &arm7_9->eice_cache->reg_list[EICE_DBG_CTRL];
uint32_t reg[16]; uint32_t reg[16];
uint32_t num_accesses = 0; uint32_t num_accesses = 0;
......
...@@ -582,7 +582,7 @@ static void arm7tdmi_branch_resume_thumb(target_t *target) ...@@ -582,7 +582,7 @@ static void arm7tdmi_branch_resume_thumb(target_t *target)
struct arm7_9_common *arm7_9 = target_to_arm7_9(target); struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
struct armv4_5_common_s *armv4_5 = &arm7_9->armv4_5_common; struct armv4_5_common_s *armv4_5 = &arm7_9->armv4_5_common;
struct arm_jtag *jtag_info = &arm7_9->jtag_info; struct arm_jtag *jtag_info = &arm7_9->jtag_info;
reg_t *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT]; struct reg *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT];
LOG_DEBUG("-"); LOG_DEBUG("-");
......
...@@ -555,7 +555,7 @@ int arm920t_soft_reset_halt(struct target_s *target) ...@@ -555,7 +555,7 @@ int arm920t_soft_reset_halt(struct target_s *target)
struct arm920t_common *arm920t = target_to_arm920(target); struct arm920t_common *arm920t = target_to_arm920(target);
struct arm7_9_common *arm7_9 = target_to_arm7_9(target); struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
struct armv4_5_common_s *armv4_5 = &arm7_9->armv4_5_common; struct armv4_5_common_s *armv4_5 = &arm7_9->armv4_5_common;
reg_t *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT]; struct reg *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT];
if ((retval = target_halt(target)) != ERROR_OK) if ((retval = target_halt(target)) != ERROR_OK)
{ {
......
...@@ -232,7 +232,7 @@ static int arm926ejs_mcr(target_t *target, int cpnum, uint32_t op1, ...@@ -232,7 +232,7 @@ static int arm926ejs_mcr(target_t *target, int cpnum, uint32_t op1,
static int arm926ejs_examine_debug_reason(target_t *target) static int arm926ejs_examine_debug_reason(target_t *target)
{ {
struct arm7_9_common *arm7_9 = target_to_arm7_9(target); struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
reg_t *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT]; struct reg *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT];
int debug_reason; int debug_reason;
int retval; int retval;
...@@ -524,7 +524,7 @@ int arm926ejs_soft_reset_halt(struct target_s *target) ...@@ -524,7 +524,7 @@ int arm926ejs_soft_reset_halt(struct target_s *target)
struct arm926ejs_common *arm926ejs = target_to_arm926(target); struct arm926ejs_common *arm926ejs = target_to_arm926(target);
struct arm7_9_common *arm7_9 = target_to_arm7_9(target); struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
struct armv4_5_common_s *armv4_5 = &arm7_9->armv4_5_common; struct armv4_5_common_s *armv4_5 = &arm7_9->armv4_5_common;
reg_t *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT]; struct reg *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT];
if ((retval = target_halt(target)) != ERROR_OK) if ((retval = target_halt(target)) != ERROR_OK)
{ {
......
...@@ -651,7 +651,7 @@ static void arm9tdmi_branch_resume_thumb(target_t *target) ...@@ -651,7 +651,7 @@ static void arm9tdmi_branch_resume_thumb(target_t *target)
struct arm7_9_common *arm7_9 = target_to_arm7_9(target); struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
struct armv4_5_common_s *armv4_5 = &arm7_9->armv4_5_common; struct armv4_5_common_s *armv4_5 = &arm7_9->armv4_5_common;
struct arm_jtag *jtag_info = &arm7_9->jtag_info; struct arm_jtag *jtag_info = &arm7_9->jtag_info;
reg_t *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT]; struct reg *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT];
/* LDMIA r0-15, [r0] at debug speed /* LDMIA r0-15, [r0] at debug speed
* register values will start to appear on 4th DCLK * register values will start to appear on 4th DCLK
...@@ -860,7 +860,7 @@ COMMAND_HANDLER(handle_arm9tdmi_catch_vectors_command) ...@@ -860,7 +860,7 @@ COMMAND_HANDLER(handle_arm9tdmi_catch_vectors_command)
{ {
target_t *target = get_current_target(cmd_ctx); target_t *target = get_current_target(cmd_ctx);
struct arm7_9_common *arm7_9 = target_to_arm7_9(target); struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
reg_t *vector_catch; struct reg *vector_catch;
uint32_t vector_catch_value; uint32_t vector_catch_value;
/* it's uncommon, but some ARM7 chips can support this */ /* it's uncommon, but some ARM7 chips can support this */
......
...@@ -155,19 +155,19 @@ int armv4_5_core_reg_map[7][17] = ...@@ -155,19 +155,19 @@ int armv4_5_core_reg_map[7][17] =
uint8_t armv4_5_gdb_dummy_fp_value[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; uint8_t armv4_5_gdb_dummy_fp_value[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
reg_t armv4_5_gdb_dummy_fp_reg = struct reg armv4_5_gdb_dummy_fp_reg =
{ {
"GDB dummy floating-point register", armv4_5_gdb_dummy_fp_value, 0, 1, 96, NULL, 0, NULL, 0 "GDB dummy floating-point register", armv4_5_gdb_dummy_fp_value, 0, 1, 96, NULL, 0, NULL, 0
}; };
uint8_t armv4_5_gdb_dummy_fps_value[] = {0, 0, 0, 0}; uint8_t armv4_5_gdb_dummy_fps_value[] = {0, 0, 0, 0};
reg_t armv4_5_gdb_dummy_fps_reg = struct reg armv4_5_gdb_dummy_fps_reg =
{ {
"GDB dummy floating-point status register", armv4_5_gdb_dummy_fps_value, 0, 1, 32, NULL, 0, NULL, 0 "GDB dummy floating-point status register", armv4_5_gdb_dummy_fps_value, 0, 1, 32, NULL, 0, NULL, 0
}; };
int armv4_5_get_core_reg(reg_t *reg) int armv4_5_get_core_reg(struct reg *reg)
{ {
int retval; int retval;
struct armv4_5_core_reg *armv4_5 = reg->arch_info; struct armv4_5_core_reg *armv4_5 = reg->arch_info;
...@@ -185,7 +185,7 @@ int armv4_5_get_core_reg(reg_t *reg) ...@@ -185,7 +185,7 @@ int armv4_5_get_core_reg(reg_t *reg)
return retval; return retval;
} }
int armv4_5_set_core_reg(reg_t *reg, uint8_t *buf) int armv4_5_set_core_reg(struct reg *reg, uint8_t *buf)
{ {
struct armv4_5_core_reg *armv4_5 = reg->arch_info; struct armv4_5_core_reg *armv4_5 = reg->arch_info;
target_t *target = armv4_5->target; target_t *target = armv4_5->target;
...@@ -253,7 +253,7 @@ struct reg_cache* armv4_5_build_reg_cache(target_t *target, struct arm *armv4_5_ ...@@ -253,7 +253,7 @@ struct reg_cache* armv4_5_build_reg_cache(target_t *target, struct arm *armv4_5_
{ {
int num_regs = 37; int num_regs = 37;
struct reg_cache *cache = malloc(sizeof(struct reg_cache)); struct reg_cache *cache = malloc(sizeof(struct reg_cache));
reg_t *reg_list = malloc(sizeof(reg_t) * num_regs); struct reg *reg_list = malloc(sizeof(struct reg) * num_regs);
struct armv4_5_core_reg *arch_info = malloc(sizeof(struct armv4_5_core_reg) * num_regs); struct armv4_5_core_reg *arch_info = malloc(sizeof(struct armv4_5_core_reg) * num_regs);
int i; int i;
...@@ -483,7 +483,7 @@ int armv4_5_register_commands(struct command_context_s *cmd_ctx) ...@@ -483,7 +483,7 @@ int armv4_5_register_commands(struct command_context_s *cmd_ctx)
return ERROR_OK; return ERROR_OK;
} }
int armv4_5_get_gdb_reg_list(target_t *target, reg_t **reg_list[], int *reg_list_size) int armv4_5_get_gdb_reg_list(target_t *target, struct reg **reg_list[], int *reg_list_size)
{ {
struct armv4_5_common_s *armv4_5 = target_to_armv4_5(target); struct armv4_5_common_s *armv4_5 = target_to_armv4_5(target);
int i; int i;
...@@ -492,7 +492,7 @@ int armv4_5_get_gdb_reg_list(target_t *target, reg_t **reg_list[], int *reg_list ...@@ -492,7 +492,7 @@ int armv4_5_get_gdb_reg_list(target_t *target, reg_t **reg_list[], int *reg_list
return ERROR_FAIL; return ERROR_FAIL;
*reg_list_size = 26; *reg_list_size = 26;
*reg_list = malloc(sizeof(reg_t*) * (*reg_list_size)); *reg_list = malloc(sizeof(struct reg*) * (*reg_list_size));
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
{ {
...@@ -596,7 +596,7 @@ int armv4_5_run_algorithm_inner(struct target_s *target, int num_mem_params, str ...@@ -596,7 +596,7 @@ int armv4_5_run_algorithm_inner(struct target_s *target, int num_mem_params, str
for (i = 0; i < num_reg_params; i++) for (i = 0; i < num_reg_params; i++)
{ {
reg_t *reg = register_get_by_name(armv4_5->core_cache, reg_params[i].reg_name, 0);