Browse Source

Alexei Babich <a.babich@rez.ru> fix problems with unecessary tailend byte accesses. Use 16 bit access on tailend of a memory read if possible.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2684 b42882b7-edfa-0310-969c-e2dbd0fdcd60
tags/v0.3.0-rc0
oharboe 14 years ago
parent
commit
3bade442b1
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      src/target/target.c

+ 12
- 0
src/target/target.c View File

@@ -1239,7 +1239,19 @@ int target_read_buffer(struct target_s *target, uint32_t address, uint32_t size,
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)
{


Loading…
Cancel
Save