arm_adi_v5: Fix packed and unaligned memory writes
commit2ab5d672ea5ce48694c8c74d0efa234fb2a50fe8
authorAndreas Fritiofson <andreas.fritiofson@gmail.com>
Sun, 22 Sep 2013 16:50:25 +0000 (22 18:50 +0200)
committerSpencer Oliver <spen@spen-soft.co.uk>
Wed, 2 Oct 2013 21:53:52 +0000 (2 21:53 +0000)
treed25e831c5e86bde745afb78e0151e5700d31adc5
parent4e79b48e2c7e535ef21178a69788c15b571c72ff
arm_adi_v5: Fix packed and unaligned memory writes

For packed and/or unaligned accesses, the write functions reordered the
source buffer in place. Causing in the best case a segfault, in the worst
case silent data corruption.

Rewrite the data fetching to directly match the byte lane mapping
according to IHI0031C, without destroying the buffer.

Also slightly clean up variable usage and harmonize all the write
functions.

Change-Id: I9a01cfc5578653f9ec02043ff6b61a7a20f90d67
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1646
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
src/target/arm_adi_v5.c