aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Fritiofson <andreas.fritiofson@gmail.com>2013-09-17 22:09:22 +0200
committerAndreas Fritiofson <andreas.fritiofson@gmail.com>2013-09-21 19:26:59 +0000
commitbe74db7341ffe4a2ce345574281f298e190a3e6d (patch)
tree9b5a84cf291a3b9c0bfae5f24f0fdccdce25e8f2
parent1304b27d2accf7a761ff3b0c12fd5332b3c0c4da (diff)
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>
-rw-r--r--src/target/target.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/target/target.c b/src/target/target.c
index 9cc94f3a..fce1cd42 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) {