aboutsummaryrefslogtreecommitdiff
path: root/src/target/target.h
diff options
context:
space:
mode:
authorAndreas Fritiofson <andreas.fritiofson@gmail.com>2012-02-13 01:19:57 +0100
committerSpencer Oliver <spen@spen-soft.co.uk>2012-02-23 14:04:01 +0000
commit2eb564b756bb2b7c63c1510845a42491ef82fa8d (patch)
tree7b7bf5116de57996a78cca0fd662c4c174c3b978 /src/target/target.h
parent813f4a5411af9a397d6e9bbc682a43738b06baeb (diff)
target: add function to get number of bytes available in working area
This is a much cleaner solution to the problem of allocating as much working area as possible than what is currently being done in most/all flash drivers (which is: try an arbitrary sized chunk, if it fails, pick a smaller number, rinse and repeat). Use this function to find out how much working area is available, limit or restrict that amount at will and then simply allocate it. Change-Id: Ib7d5d0b7485aed3e0a4fad60c1bedb7dfd16146f Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/446 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src/target/target.h')
-rw-r--r--src/target/target.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/target/target.h b/src/target/target.h
index 680f8c32..a5ab3bdd 100644
--- a/src/target/target.h
+++ b/src/target/target.h
@@ -540,6 +540,7 @@ int target_alloc_working_area_try(struct target *target,
uint32_t size, struct working_area **area);
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);
extern struct target *all_targets;