summaryrefslogtreecommitdiff
path: root/src/target/target.h
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-04-03 14:00:17 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-04-03 14:00:17 +0000
commitd3f0549f08d8aac36143bca9e7f7e1308383b7c2 (patch)
treeb1057d6e4ebd1e1dbe560bac2f2330f11d47827b /src/target/target.h
parent349f62f74fdc1278efd00a0e6301e1a0199cc128 (diff)
downloadopenocd+libswd-d3f0549f08d8aac36143bca9e7f7e1308383b7c2.tar.gz
openocd+libswd-d3f0549f08d8aac36143bca9e7f7e1308383b7c2.tar.bz2
openocd+libswd-d3f0549f08d8aac36143bca9e7f7e1308383b7c2.tar.xz
openocd+libswd-d3f0549f08d8aac36143bca9e7f7e1308383b7c2.zip
- Work on fixing erase check. Many implementations are plain broken.
Wrote a default flash erase check fn which uses CFI's target algorithm w/fallback to memory reads. - "flash info" no longer prints erase status as it is stale. - "flash erase_check" now prints erase status. erase check can take a *long* time. Work in progress - arm7/9 with seperate srst & trst now supports reset init/halt after a power outage. arm7/9 no longer makes any assumptions about state of target when reset is asserted. - fixes for srst & trst capable arm7/9 with reset init/halt - prepare_reset_halt retired. This code needs to be inside assert_reset anyway - haven't been able to get stm32 write algorithm to work. Fallback flash write does work. Haven't found a version of openocd trunk where this works. - added target_free_all_working_areas_restore() which can let be of restoring backups. This is needed when asserting reset as the target must be assumed to be an unknown state. Added some comments to working areas API - str9 reset script fixes - some guidelines - fixed dangling callbacks upon reset timeout git-svn-id: svn://svn.berlios.de/openocd/trunk@536 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target/target.h')
-rw-r--r--src/target/target.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/target/target.h b/src/target/target.h
index fa83949b..6ce8fee9 100644
--- a/src/target/target.h
+++ b/src/target/target.h
@@ -121,11 +121,19 @@ typedef struct target_type_s
int (*resume)(struct target_s *target, int current, u32 address, int handle_breakpoints, int debug_execution);
int (*step)(struct target_s *target, int current, u32 address, int handle_breakpoints);
- /* target reset control */
+ /* target reset control. assert reset can be invoked when OpenOCD and
+ * the target is out of sync.
+ *
+ * A typical example is that the target was power cycled while OpenOCD
+ * thought the target was halted or running.
+ *
+ * assert_reset() can therefore make no assumptions whatsoever about the
+ * state of the target
+ *
+ */
int (*assert_reset)(struct target_s *target);
int (*deassert_reset)(struct target_s *target);
int (*soft_reset_halt)(struct target_s *target);
- int (*prepare_reset_halt)(struct target_s *target);
/* target register access for gdb.
*
@@ -258,9 +266,23 @@ extern int target_write_buffer(struct target_s *target, u32 address, u32 size, u
extern int target_read_buffer(struct target_s *target, u32 address, u32 size, u8 *buffer);
extern int target_checksum_memory(struct target_s *target, u32 address, u32 size, u32* crc);
+/* DANGER!!!!!
+ *
+ * if "area" passed in to target_alloc_working_area() points to a memory
+ * location that goes out of scope (e.g. a pointer on the stack), then
+ * the caller of target_alloc_working_area() is responsible for invoking
+ * target_free_working_area() before "area" goes out of scope.
+ *
+ * target_free_all_working_areas() will NULL out the "area" pointer
+ * upon resuming or resetting the CPU.
+ *
+ */
extern int target_alloc_working_area(struct target_s *target, u32 size, working_area_t **area);
extern int target_free_working_area(struct target_s *target, working_area_t *area);
+extern int target_free_working_area_restore(struct target_s *target, working_area_t *area, int restore);
extern int target_free_all_working_areas(struct target_s *target);
+extern int target_free_all_working_areas_restore(struct target_s *target, int restore);
+
extern target_t *targets;