aboutsummaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
authorSpencer Oliver <spen@spen-soft.co.uk>2013-10-24 23:26:51 +0100
committerSpencer Oliver <spen@spen-soft.co.uk>2013-11-07 21:38:49 +0000
commitedfb677d3466a0d88fe9bd5ec1d8785a41b6bc4e (patch)
treeca2c571b896e0e8806fce283ac4816035417a17b /src/target
parent2ad2554e522c610af85e6ea2385eb824c3a89104 (diff)
target: use target_buffer_set_u32_array
Attempt to use target_buffer_set_u32_array to convert to target endian arrays rather reimplementing code. This also removed cfi_fix_code_endian as its functionality is also repeated. Change-Id: I7c359dbe46ea791cd5f6fb18d8b0fb6895c599d3 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1783 Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Diffstat (limited to 'src/target')
-rw-r--r--src/target/arm7_9_common.c4
-rw-r--r--src/target/feroceon.c3
2 files changed, 2 insertions, 5 deletions
diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c
index 6b1a1731..7f0e3adb 100644
--- a/src/target/arm7_9_common.c
+++ b/src/target/arm7_9_common.c
@@ -2576,7 +2576,6 @@ int arm7_9_bulk_write_memory(struct target *target,
{
int retval;
struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
- int i;
if (address % 4 != 0)
return ERROR_TARGET_UNALIGNED_ACCESS;
@@ -2595,8 +2594,7 @@ int arm7_9_bulk_write_memory(struct target *target,
}
/* copy target instructions to target endianness */
- for (i = 0; i < 6; i++)
- target_buffer_set_u32(target, dcc_code_buf + i*4, dcc_code[i]);
+ target_buffer_set_u32_array(target, dcc_code_buf, ARRAY_SIZE(dcc_code), dcc_code);
/* write DCC code to working area, using the non-optimized
* memory write to avoid ending up here again */
diff --git a/src/target/feroceon.c b/src/target/feroceon.c
index acaa1b3b..ee0bafd2 100644
--- a/src/target/feroceon.c
+++ b/src/target/feroceon.c
@@ -510,8 +510,7 @@ static int feroceon_bulk_write_memory(struct target *target,
}
/* copy target instructions to target endianness */
- for (i = 0; i < dcc_size/4; i++)
- target_buffer_set_u32(target, dcc_code_buf + i*4, dcc_code[i]);
+ target_buffer_set_u32_array(target, dcc_code_buf, ARRAY_SIZE(dcc_code), dcc_code);
/* write DCC code to working area, using the non-optimized
* memory write to avoid ending up here again */