X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Ftarget%2Ftarget.h;h=2c6f4cd50d680e37a2a9651b18f05946441b172b;hb=efcea8306af922d867ff93073959dad774e10f0c;hp=0292945d2c6e34a802f1889b7b64294fa54d97f8;hpb=3f0b17e48af9e3481084e1e9e697012b6824df43;p=openocd.git diff --git a/src/target/target.h b/src/target/target.h index 0292945d2c..2c6f4cd50d 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -94,7 +94,7 @@ struct working_area { uint32_t address; uint32_t size; - int free; + bool free; uint8_t *backup; struct working_area **user; struct working_area *next; @@ -107,6 +107,7 @@ struct target const char *cmd_name; /* tcl Name of target */ int target_number; /* DO NOT USE! field to be removed in 2010 */ struct jtag_tap *tap; /* where on the jtag chain is this */ + int coreid; /* which device on the TAP? */ const char *variant; /* what variant of this chip is it? */ /** @@ -257,6 +258,18 @@ int target_unregister_event_callback( int (*callback)(struct target *target, enum target_event event, void *priv), void *priv); +/* Poll the status of the target, detect any error conditions and report them. + * + * Also note that this fn will clear such error conditions, so a subsequent + * invocation will then succeed. + * + * These error conditions can be "sticky" error conditions. E.g. writing + * to memory could be implemented as an open loop and if memory writes + * fails, then a note is made of it, the error is sticky, but the memory + * write loop still runs to completion. This improves performance in the + * normal case as there is no need to verify that every single write succeed, + * yet it is possible to detect error condtions. + */ int target_poll(struct target *target); int target_resume(struct target *target, int current, uint32_t address, int handle_breakpoints, int debug_execution); @@ -452,6 +465,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);