Restore mwh/mwb functionality. 28/1628/2
authorAndreas Fritiofson <andreas.fritiofson@gmail.com>
Tue, 17 Sep 2013 20:09:22 +0000 (22:09 +0200)
committerAndreas Fritiofson <andreas.fritiofson@gmail.com>
Sat, 21 Sep 2013 19:26:59 +0000 (19:26 +0000)
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>
src/target/target.c

index 9cc94f3a09782f73750f5148c1f827b10b1b7ac3..fce1cd42dff740bab04c97e1152b4053350a51ea 100644 (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) {

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)