target/aarch64: Add watchpoint support
[openocd.git] / src / target / dsp563xx.c
index 28fb8594d487a4578238a6a1979e245592b467d4..b825429e0b18ab50262dea954c4ecea66048ca94 100644 (file)
@@ -322,7 +322,7 @@ enum watchpoint_condition {
 #define INSTR_JUMP      0x0AF080
 /* Effective Addressing Mode Encoding */
 #define EAME_R0         0x10
-/* instrcution encoder */
+/* instruction encoder */
 /* movep
  * s - peripheral space X/Y (X=0,Y=1)
  * w - write/read
@@ -475,6 +475,7 @@ static void dsp563xx_build_reg_cache(struct target *target)
                reg_list[i].value = calloc(1, 4);
                reg_list[i].dirty = false;
                reg_list[i].valid = false;
+               reg_list[i].exist = true;
                reg_list[i].type = &dsp563xx_reg_type;
                reg_list[i].arch_info = &arch_info[i];
        }
@@ -936,7 +937,7 @@ static int dsp563xx_examine(struct target *target)
                if (((chip>>5)&0x1f) == 0)
                        chip += 300;
 
-               LOG_INFO("DSP56%03" PRId32 " device found", chip);
+               LOG_INFO("DSP56%03" PRIu32 " device found", chip);
 
                /* Clear all breakpoints */
                dsp563xx_once_reg_write(target->tap, 1, DSP563XX_ONCE_OBCR, 0);
@@ -1358,7 +1359,7 @@ static int dsp563xx_deassert_reset(struct target *target)
                if (target->state == TARGET_HALTED) {
                        /* after a reset the cpu jmp to the
                         * reset vector and need 2 cycles to fill
-                        * the cache (fetch,decode,excecute)
+                        * the cache (fetch,decode,execute)
                         */
                        err = dsp563xx_step_ex(target, 1, 0, 1, 1);
                        if (err != ERROR_OK)
@@ -1875,67 +1876,6 @@ static int dsp563xx_remove_watchpoint(struct target *target, struct watchpoint *
        return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
 }
 
-static void handle_md_output(struct command_invocation *cmd,
-       struct target *target,
-       uint32_t address,
-       unsigned size,
-       unsigned count,
-       const uint8_t *buffer)
-{
-       const unsigned line_bytecnt = 32;
-       unsigned line_modulo = line_bytecnt / size;
-
-       char output[line_bytecnt * 4 + 1];
-       unsigned output_len = 0;
-
-       const char *value_fmt;
-       switch (size) {
-               case 4:
-                       value_fmt = "%8.8x ";
-                       break;
-               case 2:
-                       value_fmt = "%4.4x ";
-                       break;
-               case 1:
-                       value_fmt = "%2.2x ";
-                       break;
-               default:
-                       /* "can't happen", caller checked */
-                       LOG_ERROR("invalid memory read size: %u", size);
-                       return;
-       }
-
-       for (unsigned i = 0; i < count; i++) {
-               if (i % line_modulo == 0)
-                       output_len += snprintf(output + output_len,
-                                       sizeof(output) - output_len,
-                                       "0x%8.8x: ",
-                                       (unsigned) (address + i));
-
-               uint32_t value = 0;
-               const uint8_t *value_ptr = buffer + i * size;
-               switch (size) {
-                       case 4:
-                               value = target_buffer_get_u32(target, value_ptr);
-                               break;
-                       case 2:
-                               value = target_buffer_get_u16(target, value_ptr);
-                               break;
-                       case 1:
-                               value = *value_ptr;
-               }
-               output_len += snprintf(output + output_len,
-                               sizeof(output) - output_len,
-                               value_fmt,
-                               value);
-
-               if ((i % line_modulo == line_modulo - 1) || (i == count - 1)) {
-                       command_print(cmd->ctx, "%s", output);
-                       output_len = 0;
-               }
-       }
-}
-
 static int dsp563xx_add_custom_watchpoint(struct target *target, uint32_t address, uint32_t memType,
                enum watchpoint_rw rw, enum watchpoint_condition cond)
 {
@@ -2208,7 +2148,7 @@ COMMAND_HANDLER(dsp563xx_mem_command)
                err = dsp563xx_read_memory(target, mem_type, address, sizeof(uint32_t),
                                count, buffer);
                if (err == ERROR_OK)
-                       handle_md_output(CMD, target, address, sizeof(uint32_t), count, buffer);
+                       target_handle_md_output(CMD, target, address, sizeof(uint32_t), count, buffer);
 
        } else {
                b = buffer;

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)