diff options
author | Øyvind Harboe <oyvind.harboe@zylin.com> | 2010-05-03 15:49:23 +0200 |
---|---|---|
committer | Øyvind Harboe <oyvind.harboe@zylin.com> | 2010-05-04 09:11:20 +0200 |
commit | 8865209545dae9c2745927758a51c60f922e02ca (patch) | |
tree | c2e0148b9ce02478e780a673755716318d31e9ab /src/target/target.h | |
parent | 32e647acf40bc11858a524e5ee73183ce0d9449b (diff) | |
download | openocd+libswd-8865209545dae9c2745927758a51c60f922e02ca.tar.gz openocd+libswd-8865209545dae9c2745927758a51c60f922e02ca.tar.bz2 openocd+libswd-8865209545dae9c2745927758a51c60f922e02ca.tar.xz openocd+libswd-8865209545dae9c2745927758a51c60f922e02ca.zip |
target: clean up target memory allocation error messages
target memory allocation can be implemented not to show
bogus error messages.
E.g. when trying a big allocation first and then a
smaller one if that fails.
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Diffstat (limited to 'src/target/target.h')
-rw-r--r-- | src/target/target.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/target/target.h b/src/target/target.h index 0292945d..4a48e5aa 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -452,6 +452,14 @@ const char *target_state_name( struct target *target ); */ int target_alloc_working_area(struct target *target, uint32_t size, struct working_area **area); +/* Same as target_alloc_working_area, except that no error is logged + * when ERROR_TARGET_RESOURCE_NOT_AVAILABLE is returned. + * + * This allows the calling code to *try* to allocate target memory + * and have a fallback to another behavior(slower?). + */ +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); |