aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2011-12-13 17:57:20 +0100
committerØyvind Harboe <oyvindharboe@gmail.com>2011-12-13 19:00:45 +0000
commit230f0e9dc64efd379866e632969966ce64b07f1a (patch)
tree4b5b96d9e744936360cafdaee073039f1522c613 /src
parente8d1da15c2b82bdd059da2c9660a4339d01b01ad (diff)
zy1000: fix crash in JTAG over TCP/IP
disable asynchronous callbacks and reads as minidriver requires reads and callbacks to be synchronous. Could possibly be fixed by some design work. Change-Id: I7ca79a551085b2e8ba6928e1762d1baed6e95d4b Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/260 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com> Tested-by: Øyvind Harboe <oyvindharboe@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/jtag/zy1000/zy1000.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/jtag/zy1000/zy1000.c b/src/jtag/zy1000/zy1000.c
index 7a3a0f2e..25783fa7 100644
--- a/src/jtag/zy1000/zy1000.c
+++ b/src/jtag/zy1000/zy1000.c
@@ -1296,6 +1296,15 @@ void zy1000_jtag_add_callback4(jtag_callback_t callback, jtag_callback_data_t da
callbackqueue[callbackqueue_pos].data2 = data2;
callbackqueue[callbackqueue_pos].data3 = data3;
callbackqueue_pos++;
+
+ /* KLUDGE!
+ * make callbacks synchronous for now as minidriver requires callback
+ * to be synchronous.
+ *
+ * We can get away with making read and writes asynchronous so we
+ * don't completely kill performance.
+ */
+ zy1000_flush_callbackqueue();
}
static int zy1000_jtag_convert_to_callback4(jtag_callback_data_t data0, jtag_callback_data_t data1, jtag_callback_data_t data2, jtag_callback_data_t data3)
@@ -1342,6 +1351,9 @@ static void writeShiftValue(uint8_t *data, int bits)
readqueue[readqueue_pos].dest = data;
readqueue[readqueue_pos].bits = bits;
readqueue_pos++;
+
+ /* KLUDGE!!! minidriver requires readqueue to be synchronous */
+ zy1000_flush_readqueue();
}
#else