helper/command: change prototype of command_print/command_print_sameline
[openocd.git] / src / target / xscale.c
index a090c4b3910666f4d8b0c6515d62cbb3001aa942..093925b6271cae845f7ad731e5e20bbf0a06d093 100644 (file)
@@ -142,7 +142,7 @@ static int xscale_verify_pointer(struct command_invocation *cmd,
        struct xscale_common *xscale)
 {
        if (xscale->common_magic != XSCALE_COMMON_MAGIC) {
        struct xscale_common *xscale)
 {
        if (xscale->common_magic != XSCALE_COMMON_MAGIC) {
-               command_print(cmd->ctx, xscale_not);
+               command_print(cmd, xscale_not);
                return ERROR_TARGET_INVALID;
        }
        return ERROR_OK;
                return ERROR_TARGET_INVALID;
        }
        return ERROR_OK;
@@ -2658,9 +2658,9 @@ static inline void xscale_display_instruction(struct target *target, uint32_t pc
 {
        int retval = xscale_read_instruction(target, pc, instruction);
        if (retval == ERROR_OK)
 {
        int retval = xscale_read_instruction(target, pc, instruction);
        if (retval == ERROR_OK)
-               command_print(cmd->ctx, "%s", instruction->text);
+               command_print(cmd, "%s", instruction->text);
        else
        else
-               command_print(cmd->ctx, "0x%8.8" PRIx32 "\t<not found in image>", pc);
+               command_print(cmd, "0x%8.8" PRIx32 "\t<not found in image>", pc);
 }
 
 static int xscale_analyze_trace(struct target *target, struct command_invocation *cmd)
 }
 
 static int xscale_analyze_trace(struct target *target, struct command_invocation *cmd)
@@ -2787,7 +2787,7 @@ static int xscale_analyze_trace(struct target *target, struct command_invocation
                                continue;
 
                        if (exception) {
                                continue;
 
                        if (exception) {
-                               command_print(cmd->ctx, "--- exception %i ---", exception);
+                               command_print(cmd, "--- exception %i ---", exception);
                                continue;
                        }
 
                                continue;
                        }
 
@@ -2813,7 +2813,7 @@ static int xscale_analyze_trace(struct target *target, struct command_invocation
                                }
 
                                if (current_pc == 0)
                                }
 
                                if (current_pc == 0)
-                                       command_print(cmd->ctx, "address unknown");
+                                       command_print(cmd, "address unknown");
 
                                continue;
                        }
 
                                continue;
                        }
@@ -3136,7 +3136,7 @@ COMMAND_HANDLER(xscale_handle_mmu_command)
                return retval;
 
        if (target->state != TARGET_HALTED) {
                return retval;
 
        if (target->state != TARGET_HALTED) {
-               command_print(CMD_CTX, "target must be stopped for \"%s\" command", CMD_NAME);
+               command_print(CMD, "target must be stopped for \"%s\" command", CMD_NAME);
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
@@ -3150,7 +3150,7 @@ COMMAND_HANDLER(xscale_handle_mmu_command)
                xscale->armv4_5_mmu.mmu_enabled = enable;
        }
 
                xscale->armv4_5_mmu.mmu_enabled = enable;
        }
 
-       command_print(CMD_CTX, "mmu %s",
+       command_print(CMD, "mmu %s",
                (xscale->armv4_5_mmu.mmu_enabled) ? "enabled" : "disabled");
 
        return ERROR_OK;
                (xscale->armv4_5_mmu.mmu_enabled) ? "enabled" : "disabled");
 
        return ERROR_OK;
@@ -3166,7 +3166,7 @@ COMMAND_HANDLER(xscale_handle_idcache_command)
                return retval;
 
        if (target->state != TARGET_HALTED) {
                return retval;
 
        if (target->state != TARGET_HALTED) {
-               command_print(CMD_CTX, "target must be stopped for \"%s\" command", CMD_NAME);
+               command_print(CMD, "target must be stopped for \"%s\" command", CMD_NAME);
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
@@ -3195,7 +3195,7 @@ COMMAND_HANDLER(xscale_handle_idcache_command)
                xscale->armv4_5_mmu.armv4_5_cache.i_cache_enabled :
                xscale->armv4_5_mmu.armv4_5_cache.d_u_cache_enabled;
        const char *msg = enabled ? "enabled" : "disabled";
                xscale->armv4_5_mmu.armv4_5_cache.i_cache_enabled :
                xscale->armv4_5_mmu.armv4_5_cache.d_u_cache_enabled;
        const char *msg = enabled ? "enabled" : "disabled";
-       command_print(CMD_CTX, "%s %s", CMD_NAME, msg);
+       command_print(CMD, "%s %s", CMD_NAME, msg);
 
        return ERROR_OK;
 }
 
        return ERROR_OK;
 }
@@ -3257,7 +3257,7 @@ COMMAND_HANDLER(xscale_handle_vector_catch_command)
 
        dcsr_value = buf_get_u32(dcsr_reg->value, 0, 32);
        for (unsigned i = 0; i < ARRAY_SIZE(vec_ids); i++) {
 
        dcsr_value = buf_get_u32(dcsr_reg->value, 0, 32);
        for (unsigned i = 0; i < ARRAY_SIZE(vec_ids); i++) {
-               command_print(CMD_CTX, "%15s: %s", vec_ids[i].name,
+               command_print(CMD, "%15s: %s", vec_ids[i].name,
                        (dcsr_value & vec_ids[i].mask) ? "catch" : "ignore");
        }
 
                        (dcsr_value & vec_ids[i].mask) ? "catch" : "ignore");
        }
 
@@ -3279,16 +3279,16 @@ COMMAND_HANDLER(xscale_handle_vector_table_command)
        if (CMD_ARGC == 0) {    /* print current settings */
                int idx;
 
        if (CMD_ARGC == 0) {    /* print current settings */
                int idx;
 
-               command_print(CMD_CTX, "active user-set static vectors:");
+               command_print(CMD, "active user-set static vectors:");
                for (idx = 1; idx < 8; idx++)
                        if (xscale->static_low_vectors_set & (1 << idx))
                for (idx = 1; idx < 8; idx++)
                        if (xscale->static_low_vectors_set & (1 << idx))
-                               command_print(CMD_CTX,
+                               command_print(CMD,
                                        "low  %d: 0x%" PRIx32,
                                        idx,
                                        xscale->static_low_vectors[idx]);
                for (idx = 1; idx < 8; idx++)
                        if (xscale->static_high_vectors_set & (1 << idx))
                                        "low  %d: 0x%" PRIx32,
                                        idx,
                                        xscale->static_low_vectors[idx]);
                for (idx = 1; idx < 8; idx++)
                        if (xscale->static_high_vectors_set & (1 << idx))
-                               command_print(CMD_CTX,
+                               command_print(CMD,
                                        "high %d: 0x%" PRIx32,
                                        idx,
                                        xscale->static_high_vectors[idx]);
                                        "high %d: 0x%" PRIx32,
                                        idx,
                                        xscale->static_high_vectors[idx]);
@@ -3335,7 +3335,7 @@ COMMAND_HANDLER(xscale_handle_trace_buffer_command)
                return retval;
 
        if (target->state != TARGET_HALTED) {
                return retval;
 
        if (target->state != TARGET_HALTED) {
-               command_print(CMD_CTX, "target must be stopped for \"%s\" command", CMD_NAME);
+               command_print(CMD, "target must be stopped for \"%s\" command", CMD_NAME);
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
@@ -3354,7 +3354,7 @@ COMMAND_HANDLER(xscale_handle_trace_buffer_command)
                        if (CMD_ARGC >= 3)
                                COMMAND_PARSE_NUMBER(int, CMD_ARGV[2], buffcount);
                        if (buffcount < 1) {            /* invalid */
                        if (CMD_ARGC >= 3)
                                COMMAND_PARSE_NUMBER(int, CMD_ARGV[2], buffcount);
                        if (buffcount < 1) {            /* invalid */
-                               command_print(CMD_CTX, "fill buffer count must be > 0");
+                               command_print(CMD, "fill buffer count must be > 0");
                                xscale->trace.mode = XSCALE_TRACE_DISABLED;
                                return ERROR_COMMAND_SYNTAX_ERROR;
                        }
                                xscale->trace.mode = XSCALE_TRACE_DISABLED;
                                return ERROR_COMMAND_SYNTAX_ERROR;
                        }
@@ -3371,11 +3371,11 @@ COMMAND_HANDLER(xscale_handle_trace_buffer_command)
        if (xscale->trace.mode != XSCALE_TRACE_DISABLED) {
                char fill_string[12];
                sprintf(fill_string, "fill %d", xscale->trace.buffer_fill);
        if (xscale->trace.mode != XSCALE_TRACE_DISABLED) {
                char fill_string[12];
                sprintf(fill_string, "fill %d", xscale->trace.buffer_fill);
-               command_print(CMD_CTX, "trace buffer enabled (%s)",
+               command_print(CMD, "trace buffer enabled (%s)",
                        (xscale->trace.mode == XSCALE_TRACE_FILL)
                        ? fill_string : "wrap");
        } else
                        (xscale->trace.mode == XSCALE_TRACE_FILL)
                        ? fill_string : "wrap");
        } else
-               command_print(CMD_CTX, "trace buffer disabled");
+               command_print(CMD, "trace buffer disabled");
 
        dcsr_value = buf_get_u32(xscale->reg_cache->reg_list[XSCALE_DCSR].value, 0, 32);
        if (xscale->trace.mode == XSCALE_TRACE_FILL)
 
        dcsr_value = buf_get_u32(xscale->reg_cache->reg_list[XSCALE_DCSR].value, 0, 32);
        if (xscale->trace.mode == XSCALE_TRACE_FILL)
@@ -3402,7 +3402,7 @@ COMMAND_HANDLER(xscale_handle_trace_image_command)
        if (xscale->trace.image) {
                image_close(xscale->trace.image);
                free(xscale->trace.image);
        if (xscale->trace.image) {
                image_close(xscale->trace.image);
                free(xscale->trace.image);
-               command_print(CMD_CTX, "previously loaded image found and closed");
+               command_print(CMD, "previously loaded image found and closed");
        }
 
        xscale->trace.image = malloc(sizeof(struct image));
        }
 
        xscale->trace.image = malloc(sizeof(struct image));
@@ -3439,7 +3439,7 @@ COMMAND_HANDLER(xscale_handle_dump_trace_command)
                return retval;
 
        if (target->state != TARGET_HALTED) {
                return retval;
 
        if (target->state != TARGET_HALTED) {
-               command_print(CMD_CTX, "target must be stopped for \"%s\" command", CMD_NAME);
+               command_print(CMD, "target must be stopped for \"%s\" command", CMD_NAME);
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
@@ -3449,7 +3449,7 @@ COMMAND_HANDLER(xscale_handle_dump_trace_command)
        trace_data = xscale->trace.data;
 
        if (!trace_data) {
        trace_data = xscale->trace.data;
 
        if (!trace_data) {
-               command_print(CMD_CTX, "no trace data collected");
+               command_print(CMD, "no trace data collected");
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
@@ -3502,7 +3502,7 @@ COMMAND_HANDLER(xscale_handle_cp15)
                return retval;
 
        if (target->state != TARGET_HALTED) {
                return retval;
 
        if (target->state != TARGET_HALTED) {
-               command_print(CMD_CTX, "target must be stopped for \"%s\" command", CMD_NAME);
+               command_print(CMD, "target must be stopped for \"%s\" command", CMD_NAME);
                return ERROR_OK;
        }
        uint32_t reg_no = 0;
                return ERROR_OK;
        }
        uint32_t reg_no = 0;
@@ -3536,7 +3536,7 @@ COMMAND_HANDLER(xscale_handle_cp15)
                                reg_no = XSCALE_CPACCESS;
                                break;
                        default:
                                reg_no = XSCALE_CPACCESS;
                                break;
                        default:
-                               command_print(CMD_CTX, "invalid register number");
+                               command_print(CMD, "invalid register number");
                                return ERROR_COMMAND_SYNTAX_ERROR;
                }
                reg = &xscale->reg_cache->reg_list[reg_no];
                                return ERROR_COMMAND_SYNTAX_ERROR;
                }
                reg = &xscale->reg_cache->reg_list[reg_no];
@@ -3548,7 +3548,7 @@ COMMAND_HANDLER(xscale_handle_cp15)
                /* read cp15 control register */
                xscale_get_reg(reg);
                value = buf_get_u32(reg->value, 0, 32);
                /* read cp15 control register */
                xscale_get_reg(reg);
                value = buf_get_u32(reg->value, 0, 32);
-               command_print(CMD_CTX, "%s (/%i): 0x%" PRIx32 "", reg->name, (int)(reg->size),
+               command_print(CMD, "%s (/%i): 0x%" PRIx32 "", reg->name, (int)(reg->size),
                        value);
        } else if (CMD_ARGC == 2) {
                uint32_t value;
                        value);
        } else if (CMD_ARGC == 2) {
                uint32_t value;

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)