fix memory corruption introduce in 1730

git-svn-id: svn://svn.berlios.de/openocd/trunk@1753 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
oharboe 2009-05-12 07:03:50 +00:00
parent 71d76b0a74
commit a28fdee804
2 changed files with 8 additions and 8 deletions

View File

@ -244,9 +244,9 @@ void arm_endianness(u8 *tmp, void *in, int size, int be, int flip)
}
}
static int arm7endianness(u8 *in, jtag_callback_data_t size, jtag_callback_data_t be, jtag_callback_data_t dummy)
static int arm7endianness(u8 *in, jtag_callback_data_t size, jtag_callback_data_t be, jtag_callback_data_t captured)
{
arm_endianness(in, in, (int)size, (int)be, 1);
arm_endianness((u8 *)captured, in, (int)size, (int)be, 1);
return ERROR_OK;
}
@ -274,11 +274,11 @@ int arm7tdmi_clock_data_in_endianness(arm_jtag_t *jtag_info, void *in, int size,
fields[1].tap = jtag_info->tap;
fields[1].num_bits = 32;
fields[1].out_value = NULL;
fields[1].in_value = (u8 *)in;
jtag_alloc_in_value32(&fields[1]);
jtag_add_dr_scan(2, fields, TAP_INVALID);
jtag_add_callback4(arm7endianness, in, (jtag_callback_data_t)size, (jtag_callback_data_t)be, (jtag_callback_data_t)NULL);
jtag_add_callback4(arm7endianness, in, (jtag_callback_data_t)size, (jtag_callback_data_t)be, (jtag_callback_data_t)fields[1].in_value);
jtag_add_runtest(0, TAP_INVALID);

View File

@ -291,9 +291,9 @@ int arm9tdmi_clock_data_in(arm_jtag_t *jtag_info, u32 *in)
extern void arm_endianness(u8 *tmp, void *in, int size, int be, int flip);
static int arm9endianness(u8 *in, jtag_callback_data_t size, jtag_callback_data_t be, jtag_callback_data_t dummy)
static int arm9endianness(u8 *in, jtag_callback_data_t size, jtag_callback_data_t be, jtag_callback_data_t captured)
{
arm_endianness(in, in, (int)size, (int)be, 0);
arm_endianness((u8 *)captured, in, (int)size, (int)be, 0);
return ERROR_OK;
}
@ -317,7 +317,7 @@ int arm9tdmi_clock_data_in_endianness(arm_jtag_t *jtag_info, void *in, int size,
fields[0].tap = jtag_info->tap;
fields[0].num_bits = 32;
fields[0].out_value = NULL;
fields[0].in_value = (u8 *)in;
jtag_alloc_in_value32(&fields[0]);
fields[1].tap = jtag_info->tap;
fields[1].num_bits = 3;
@ -331,7 +331,7 @@ int arm9tdmi_clock_data_in_endianness(arm_jtag_t *jtag_info, void *in, int size,
jtag_add_dr_scan(3, fields, TAP_INVALID);
jtag_add_callback4(arm9endianness, in, (jtag_callback_data_t)size, (jtag_callback_data_t)be, 0);
jtag_add_callback4(arm9endianness, in, (jtag_callback_data_t)size, (jtag_callback_data_t)be, (jtag_callback_data_t)fields[0].in_value);
jtag_add_runtest(0, TAP_INVALID);