summaryrefslogtreecommitdiff
path: root/src/target/target.h
diff options
context:
space:
mode:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-31 09:37:35 +0000
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-31 09:37:35 +0000
commitb6db182c0020051e0dc642ca0b1040ea7453dcd0 (patch)
tree17a4074984d6f72033f252e2e3361fd90cc8b96e /src/target/target.h
parent678519311834fd7a1126f8d217c734d4f5ffbb3d (diff)
downloadopenocd+libswd-b6db182c0020051e0dc642ca0b1040ea7453dcd0.tar.gz
openocd+libswd-b6db182c0020051e0dc642ca0b1040ea7453dcd0.tar.bz2
openocd+libswd-b6db182c0020051e0dc642ca0b1040ea7453dcd0.tar.xz
openocd+libswd-b6db182c0020051e0dc642ca0b1040ea7453dcd0.zip
Add target_read_memory wrapper:
- replaces all calls to target->type->read_memory. - add documentation in target_s to warn not to invoke callback directly. git-svn-id: svn://svn.berlios.de/openocd/trunk@1959 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target/target.h')
-rw-r--r--src/target/target.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/target/target.h b/src/target/target.h
index 09f8e9c3..b11e2b6b 100644
--- a/src/target/target.h
+++ b/src/target/target.h
@@ -161,6 +161,10 @@ typedef struct target_type_s
* count: number of items of <size>
*/
int (*read_memory_imp)(struct target_s *target, u32 address, u32 size, u32 count, u8 *buffer);
+ /**
+ * Target memory read callback. Do @b not call this function
+ * directly, use target_read_memory() instead.
+ */
int (*read_memory)(struct target_s *target, u32 address, u32 size, u32 count, u8 *buffer);
int (*write_memory_imp)(struct target_s *target, u32 address, u32 size, u32 count, u8 *buffer);
int (*write_memory)(struct target_s *target, u32 address, u32 size, u32 count, u8 *buffer);
@@ -371,6 +375,15 @@ extern target_t* get_current_target(struct command_context_s *cmd_ctx);
extern int get_num_by_target(target_t *query_target);
extern target_t *get_target(const char *id);
+/**
+ * Read @count items of @a size bytes from the memory of @a target at
+ * the @a address given.
+ *
+ * This routine is a wrapper for target->type->read_memory.
+ */
+extern int target_read_memory(struct target_s *target,
+ u32 address, u32 size, u32 count, u8 *buffer);
+
extern int target_write_buffer(struct target_s *target, u32 address, u32 size, u8 *buffer);
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);