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
This commit is contained in:
zwelch
2009-05-31 09:37:57 +00:00
parent b6db182c00
commit 95e13054ca
16 changed files with 126 additions and 107 deletions

View File

@@ -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);