ARM7TDMI: remove now-needless "struct arm7tdmi"
authorDavid Brownell <dbrownell@users.sourceforge.net>
Tue, 17 Nov 2009 09:09:06 +0000 (01:09 -0800)
committerDavid Brownell <dbrownell@users.sourceforge.net>
Tue, 17 Nov 2009 09:09:06 +0000 (01:09 -0800)
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
src/target/arm720t.c
src/target/arm720t.h
src/target/arm7tdmi.c
src/target/arm7tdmi.h

index 5d83517b1ea57e09fb46271140e98fdfa97444a2..3bac0beb93667292872a0764be27394fc65638b4 100644 (file)
@@ -49,7 +49,7 @@ static int arm720t_scan_cp15(struct target *target,
        uint8_t out_buf[4];
        uint8_t instruction_buf = instruction;
 
-       jtag_info = &arm720t->arm7tdmi_common.arm7_9_common.jtag_info;
+       jtag_info = &arm720t->arm7_9_common.jtag_info;
 
        buf_set_u32(out_buf, 0, 32, flip_u32(out, 32));
 
@@ -232,7 +232,7 @@ static int arm720t_arch_state(struct target *target)
                "disabled", "enabled"
        };
 
-       armv4_5 = &arm720t->arm7tdmi_common.arm7_9_common.armv4_5_common;
+       armv4_5 = &arm720t->arm7_9_common.armv4_5_common;
 
        LOG_USER("target halted in %s state due to %s, current mode: %s\n"
                        "cpsr: 0x%8.8" PRIx32 " pc: 0x%8.8" PRIx32 "\n"
@@ -305,10 +305,10 @@ static int arm720t_soft_reset_halt(struct target *target)
 {
        int retval = ERROR_OK;
        struct arm720t_common *arm720t = target_to_arm720(target);
-       struct reg *dbg_stat = &arm720t->arm7tdmi_common.arm7_9_common
+       struct reg *dbg_stat = &arm720t->arm7_9_common
                        .eice_cache->reg_list[EICE_DBG_STAT];
-       struct armv4_5_common_s *armv4_5 = &arm720t->arm7tdmi_common
-                       .arm7_9_common.armv4_5_common;
+       struct armv4_5_common_s *armv4_5 = &arm720t->arm7_9_common
+                       .armv4_5_common;
 
        if ((retval = target_halt(target)) != ERROR_OK)
        {
@@ -380,10 +380,9 @@ static int arm720t_init_target(struct command_context *cmd_ctx, struct target *t
 static int arm720t_init_arch_info(struct target *target,
                struct arm720t_common *arm720t, struct jtag_tap *tap)
 {
-       struct arm7tdmi_common *arm7tdmi = &arm720t->arm7tdmi_common;
-       struct arm7_9_common *arm7_9 = &arm7tdmi->arm7_9_common;
+       struct arm7_9_common *arm7_9 = &arm720t->arm7_9_common;
 
-       arm7tdmi_init_arch_info(target, arm7tdmi, tap);
+       arm7tdmi_init_arch_info(target, arm7_9, tap);
 
        arm720t->common_magic = ARM720T_COMMON_MAGIC;
 
@@ -406,7 +405,7 @@ static int arm720t_target_create(struct target *target, Jim_Interp *interp)
 {
        struct arm720t_common *arm720t = calloc(1, sizeof(*arm720t));
 
-       arm720t->arm7tdmi_common.arm7_9_common.armv4_5_common.is_armv4 = true;
+       arm720t->arm7_9_common.armv4_5_common.is_armv4 = true;
        return arm720t_init_arch_info(target, arm720t, target->tap);
 }
 
@@ -421,7 +420,7 @@ COMMAND_HANDLER(arm720t_handle_cp15_command)
        if (retval != ERROR_OK)
                return retval;
 
-       jtag_info = &arm720t->arm7tdmi_common.arm7_9_common.jtag_info;
+       jtag_info = &arm720t->arm7_9_common.jtag_info;
 
        if (target->state != TARGET_HALTED)
        {
index 6bbac242c5ff1bc909e54d03b36c5a055c43ffa2..f0ab44477642ea6b8a385f1f0e39da82beefb9ac 100644 (file)
@@ -27,7 +27,7 @@
 
 struct arm720t_common
 {
-       struct arm7tdmi_common arm7tdmi_common;
+       struct arm7_9_common arm7_9_common;
        uint32_t common_magic;
        struct armv4_5_mmu_common armv4_5_mmu;
        uint32_t cp15_control_reg;
@@ -39,7 +39,7 @@ static inline struct arm720t_common *
 target_to_arm720(struct target *target)
 {
        return container_of(target->arch_info, struct arm720t_common,
-                       arm7tdmi_common.arm7_9_common.armv4_5_common);
+                       arm7_9_common.armv4_5_common);
 }
 
 #endif /* ARM720T_H */
index ba993ee467af0538fde7976bc62ed7da4342c9f0..3bd5236442210313a7591df03bdbdb8db381a959 100644 (file)
@@ -654,10 +654,9 @@ int arm7tdmi_init_target(struct command_context *cmd_ctx, struct target *target)
        return ERROR_OK;
 }
 
-int arm7tdmi_init_arch_info(struct target *target, struct arm7tdmi_common *arm7tdmi, struct jtag_tap *tap)
+int arm7tdmi_init_arch_info(struct target *target,
+               struct arm7_9_common *arm7_9, struct jtag_tap *tap)
 {
-       struct arm7_9_common *arm7_9 = &arm7tdmi->arm7_9_common;
-
        /* prepare JTAG information for the new target */
        arm7_9->jtag_info.tap = tap;
        arm7_9->jtag_info.scann_size = 4;
@@ -706,11 +705,11 @@ int arm7tdmi_init_arch_info(struct target *target, struct arm7tdmi_common *arm7t
 
 static int arm7tdmi_target_create(struct target *target, Jim_Interp *interp)
 {
-       struct arm7tdmi_common *arm7tdmi;
+       struct arm7_9_common *arm7_9;
 
-       arm7tdmi = calloc(1,sizeof(struct arm7tdmi_common));
-       arm7tdmi_init_arch_info(target, arm7tdmi, target->tap);
-       arm7tdmi->arm7_9_common.armv4_5_common.is_armv4 = true;
+       arm7_9 = calloc(1,sizeof(struct arm7_9_common));
+       arm7tdmi_init_arch_info(target, arm7_9, target->tap);
+       arm7_9->armv4_5_common.is_armv4 = true;
 
        return ERROR_OK;
 }
index 4ed6f3e23471de0952c6a70992e4ff2eb74194b6..b6bbe59a5f8c5d06112c17c8ca55feb12e920d90 100644 (file)
 
 #include "embeddedice.h"
 
-/* FIXME we don't really need a separate arm7tdmi struct any more...
- * remove it, the arm7/arm9 common struct suffices.
- */
-struct arm7tdmi_common
-{
-       struct arm7_9_common arm7_9_common;
-};
-
-int arm7tdmi_init_arch_info(struct target *target, struct arm7tdmi_common *arm7tdmi, struct jtag_tap *tap);
-int arm7tdmi_init_target(struct command_context *cmd_ctx, struct target *target);
+int arm7tdmi_init_arch_info(struct target *target,
+               struct arm7_9_common *arm7_9, struct jtag_tap *tap);
+int arm7tdmi_init_target(struct command_context *cmd_ctx,
+               struct target *target);
 
 #endif /* ARM7TDMI_H */