summaryrefslogtreecommitdiff
path: root/src/target/target.h
diff options
context:
space:
mode:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-31 09:37:57 +0000
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-31 09:37:57 +0000
commit95e13054cafeeb13163d85822e4202e12007e1a7 (patch)
treee35b5658762512024c7ec750acd75bfae9874905 /src/target/target.h
parentb6db182c0020051e0dc642ca0b1040ea7453dcd0 (diff)
downloadopenocd_libswd-95e13054cafeeb13163d85822e4202e12007e1a7.tar.gz
openocd_libswd-95e13054cafeeb13163d85822e4202e12007e1a7.tar.bz2
openocd_libswd-95e13054cafeeb13163d85822e4202e12007e1a7.tar.xz
openocd_libswd-95e13054cafeeb13163d85822e4202e12007e1a7.zip
Add target_write_memory wrapper:
- replaces all calls to target->type->write_memory. - add documentation in target_s to warn not to invoke callback directly. git-svn-id: svn://svn.berlios.de/openocd/trunk@1960 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target/target.h')
-rw-r--r--src/target/target.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/target/target.h b/src/target/target.h
index b11e2b6b..2214c06e 100644
--- a/src/target/target.h
+++ b/src/target/target.h
@@ -167,6 +167,10 @@ typedef struct target_type_s
*/
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);
+ /**
+ * Target memory write callback. Do @b not call this function
+ * directly, use target_write_memory() instead.
+ */
int (*write_memory)(struct target_s *target, u32 address, u32 size, u32 count, u8 *buffer);
/* write target memory in multiples of 4 byte, optimized for writing large quantities of data */
@@ -383,6 +387,14 @@ extern target_t *get_target(const char *id);
*/
extern int target_read_memory(struct target_s *target,
u32 address, u32 size, u32 count, u8 *buffer);
+/**
+ * Write @count items of @a size bytes to the memory of @a target at
+ * the @a address given.
+ *
+ * This routine is wrapper for target->type->write_memory.
+ */
+extern int target_write_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);