aboutsummaryrefslogtreecommitdiff
path: root/src/target/target.h
diff options
context:
space:
mode:
authorPaul Fertser <fercerpav@gmail.com>2015-02-11 11:08:40 +0300
committerPaul Fertser <fercerpav@gmail.com>2015-03-09 08:34:46 +0000
commit2d998c09446a230b669f0ea9771dabf2dbea2fe8 (patch)
tree8a64cf23acedb8e4ee2c91fa62db957813691bcb /src/target/target.h
parentebe9b7a6611210d185be88697457819f01df43ab (diff)
downloadriscv-openocd-2d998c09446a230b669f0ea9771dabf2dbea2fe8.zip
riscv-openocd-2d998c09446a230b669f0ea9771dabf2dbea2fe8.tar.gz
riscv-openocd-2d998c09446a230b669f0ea9771dabf2dbea2fe8.tar.bz2
server, target, cortex_m: add deinit_target to the API to free resources
This should facilitate dynamic target creation and removal. Currently it helps with getting 0 bytes lost report from Valgrind on exit (after talking to a nucleo board). However, 1,223,886 bytes in 5,268 blocks are still reachable which means the app holds pointers to that data on exit. The majority comes from the jtag command queue, there're also many blocks from TCL command registration. Change-Id: I7523234bb90fffd26f7d29cdd7648ddd221d46ab Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2544 Tested-by: jenkins Reviewed-by: Stian Skjelstad <stian@nixia.no>
Diffstat (limited to 'src/target/target.h')
-rw-r--r--src/target/target.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/target/target.h b/src/target/target.h
index f709d6a..fbce19f 100644
--- a/src/target/target.h
+++ b/src/target/target.h
@@ -615,6 +615,11 @@ int target_free_working_area(struct target *target, struct working_area *area);
void target_free_all_working_areas(struct target *target);
uint32_t target_get_working_area_avail(struct target *target);
+/**
+ * Free all the resources allocated by targets and the target layer
+ */
+void target_quit(void);
+
extern struct target *all_targets;
uint64_t target_buffer_get_u64(struct target *target, const uint8_t *buffer);