From be74db7341ffe4a2ce345574281f298e190a3e6d Mon Sep 17 00:00:00 2001 From: Andreas Fritiofson Date: Tue, 17 Sep 2013 22:09:22 +0200 Subject: [PATCH] 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 Reviewed-on: http://openocd.zylin.com/1628 Tested-by: jenkins Reviewed-by: Spencer Oliver --- src/target/target.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/target/target.c b/src/target/target.c index 9cc94f3a0..fce1cd42d 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -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) {