From: oharboe at B. <oh...@ma...> - 2009-09-10 15:17:06
|
Author: oharboe Date: 2009-09-10 15:17:05 +0200 (Thu, 10 Sep 2009) New Revision: 2684 Modified: trunk/src/target/target.c Log: Alexei Babich <a.b...@re...> fix problems with unecessary tailend byte accesses. Use 16 bit access on tailend of a memory read if possible. Modified: trunk/src/target/target.c =================================================================== --- trunk/src/target/target.c 2009-09-10 08:06:22 UTC (rev 2683) +++ trunk/src/target/target.c 2009-09-10 13:17:05 UTC (rev 2684) @@ -1239,7 +1239,19 @@ address += aligned; size -= aligned; } + + /*prevent byte access when possible (avoid AHB access limitations in some cases)*/ + if(size >=2) + { + int aligned = size - (size%2); + retval = target_read_memory(target, address, 2, aligned / 2, buffer); + if (retval != ERROR_OK) + return retval; + buffer += aligned; + address += aligned; + size -= aligned; + } /* handle tail writes of less than 4 bytes */ if (size > 0) { |