]> git.sur5r.net Git - openocd/commitdiff
ARM9TDMI: remove now-needless "struct arm9tdmi"
authorDavid Brownell <dbrownell@users.sourceforge.net>
Tue, 17 Nov 2009 09:09:50 +0000 (01:09 -0800)
committerDavid Brownell <dbrownell@users.sourceforge.net>
Tue, 17 Nov 2009 09:09:50 +0000 (01:09 -0800)
And move the rest of the vector_catch stuff into the C file;
it's not part of the module interface.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
src/target/arm920t.c
src/target/arm920t.h
src/target/arm926ejs.c
src/target/arm926ejs.h
src/target/arm966e.c
src/target/arm966e.h
src/target/arm9tdmi.c
src/target/arm9tdmi.h
src/target/fa526.c

index fca3743d18cf8746fc00e18244d8de9126854e23..62dd3a147ec3ff418a50eaa14c48967e8ce5f109 100644 (file)
@@ -62,7 +62,7 @@ static int arm920t_read_cp15_physical(struct target *target,
        uint8_t reg_addr_buf = reg_addr & 0x3f;
        uint8_t nr_w_buf = 0;
 
-       jtag_info = &arm920t->arm9tdmi_common.arm7_9_common.jtag_info;
+       jtag_info = &arm920t->arm7_9_common.jtag_info;
 
        jtag_set_end_state(TAP_IDLE);
        arm_jtag_scann(jtag_info, 0xf);
@@ -115,7 +115,7 @@ static int arm920t_write_cp15_physical(struct target *target,
        uint8_t nr_w_buf = 1;
        uint8_t value_buf[4];
 
-       jtag_info = &arm920t->arm9tdmi_common.arm7_9_common.jtag_info;
+       jtag_info = &arm920t->arm7_9_common.jtag_info;
 
        buf_set_u32(value_buf, 0, 32, value);
 
@@ -164,7 +164,7 @@ static int arm920t_execute_cp15(struct target *target, uint32_t cp15_opcode,
        uint8_t nr_w_buf = 0;
        uint8_t cp15_opcode_buf[4];
 
-       jtag_info = &arm920t->arm9tdmi_common.arm7_9_common.jtag_info;
+       jtag_info = &arm920t->arm7_9_common.jtag_info;
 
        jtag_set_end_state(TAP_IDLE);
        arm_jtag_scann(jtag_info, 0xf);
@@ -444,7 +444,7 @@ int arm920t_arch_state(struct target *target)
                return ERROR_TARGET_INVALID;
        }
 
-       armv4_5 = &arm920t->arm9tdmi_common.arm7_9_common.armv4_5_common;
+       armv4_5 = &arm920t->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"
@@ -623,12 +623,10 @@ int arm920t_soft_reset_halt(struct target *target)
 
 int arm920t_init_arch_info(struct target *target, struct arm920t_common *arm920t, struct jtag_tap *tap)
 {
-       struct arm9tdmi_common *arm9tdmi = &arm920t->arm9tdmi_common;
-       struct arm7_9_common *arm7_9 = &arm9tdmi->arm7_9_common;
+       struct arm7_9_common *arm7_9 = &arm920t->arm7_9_common;
 
-       /* initialize arm9tdmi specific info (including arm7_9 and armv4_5)
-        */
-       arm9tdmi_init_arch_info(target, arm9tdmi, tap);
+       /* initialize arm7/arm9 specific info (including armv4_5) */
+       arm9tdmi_init_arch_info(target, arm7_9, tap);
 
        arm920t->common_magic = ARM920T_COMMON_MAGIC;
 
index 567c8def67a4c794562cbbb3cdbed60096770dc7..ca6be7ea968094d3b7c274af5cbeb5cfd075cbbe 100644 (file)
@@ -27,7 +27,7 @@
 
 struct arm920t_common
 {
-       struct arm9tdmi_common arm9tdmi_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;
@@ -42,7 +42,7 @@ static inline struct arm920t_common *
 target_to_arm920(struct target *target)
 {
        return container_of(target->arch_info, struct arm920t_common,
-                       arm9tdmi_common.arm7_9_common.armv4_5_common);
+                       arm7_9_common.armv4_5_common);
 }
 
 struct arm920t_cache_line
index f305390b28624cd09e69edaf11f5e3486c6e73cc..e38e7df40ea1918ff70e739b27c4cac2ec8e85d9 100644 (file)
@@ -502,7 +502,7 @@ int arm926ejs_arch_state(struct target *target)
                return ERROR_TARGET_INVALID;
        }
 
-       armv4_5 = &arm926ejs->arm9tdmi_common.arm7_9_common.armv4_5_common;
+       armv4_5 = &arm926ejs->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"
@@ -670,12 +670,10 @@ static int arm926ejs_read_phys_memory(struct target *target,
 int arm926ejs_init_arch_info(struct target *target, struct arm926ejs_common *arm926ejs,
                struct jtag_tap *tap)
 {
-       struct arm9tdmi_common *arm9tdmi = &arm926ejs->arm9tdmi_common;
-       struct arm7_9_common *arm7_9 = &arm9tdmi->arm7_9_common;
+       struct arm7_9_common *arm7_9 = &arm926ejs->arm7_9_common;
 
-       /* initialize arm9tdmi specific info (including arm7_9 and armv4_5)
-        */
-       arm9tdmi_init_arch_info(target, arm9tdmi, tap);
+       /* initialize arm7/arm9 specific info (including armv4_5) */
+       arm9tdmi_init_arch_info(target, arm7_9, tap);
 
        arm926ejs->common_magic = ARM926EJS_COMMON_MAGIC;
 
index 22081f4e63511660aecab08f82d2d4d27a737ad3..514f054376592729af95d49ad6f670d1d5398c71 100644 (file)
@@ -27,7 +27,7 @@
 
 struct arm926ejs_common
 {
-       struct arm9tdmi_common arm9tdmi_common;
+       struct arm7_9_common arm7_9_common;
        uint32_t common_magic;
        struct armv4_5_mmu_common armv4_5_mmu;
        int (*read_cp15)(struct target *target, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t *value);
@@ -42,7 +42,7 @@ static inline struct arm926ejs_common *
 target_to_arm926(struct target *target)
 {
        return container_of(target->arch_info, struct arm926ejs_common,
-               arm9tdmi_common.arm7_9_common.armv4_5_common);
+                       arm7_9_common.armv4_5_common);
 }
 
 
index 3b85a5cd8689e71d32f9d3889b64a99b4a1c8b1a..fc50acb6653b3480f9ba717a068aa6f8f0d593b0 100644 (file)
 
 int arm966e_init_arch_info(struct target *target, struct arm966e_common *arm966e, struct jtag_tap *tap)
 {
-       struct arm9tdmi_common *arm9tdmi = &arm966e->arm9tdmi_common;
-       struct arm7_9_common *arm7_9 = &arm9tdmi->arm7_9_common;
+       struct arm7_9_common *arm7_9 = &arm966e->arm7_9_common;
 
-       arm9tdmi_init_arch_info(target, arm9tdmi, tap);
+       /* initialize arm7/arm9 specific info (including armv4_5) */
+       arm9tdmi_init_arch_info(target, arm7_9, tap);
 
        arm966e->common_magic = ARM966E_COMMON_MAGIC;
 
index b58f3a241337caf986b25d510b0d8741c4dd3ac9..45aeb4ef1e6f1399e95773b08fd7218a68128573 100644 (file)
@@ -29,7 +29,7 @@
 
 struct arm966e_common
 {
-       struct arm9tdmi_common arm9tdmi_common;
+       struct arm7_9_common arm7_9_common;
        int common_magic;
        uint32_t cp15_control_reg;
 };
@@ -38,7 +38,7 @@ static inline struct arm966e_common *
 target_to_arm966(struct target *target)
 {
        return container_of(target->arch_info, struct arm966e_common,
-                       arm9tdmi_common.arm7_9_common.armv4_5_common);
+                       arm7_9_common.armv4_5_common);
 }
 
 int arm966e_init_arch_info(struct target *target,
index 8e8f4d63db3ac175f8c0a35e491b82513c38e65f..3492c2a94240d5dba76c5020b11f53a764f6052c 100644 (file)
 #define _DEBUG_INSTRUCTION_EXECUTION_
 #endif
 
-static const struct arm9tdmi_vector arm9tdmi_vectors[] =
+enum arm9tdmi_vector_bit
 {
+       ARM9TDMI_RESET_VECTOR = 0x01,
+       ARM9TDMI_UNDEF_VECTOR = 0x02,
+       ARM9TDMI_SWI_VECTOR = 0x04,
+       ARM9TDMI_PABT_VECTOR = 0x08,
+       ARM9TDMI_DABT_VECTOR = 0x10,
+       /* BIT(5) reserved -- must be zero */
+       ARM9TDMI_IRQ_VECTOR = 0x40,
+       ARM9TDMI_FIQ_VECTOR = 0x80,
+};
+
+static const struct arm9tdmi_vector {
+       char *name;
+       uint32_t value;
+} arm9tdmi_vectors[] = {
        {"reset", ARM9TDMI_RESET_VECTOR},
        {"undef", ARM9TDMI_UNDEF_VECTOR},
        {"swi", ARM9TDMI_SWI_VECTOR},
@@ -750,14 +764,9 @@ int arm9tdmi_init_target(struct command_context *cmd_ctx,
        return ERROR_OK;
 }
 
-int arm9tdmi_init_arch_info(struct target *target, struct arm9tdmi_common *arm9tdmi, struct jtag_tap *tap)
+int arm9tdmi_init_arch_info(struct target *target,
+               struct arm7_9_common *arm7_9, struct jtag_tap *tap)
 {
-       struct arm *armv4_5;
-       struct arm7_9_common *arm7_9;
-
-       arm7_9 = &arm9tdmi->arm7_9_common;
-       armv4_5 = &arm7_9->armv4_5_common;
-
        /* prepare JTAG information for the new target */
        arm7_9->jtag_info.tap = tap;
        arm7_9->jtag_info.scann_size = 5;
@@ -812,10 +821,10 @@ int arm9tdmi_init_arch_info(struct target *target, struct arm9tdmi_common *arm9t
 
 static int arm9tdmi_target_create(struct target *target, Jim_Interp *interp)
 {
-       struct arm9tdmi_common *arm9tdmi = calloc(1,sizeof(struct arm9tdmi_common));
+       struct arm7_9_common *arm7_9 = calloc(1,sizeof(struct arm7_9_common));
 
-       arm9tdmi_init_arch_info(target, arm9tdmi, target->tap);
-       arm9tdmi->arm7_9_common.armv4_5_common.is_armv4 = true;
+       arm9tdmi_init_arch_info(target, arm7_9, target->tap);
+       arm7_9->armv4_5_common.is_armv4 = true;
 
        return ERROR_OK;
 }
index 496e4c52d251358bab05ccd0546af0b8153820ee..351b00adfc26bb3221332f1e26b2bac0e70ffc20 100644 (file)
 
 #include "embeddedice.h"
 
-/* FIXME we don't really need a separate arm9tdmi struct any more...
- * remove it, the arm7/arm9 common struct suffices.
- */
-struct arm9tdmi_common
-{
-       struct arm7_9_common arm7_9_common;
-};
-
-struct arm9tdmi_vector
-{
-       char *name;
-       uint32_t value;
-};
-
-enum arm9tdmi_vector_bit
-{
-       ARM9TDMI_RESET_VECTOR = 0x01,
-       ARM9TDMI_UNDEF_VECTOR = 0x02,
-       ARM9TDMI_SWI_VECTOR = 0x04,
-       ARM9TDMI_PABT_VECTOR = 0x08,
-       ARM9TDMI_DABT_VECTOR = 0x10,
-       /* BIT(5) reserved -- must be zero */
-       ARM9TDMI_IRQ_VECTOR = 0x40,
-       ARM9TDMI_FIQ_VECTOR = 0x80,
-};
-
 int arm9tdmi_init_target(struct command_context *cmd_ctx,
                struct target *target);
 int arm9tdmi_init_arch_info(struct target *target,
-               struct arm9tdmi_common *arm9tdmi, struct jtag_tap *tap);
+               struct arm7_9_common *arm7_9, struct jtag_tap *tap);
 int arm9tdmi_register_commands(struct command_context *cmd_ctx);
 
 int arm9tdmi_clock_out(struct arm_jtag *jtag_info,
index e7c1a2e64e01a77c496b15b2adce1d0cd8e3cad7..9c22a750b654a248f0242b61f98dfd081ecc33c6 100644 (file)
@@ -256,12 +256,8 @@ static void fa526_branch_resume_thumb(struct target *target)
 }
 
 static int fa526_init_arch_info_2(struct target *target,
-               struct arm9tdmi_common *arm9tdmi, struct jtag_tap *tap)
+               struct arm7_9_common *arm7_9, struct jtag_tap *tap)
 {
-       struct arm7_9_common *arm7_9;
-
-       arm7_9 = &arm9tdmi->arm7_9_common;
-
        /* prepare JTAG information for the new target */
        arm7_9->jtag_info.tap = tap;
        arm7_9->jtag_info.scann_size = 5;
@@ -317,12 +313,10 @@ static int fa526_init_arch_info_2(struct target *target,
 static int fa526_init_arch_info(struct target *target,
                struct arm920t_common *arm920t, struct jtag_tap *tap)
 {
-       struct arm9tdmi_common *arm9tdmi = &arm920t->arm9tdmi_common;
-       struct arm7_9_common *arm7_9 = &arm9tdmi->arm7_9_common;
+       struct arm7_9_common *arm7_9 = &arm920t->arm7_9_common;
 
-       /* initialize arm9tdmi specific info (including arm7_9 and armv4_5)
-        */
-       fa526_init_arch_info_2(target, arm9tdmi, tap);
+       /* initialize arm7/arm9 specific info (including armv4_5) */
+       fa526_init_arch_info_2(target, arm7_9, tap);
 
        arm920t->common_magic = ARM920T_COMMON_MAGIC;