cortex_a: fix lockup when writing to high address
commit7b6158db4ee38aa9b10cae667c081ee781411f83
authorSeth LaForge <sethml@google.com>
Tue, 6 May 2014 23:02:23 +0000 (6 16:02 -0700)
committerAndreas Fritiofson <andreas.fritiofson@gmail.com>
Sun, 22 Jun 2014 08:23:53 +0000 (22 08:23 +0000)
treea38007f27d13fe5d3a9336845cd1aee12e7937df
parenta0e37fe2c0c0a62c9c314e62c494e12359a819e0
cortex_a: fix lockup when writing to high address

On a processor with caches, when you write data to memory OpenOCD invalidates
the cache lines affected. If you write to an address within 64 bytes of
UINT32_MAX, then the for loop control variable wrapped around resulting in an
infinite loop. Change control variable to be an offset from the address
involved. We should never be asked to write 2^32 bytes, so wraparound should
not be a problem.

Change-Id: Ibfe654113eff71684862ff651e7a1cd05ccc6760
Signed-off-by: Seth LaForge <sethml@google.com>
Reviewed-on: http://openocd.zylin.com/2126
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
src/target/cortex_a.c