Restore mwh/mwb functionality.

Half-word and byte writes using mwh/mwb has been completely broken since
bf71e34cbf, because it dispatched all writes, regardless of access size,
to target_write_buffer(), which uses as large accesses as possible.

Partially revert the commit by changing back to the correct write method.

Change-Id: I60731fc576bf4a076a7da02bee7879e121c21d17
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1628
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
__archive__
Andreas Fritiofson 2013-09-17 22:09:22 +02:00
parent 1304b27d2a
commit be74db7341
1 changed files with 2 additions and 8 deletions

View File

@ -2744,12 +2744,6 @@ COMMAND_HANDLER(handle_md_command)
typedef int (*target_write_fn)(struct target *target,
uint32_t address, uint32_t size, uint32_t count, const uint8_t *buffer);
static int target_write_memory_fast(struct target *target,
uint32_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
{
return target_write_buffer(target, address, size * count, buffer);
}
static int target_fill_mem(struct target *target,
uint32_t address,
target_write_fn fn,
@ -2814,7 +2808,7 @@ COMMAND_HANDLER(handle_mw_command)
CMD_ARGV++;
fn = target_write_phys_memory;
} else
fn = target_write_memory_fast;
fn = target_write_memory;
if ((CMD_ARGC < 2) || (CMD_ARGC > 3))
return ERROR_COMMAND_SYNTAX_ERROR;
@ -4375,7 +4369,7 @@ static int jim_target_mw(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
}
target_write_fn fn;
fn = target_write_memory_fast;
fn = target_write_memory;
int e;
if (strcmp(Jim_GetString(argv[1], NULL), "phys") == 0) {