return retval;
}
+void arm7_9_deinit(struct target *target)
+{
+ struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
+
+ if (target_was_examined(target))
+ embeddedice_free_reg_cache(arm7_9->eice_cache);
+
+ arm_jtag_close_connection(&arm7_9->jtag_info);
+}
int arm7_9_check_reset(struct target *target)
{
int arm7_9_init_arch_info(struct target *target, struct arm7_9_common *arm7_9);
int arm7_9_examine(struct target *target);
+void arm7_9_deinit(struct target *target);
int arm7_9_check_reset(struct target *target);
int arm7_9_endianness_callback(jtag_callback_data_t pu8_in,
return arm926ejs_init_arch_info(target, arm926ejs, target->tap);
}
+void arm926ejs_deinit_target(struct target *target)
+{
+ struct arm *arm = target_to_arm(target);
+ struct arm926ejs_common *arm926ejs = target_to_arm926(target);
+
+ arm7_9_deinit(target);
+ arm_free_reg_cache(arm);
+ free(arm926ejs);
+}
+
COMMAND_HANDLER(arm926ejs_handle_cache_info_command)
{
int retval;
.commands = arm926ejs_command_handlers,
.target_create = arm926ejs_target_create,
.init_target = arm9tdmi_init_target,
+ .deinit_target = arm926ejs_deinit_target,
.examine = arm7_9_examine,
.check_reset = arm7_9_check_reset,
.virt2phys = arm926ejs_virt2phys,
return jtag_register_event_callback(arm_jtag_reset_callback, jtag_info);
}
+
+int arm_jtag_close_connection(struct arm_jtag *jtag_info)
+{
+ return jtag_unregister_event_callback(arm_jtag_reset_callback, jtag_info);
+}
}
int arm_jtag_setup_connection(struct arm_jtag *jtag_info);
+int arm_jtag_close_connection(struct arm_jtag *jtag_info);
/* use this as a static so we can inline it in -O3 and refer to it via a pointer */
static inline void arm7flip32(jtag_callback_data_t arg)
return reg_cache;
}
+/**
+ * Free all memory allocated for EmbeddedICE register cache
+ */
+void embeddedice_free_reg_cache(struct reg_cache *reg_cache)
+{
+ if (!reg_cache)
+ return;
+
+ for (unsigned int i = 0; i < reg_cache->num_regs; i++)
+ free(reg_cache->reg_list[i].value);
+
+ free(reg_cache->reg_list[0].arch_info);
+ free(reg_cache->reg_list);
+ free(reg_cache);
+}
+
/**
* Initialize EmbeddedICE module, if needed.
*/
struct reg_cache *embeddedice_build_reg_cache(struct target *target,
struct arm7_9_common *arm7_9);
+void embeddedice_free_reg_cache(struct reg_cache *reg_cache);
int embeddedice_setup(struct target *target);