diff options
author | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-05-07 13:50:37 +0000 |
---|---|---|
committer | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-05-07 13:50:37 +0000 |
commit | 7e546bb91fe663461bf4a3d85380807c3659cee2 (patch) | |
tree | 6b3d1d7e0f4c1959e37ed500e4bee1f8941c6a0c /src/target/arm9tdmi.c | |
parent | dbe008302aaa7839d4d0657e887f8a6982d9e00d (diff) | |
download | riscv-openocd-7e546bb91fe663461bf4a3d85380807c3659cee2.zip riscv-openocd-7e546bb91fe663461bf4a3d85380807c3659cee2.tar.gz riscv-openocd-7e546bb91fe663461bf4a3d85380807c3659cee2.tar.bz2 |
remove in_handler usage
git-svn-id: svn://svn.berlios.de/openocd/trunk@1644 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target/arm9tdmi.c')
-rw-r--r-- | src/target/arm9tdmi.c | 52 |
1 files changed, 13 insertions, 39 deletions
diff --git a/src/target/arm9tdmi.c b/src/target/arm9tdmi.c index 6e13644..73f0879 100644 --- a/src/target/arm9tdmi.c +++ b/src/target/arm9tdmi.c @@ -283,34 +283,25 @@ int arm9tdmi_clock_data_in(arm_jtag_t *jtag_info, u32 *in) fields[0].tap = jtag_info->tap; fields[0].num_bits = 32; fields[0].out_value = NULL; - - fields[0].in_value = NULL; - fields[0].in_handler = arm_jtag_buf_to_u32; /* deprecated! invoke this from user code! */ - fields[0].in_handler_priv = in; - - + u8 tmp[4]; + fields[0].in_value = tmp; + fields[0].in_handler = NULL; fields[1].tap = jtag_info->tap; fields[1].num_bits = 3; fields[1].out_value = NULL; - fields[1].in_value = NULL; fields[1].in_handler = NULL; - - - fields[2].tap = jtag_info->tap; fields[2].num_bits = 32; fields[2].out_value = NULL; - fields[2].in_value = NULL; - - fields[2].in_handler = NULL; + jtag_add_dr_scan_now(3, fields, TAP_INVALID); - jtag_add_dr_scan(3, fields, TAP_INVALID); + *in=flip_u32(le_to_h_u32(tmp), 32); jtag_add_runtest(0, TAP_INVALID); @@ -335,6 +326,8 @@ int arm9tdmi_clock_data_in(arm_jtag_t *jtag_info, u32 *in) return ERROR_OK; } +extern void arm_endianness(u8 *tmp, void *in, int size, int be); + /* clock the target, and read the databus * the *in pointer points to a buffer where elements of 'size' bytes * are stored in big (be==1) or little (be==0) endianness @@ -355,45 +348,26 @@ 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 = NULL; - switch (size) - { - case 4: - fields[0].in_handler = (be) ? arm_jtag_buf_to_be32 : arm_jtag_buf_to_le32; /* deprecated! invoke this from user code! */ - break; - case 2: - fields[0].in_handler = (be) ? arm_jtag_buf_to_be16 : arm_jtag_buf_to_le16; /* deprecated! invoke this from user code! */ - break; - case 1: - fields[0].in_handler = arm_jtag_buf_to_8; /* deprecated! invoke this from user code! */ - break; - } - fields[0].in_handler_priv = in; - - + u8 tmp[4]; + fields[0].in_value = tmp; + fields[0].in_handler = NULL; fields[1].tap = jtag_info->tap; fields[1].num_bits = 3; fields[1].out_value = NULL; - fields[1].in_value = NULL; fields[1].in_handler = NULL; - - - fields[2].tap = jtag_info->tap; fields[2].num_bits = 32; fields[2].out_value = NULL; - fields[2].in_value = NULL; - - fields[2].in_handler = NULL; + jtag_add_dr_scan_now(3, fields, TAP_INVALID); + + arm_endianness(tmp, in, size, be); - jtag_add_dr_scan(3, fields, TAP_INVALID); jtag_add_runtest(0, TAP_INVALID); |