forked from auracaster/openocd
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>
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user