summaryrefslogtreecommitdiff
path: root/src/target/arm11_dbgtap.c
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-04-27 11:24:01 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-04-27 11:24:01 +0000
commit4866c8ed25ebc915db51824046589547f1f8585d (patch)
tree8abf7a877f82bf89a9803b42a0ec59debf70e23e /src/target/arm11_dbgtap.c
parente784db4fdd1e68d5469f1a1f8da10f86ea88ef3f (diff)
downloadopenocd+libswd-4866c8ed25ebc915db51824046589547f1f8585d.tar.gz
openocd+libswd-4866c8ed25ebc915db51824046589547f1f8585d.tar.bz2
openocd+libswd-4866c8ed25ebc915db51824046589547f1f8585d.tar.xz
openocd+libswd-4866c8ed25ebc915db51824046589547f1f8585d.zip
a little bit more error handling in ARM11
git-svn-id: svn://svn.berlios.de/openocd/trunk@1542 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target/arm11_dbgtap.c')
-rw-r--r--src/target/arm11_dbgtap.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/target/arm11_dbgtap.c b/src/target/arm11_dbgtap.c
index 9cc8ad03..73607176 100644
--- a/src/target/arm11_dbgtap.c
+++ b/src/target/arm11_dbgtap.c
@@ -216,7 +216,7 @@ void arm11_add_debug_INST(arm11_common_t * arm11, u32 inst, u8 * flag, tap_state
*
* \remarks This is a stand-alone function that executes the JTAG command queue.
*/
-u32 arm11_read_DSCR(arm11_common_t * arm11)
+int arm11_read_DSCR(arm11_common_t * arm11, u32 *value)
{
arm11_add_debug_SCAN_N(arm11, 0x01, ARM11_TAP_DEFAULT);
@@ -229,14 +229,20 @@ u32 arm11_read_DSCR(arm11_common_t * arm11)
arm11_add_dr_scan_vc(1, &chain1_field, TAP_DRPAUSE);
- jtag_execute_queue();
+ int retval;
+ if ((retval=jtag_execute_queue())!=ERROR_OK)
+ {
+ return retval;
+ }
if (arm11->last_dscr != dscr)
JTAG_DEBUG("DSCR = %08x (OLD %08x)", dscr, arm11->last_dscr);
arm11->last_dscr = dscr;
- return dscr;
+ *value=dscr;
+
+ return retval;
}
/** Write the Debug Status and Control Register (DSCR)