summaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-12 07:03:50 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-12 07:03:50 +0000
commita28fdee804981e2015b2aba299e57d635a6e32db (patch)
treefe247261f41a4c8fb04b5ffb724fd5be1f2f123d /src/target
parent71d76b0a74bee78bd9aade2957e92c6b420372b9 (diff)
downloadopenocd+libswd-a28fdee804981e2015b2aba299e57d635a6e32db.tar.gz
openocd+libswd-a28fdee804981e2015b2aba299e57d635a6e32db.tar.bz2
openocd+libswd-a28fdee804981e2015b2aba299e57d635a6e32db.tar.xz
openocd+libswd-a28fdee804981e2015b2aba299e57d635a6e32db.zip
fix memory corruption introduce in 1730
git-svn-id: svn://svn.berlios.de/openocd/trunk@1753 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target')
-rw-r--r--src/target/arm7tdmi.c8
-rw-r--r--src/target/arm9tdmi.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/src/target/arm7tdmi.c b/src/target/arm7tdmi.c
index 44d9b0a5..93281ce5 100644
--- a/src/target/arm7tdmi.c
+++ b/src/target/arm7tdmi.c
@@ -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);
diff --git a/src/target/arm9tdmi.c b/src/target/arm9tdmi.c
index 0e2e1b46..4bcffd07 100644
--- a/src/target/arm9tdmi.c
+++ b/src/target/arm9tdmi.c
@@ -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);