zy1000: fix crash in JTAG over TCP/IP
authorØyvind Harboe <oyvind.harboe@zylin.com>
Tue, 13 Dec 2011 16:57:20 +0000 (17:57 +0100)
committerØyvind Harboe <oyvindharboe@gmail.com>
Tue, 13 Dec 2011 19:00:45 +0000 (19:00 +0000)
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>
src/jtag/zy1000/zy1000.c

index 7a3a0f2eacc416a52ca016205b54d13afa21e658..25783fa793171b3ad68662e1dcfbb11db7dfba37 100644 (file)
@@ -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

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)