xscale: better fix for debug_handler.bin
[openocd.git] / src / target / xscale.c
index dd16b35e52d275d1e31eea890db375f1b86bb11b..640eb01b6712531ff41f5851cf4c8b4077a112bb 100644 (file)
@@ -69,6 +69,17 @@ static int xscale_unset_breakpoint(struct target_s *, breakpoint_t *);
 static int xscale_read_trace(target_t *);
 
 
+/* This XScale "debug handler" is loaded into the processor's
+ * mini-ICache, which is 2K of code writable only via JTAG.
+ *
+ * FIXME  the OpenOCD "bin2char" utility currently doesn't handle
+ * binary files cleanly.  It's string oriented, and terminates them
+ * with a NUL character.  Better would be to generate the constants
+ * and let other code decide names, scoping, and other housekeeping.
+ */
+static /* unsigned const char xscale_debug_handler[] = ... */
+#include "xscale_debug.h"
+
 static char *const xscale_reg_list[] =
 {
        "XSCALE_MAINID",                /* 0 */
@@ -1594,7 +1605,7 @@ static int xscale_deassert_reset(target_t *target)
                 * force that, so writing new contents is reliable...
                 */
                address = xscale->handler_address;
-               for (unsigned binary_size = xscale_debug_handler_size;
+               for (unsigned binary_size = sizeof xscale_debug_handler - 1;
                                binary_size > 0;
                                binary_size -= buf_cnt, buffer += buf_cnt)
                {
@@ -3030,7 +3041,7 @@ static int xscale_target_create(struct target_s *target, Jim_Interp *interp)
 {
        xscale_common_t *xscale;
 
-       if (xscale_debug_handler_size > 0x800) {
+       if (sizeof xscale_debug_handler - 1 > 0x800) {
                LOG_ERROR("debug_handler.bin: larger than 2kb");
                return ERROR_FAIL;
        }

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)