From bcb18b2044e9a9b812f8e0d390ed903f74524586 Mon Sep 17 00:00:00 2001 From: Zachary T Welch Date: Fri, 13 Nov 2009 08:39:57 -0800 Subject: [PATCH] arm720t_common_t -> struct arm720t_common Remove misleading typedef and redundant suffix from struct arm720t_common. --- src/target/arm720t.c | 24 ++++++++++++------------ src/target/arm720t.h | 8 ++++---- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/target/arm720t.c b/src/target/arm720t.c index 01ccf304..1d15dc9b 100644 --- a/src/target/arm720t.c +++ b/src/target/arm720t.c @@ -42,7 +42,7 @@ static int arm720t_scan_cp15(target_t *target, uint32_t out, uint32_t *in, int instruction, int clock) { int retval; - struct arm720t_common_s *arm720t = target_to_arm720(target); + struct arm720t_common *arm720t = target_to_arm720(target); arm_jtag_t *jtag_info; struct scan_field fields[2]; uint8_t out_buf[4]; @@ -185,7 +185,7 @@ static void arm720t_enable_mmu_caches(target_t *target, static void arm720t_post_debug_entry(target_t *target) { - struct arm720t_common_s *arm720t = target_to_arm720(target); + struct arm720t_common *arm720t = target_to_arm720(target); /* examine cp15 control reg */ arm720t_read_cp15(target, 0xee110f10, &arm720t->cp15_control_reg); @@ -204,7 +204,7 @@ static void arm720t_post_debug_entry(target_t *target) static void arm720t_pre_restore_context(target_t *target) { - struct arm720t_common_s *arm720t = target_to_arm720(target); + struct arm720t_common *arm720t = target_to_arm720(target); /* restore i/d fault status and address register */ arm720t_write_cp15(target, 0xee050f10, arm720t->fsr_reg); @@ -212,7 +212,7 @@ static void arm720t_pre_restore_context(target_t *target) } static int arm720t_verify_pointer(struct command_context_s *cmd_ctx, - struct arm720t_common_s *arm720t) + struct arm720t_common *arm720t) { if (arm720t->common_magic != ARM720T_COMMON_MAGIC) { command_print(cmd_ctx, "target is not an ARM720"); @@ -223,7 +223,7 @@ static int arm720t_verify_pointer(struct command_context_s *cmd_ctx, static int arm720t_arch_state(struct target_s *target) { - struct arm720t_common_s *arm720t = target_to_arm720(target); + struct arm720t_common *arm720t = target_to_arm720(target); struct armv4_5_common_s *armv4_5; static const char *state[] = @@ -270,7 +270,7 @@ static int arm720t_read_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer) { int retval; - struct arm720t_common_s *arm720t = target_to_arm720(target); + struct arm720t_common *arm720t = target_to_arm720(target); /* disable cache, but leave MMU enabled */ if (arm720t->armv4_5_mmu.armv4_5_cache.d_u_cache_enabled) @@ -287,7 +287,7 @@ static int arm720t_read_memory(struct target_s *target, static int arm720t_read_phys_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer) { - struct arm720t_common_s *arm720t = target_to_arm720(target); + struct arm720t_common *arm720t = target_to_arm720(target); return armv4_5_mmu_read_physical(target, &arm720t->armv4_5_mmu, address, size, count, buffer); } @@ -295,7 +295,7 @@ static int arm720t_read_phys_memory(struct target_s *target, static int arm720t_write_phys_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer) { - struct arm720t_common_s *arm720t = target_to_arm720(target); + struct arm720t_common *arm720t = target_to_arm720(target); return armv4_5_mmu_write_physical(target, &arm720t->armv4_5_mmu, address, size, count, buffer); } @@ -303,7 +303,7 @@ static int arm720t_write_phys_memory(struct target_s *target, static int arm720t_soft_reset_halt(struct target_s *target) { int retval = ERROR_OK; - struct arm720t_common_s *arm720t = target_to_arm720(target); + struct arm720t_common *arm720t = target_to_arm720(target); reg_t *dbg_stat = &arm720t->arm7tdmi_common.arm7_9_common .eice_cache->reg_list[EICE_DBG_STAT]; struct armv4_5_common_s *armv4_5 = &arm720t->arm7tdmi_common @@ -377,7 +377,7 @@ static int arm720t_init_target(struct command_context_s *cmd_ctx, struct target_ } static int arm720t_init_arch_info(target_t *target, - arm720t_common_t *arm720t, struct jtag_tap *tap) + struct arm720t_common *arm720t, struct jtag_tap *tap) { arm7tdmi_common_t *arm7tdmi = &arm720t->arm7tdmi_common; arm7_9_common_t *arm7_9 = &arm7tdmi->arm7_9_common; @@ -403,7 +403,7 @@ static int arm720t_init_arch_info(target_t *target, static int arm720t_target_create(struct target_s *target, Jim_Interp *interp) { - struct arm720t_common_s *arm720t = calloc(1, sizeof(*arm720t)); + struct arm720t_common *arm720t = calloc(1, sizeof(*arm720t)); arm720t->arm7tdmi_common.arm7_9_common.armv4_5_common.is_armv4 = true; return arm720t_init_arch_info(target, arm720t, target->tap); @@ -413,7 +413,7 @@ COMMAND_HANDLER(arm720t_handle_cp15_command) { int retval; target_t *target = get_current_target(cmd_ctx); - struct arm720t_common_s *arm720t = target_to_arm720(target); + struct arm720t_common *arm720t = target_to_arm720(target); arm_jtag_t *jtag_info; retval = arm720t_verify_pointer(cmd_ctx, arm720t); diff --git a/src/target/arm720t.h b/src/target/arm720t.h index c10cbe1b..25c682a0 100644 --- a/src/target/arm720t.h +++ b/src/target/arm720t.h @@ -25,7 +25,7 @@ #define ARM720T_COMMON_MAGIC 0xa720a720 -typedef struct arm720t_common_s +struct arm720t_common { arm7tdmi_common_t arm7tdmi_common; uint32_t common_magic; @@ -33,12 +33,12 @@ typedef struct arm720t_common_s uint32_t cp15_control_reg; uint32_t fsr_reg; uint32_t far_reg; -} arm720t_common_t; +}; -static inline struct arm720t_common_s * +static inline struct arm720t_common * target_to_arm720(struct target_s *target) { - return container_of(target->arch_info, struct arm720t_common_s, + return container_of(target->arch_info, struct arm720t_common, arm7tdmi_common.arm7_9_common.armv4_5_common); } -- 2.39.5