diff --git a/src/target/arm7tdmi.c b/src/target/arm7tdmi.c index e1e91c3a0..01685ab6a 100644 --- a/src/target/arm7tdmi.c +++ b/src/target/arm7tdmi.c @@ -613,6 +613,13 @@ static void arm7tdmi_build_reg_cache(struct target *target) (*cache_p) = arm_build_reg_cache(target, arm); } +static void arm7tdmi_free_reg_cache(struct target *target) +{ + struct arm *arm = target_to_arm(target); + + arm_free_reg_cache(arm); +} + int arm7tdmi_init_target(struct command_context *cmd_ctx, struct target *target) { arm7tdmi_build_reg_cache(target); @@ -620,6 +627,11 @@ int arm7tdmi_init_target(struct command_context *cmd_ctx, struct target *target) return ERROR_OK; } +void arm7tdmi_deinit_target(struct target *target) +{ + arm7tdmi_free_reg_cache(target); +} + int arm7tdmi_init_arch_info(struct target *target, struct arm7_9_common *arm7_9, struct jtag_tap *tap) { @@ -718,6 +730,7 @@ struct target_type arm7tdmi_target = { .commands = arm7_9_command_handlers, .target_create = arm7tdmi_target_create, .init_target = arm7tdmi_init_target, + .deinit_target = arm7tdmi_deinit_target, .examine = arm7_9_examine, .check_reset = arm7_9_check_reset, }; diff --git a/src/target/arm7tdmi.h b/src/target/arm7tdmi.h index 053f64df8..3cc3d4a7b 100644 --- a/src/target/arm7tdmi.h +++ b/src/target/arm7tdmi.h @@ -28,5 +28,6 @@ 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); +void arm7tdmi_deinit_target(struct target *target); #endif /* OPENOCD_TARGET_ARM7TDMI_H */