summaryrefslogtreecommitdiff
path: root/src/target/target.h
diff options
context:
space:
mode:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-31 09:39:04 +0000
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-31 09:39:04 +0000
commit11edf227768f41b2a96c0d26a871f9e5f89d259a (patch)
tree8f020bee79c5278187470e7958988f23188d8cc1 /src/target/target.h
parent9cb3af610a1d7cc2d8c1433f54077938d0268a8f (diff)
downloadopenocd+libswd-11edf227768f41b2a96c0d26a871f9e5f89d259a.tar.gz
openocd+libswd-11edf227768f41b2a96c0d26a871f9e5f89d259a.tar.bz2
openocd+libswd-11edf227768f41b2a96c0d26a871f9e5f89d259a.tar.xz
openocd+libswd-11edf227768f41b2a96c0d26a871f9e5f89d259a.zip
Add target_bulk_write_memory wrapper:
- replaces all calls to target->type->bulk_write_memory. - add documentation in target_s to warn not to invoke callback directly. git-svn-id: svn://svn.berlios.de/openocd/trunk@1963 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target/target.h')
-rw-r--r--src/target/target.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/target/target.h b/src/target/target.h
index 662c95b9..9674c473 100644
--- a/src/target/target.h
+++ b/src/target/target.h
@@ -179,7 +179,11 @@ typedef struct target_type_s
*/
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 */
+ /**
+ * Write target memory in multiples of 4 bytes, optimized for
+ * writing large quantities of data. Do @b not call this
+ * function directly, use target_bulk_write_memory() instead.
+ */
int (*bulk_write_memory)(struct target_s *target, u32 address, u32 count, u8 *buffer);
int (*checksum_memory)(struct target_s *target, u32 address, u32 count, u32* checksum);
@@ -424,6 +428,16 @@ extern int target_read_memory(struct target_s *target,
extern int target_write_memory(struct target_s *target,
u32 address, u32 size, u32 count, u8 *buffer);
+/**
+ * Write @count items of 4 bytes to the memory of @a target at
+ * the @a address given. Because it operates only on whole words,
+ * this should be faster than target_write_memory().
+ *
+ * This routine is wrapper for target->type->bulk_write_memory.
+ */
+extern int target_bulk_write_memory(struct target_s *target,
+ u32 address, 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);