mips_ejtag_t -> struct mips_ejtag
[fw/openocd] / src / target / cortex_m3.h
index 1dd724c8c8769ed342a4dbcb752ce7c335905764..b2d558d1fbf4498b5f6f3304f929955653d4319f 100644 (file)
@@ -136,10 +136,10 @@ typedef struct  cortex_m3_dwt_comparator_s
        uint32_t dwt_comparator_address;
 } cortex_m3_dwt_comparator_t;
 
-typedef struct cortex_m3_common_s
+struct cortex_m3_common
 {
        int common_magic;
-       arm_jtag_t jtag_info;
+       struct arm_jtag jtag_info;
 
        /* Context information */
        uint32_t dcb_dhcsr;
@@ -160,8 +160,14 @@ typedef struct cortex_m3_common_s
        cortex_m3_dwt_comparator_t *dwt_comparator_list;
        struct reg_cache_s *dwt_cache;
 
-       armv7m_common_t armv7m;
-       void *arch_info;
-} cortex_m3_common_t;
+       struct armv7m_common armv7m;
+};
+
+static inline struct cortex_m3_common *
+target_to_cm3(struct target_s *target)
+{
+       return container_of(target->arch_info,
+                       struct cortex_m3_common, armv7m);
+}
 
 #endif /* CORTEX_M3_H */