target/xtensa: avoid IHI for writes to non-executable memory
[openocd.git] / src / target / xscale.c
index 4927d009170a33d58df5d8125681f1ef5dec1c93..fbf43516d02fcbb446287ee7939c51c18974630e 100644 (file)
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
+// SPDX-License-Identifier: GPL-2.0-or-later
 
 /***************************************************************************
  *   Copyright (C) 2006, 2007 by Dominic Rath                              *
@@ -1118,7 +1118,7 @@ static int xscale_resume(struct target *target, int current,
        LOG_DEBUG("-");
 
        if (target->state != TARGET_HALTED) {
-               LOG_WARNING("target not halted");
+               LOG_TARGET_ERROR(target, "not halted");
                return ERROR_TARGET_NOT_HALTED;
        }
 
@@ -1382,7 +1382,7 @@ static int xscale_step(struct target *target, int current,
        int retval;
 
        if (target->state != TARGET_HALTED) {
-               LOG_WARNING("target not halted");
+               LOG_TARGET_ERROR(target, "not halted");
                return ERROR_TARGET_NOT_HALTED;
        }
 
@@ -1632,7 +1632,7 @@ static int xscale_full_context(struct target *target)
        LOG_DEBUG("-");
 
        if (target->state != TARGET_HALTED) {
-               LOG_WARNING("target not halted");
+               LOG_TARGET_ERROR(target, "not halted");
                return ERROR_TARGET_NOT_HALTED;
        }
 
@@ -1705,7 +1705,7 @@ static int xscale_restore_banked(struct target *target)
        int i, j;
 
        if (target->state != TARGET_HALTED) {
-               LOG_WARNING("target not halted");
+               LOG_TARGET_ERROR(target, "not halted");
                return ERROR_TARGET_NOT_HALTED;
        }
 
@@ -1781,7 +1781,7 @@ static int xscale_read_memory(struct target *target, target_addr_t address,
                count);
 
        if (target->state != TARGET_HALTED) {
-               LOG_WARNING("target not halted");
+               LOG_TARGET_ERROR(target, "not halted");
                return ERROR_TARGET_NOT_HALTED;
        }
 
@@ -1880,7 +1880,7 @@ static int xscale_write_memory(struct target *target, target_addr_t address,
                count);
 
        if (target->state != TARGET_HALTED) {
-               LOG_WARNING("target not halted");
+               LOG_TARGET_ERROR(target, "not halted");
                return ERROR_TARGET_NOT_HALTED;
        }
 
@@ -2073,7 +2073,7 @@ static int xscale_set_breakpoint(struct target *target,
        struct xscale_common *xscale = target_to_xscale(target);
 
        if (target->state != TARGET_HALTED) {
-               LOG_WARNING("target not halted");
+               LOG_TARGET_ERROR(target, "not halted");
                return ERROR_TARGET_NOT_HALTED;
        }
 
@@ -2163,7 +2163,7 @@ static int xscale_unset_breakpoint(struct target *target,
        struct xscale_common *xscale = target_to_xscale(target);
 
        if (target->state != TARGET_HALTED) {
-               LOG_WARNING("target not halted");
+               LOG_TARGET_ERROR(target, "not halted");
                return ERROR_TARGET_NOT_HALTED;
        }
 
@@ -2210,7 +2210,7 @@ static int xscale_remove_breakpoint(struct target *target, struct breakpoint *br
        struct xscale_common *xscale = target_to_xscale(target);
 
        if (target->state != TARGET_HALTED) {
-               LOG_ERROR("target not halted");
+               LOG_TARGET_ERROR(target, "not halted");
                return ERROR_TARGET_NOT_HALTED;
        }
 
@@ -2232,7 +2232,7 @@ static int xscale_set_watchpoint(struct target *target,
        uint32_t dbcon_value = buf_get_u32(dbcon->value, 0, 32);
 
        if (target->state != TARGET_HALTED) {
-               LOG_ERROR("target not halted");
+               LOG_TARGET_ERROR(target, "not halted");
                return ERROR_TARGET_NOT_HALTED;
        }
 
@@ -2296,7 +2296,7 @@ static int xscale_add_watchpoint(struct target *target,
                return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
        }
 
-       if (watchpoint->value)
+       if (watchpoint->mask != WATCHPOINT_IGNORE_DATA_VALUE_MASK)
                LOG_WARNING("xscale does not support value, mask arguments; ignoring");
 
        /* check that length is a power of two */
@@ -2336,7 +2336,7 @@ static int xscale_unset_watchpoint(struct target *target,
        uint32_t dbcon_value = buf_get_u32(dbcon->value, 0, 32);
 
        if (target->state != TARGET_HALTED) {
-               LOG_WARNING("target not halted");
+               LOG_TARGET_ERROR(target, "not halted");
                return ERROR_TARGET_NOT_HALTED;
        }
 
@@ -2369,7 +2369,7 @@ static int xscale_remove_watchpoint(struct target *target, struct watchpoint *wa
        struct xscale_common *xscale = target_to_xscale(target);
 
        if (target->state != TARGET_HALTED) {
-               LOG_ERROR("target not halted");
+               LOG_TARGET_ERROR(target, "not halted");
                return ERROR_TARGET_NOT_HALTED;
        }
 
@@ -2490,7 +2490,7 @@ static int xscale_read_trace(struct target *target)
        unsigned int num_checkpoints = 0;
 
        if (target->state != TARGET_HALTED) {
-               LOG_WARNING("target must be stopped to read trace data");
+               LOG_TARGET_ERROR(target, "must be stopped to read trace data");
                return ERROR_TARGET_NOT_HALTED;
        }
 
@@ -3131,8 +3131,8 @@ static int xscale_mmu(struct target *target, int *enabled)
        struct xscale_common *xscale = target_to_xscale(target);
 
        if (target->state != TARGET_HALTED) {
-               LOG_ERROR("Target not halted");
-               return ERROR_TARGET_INVALID;
+               LOG_TARGET_ERROR(target, "not halted");
+               return ERROR_TARGET_NOT_HALTED;
        }
        *enabled = xscale->armv4_5_mmu.mmu_enabled;
        return ERROR_OK;
@@ -3149,8 +3149,8 @@ COMMAND_HANDLER(xscale_handle_mmu_command)
                return retval;
 
        if (target->state != TARGET_HALTED) {
-               command_print(CMD, "target must be stopped for \"%s\" command", CMD_NAME);
-               return ERROR_OK;
+               command_print(CMD, "Error: target must be stopped for \"%s\" command", CMD_NAME);
+               return ERROR_TARGET_NOT_HALTED;
        }
 
        if (CMD_ARGC >= 1) {
@@ -3179,8 +3179,8 @@ COMMAND_HANDLER(xscale_handle_idcache_command)
                return retval;
 
        if (target->state != TARGET_HALTED) {
-               command_print(CMD, "target must be stopped for \"%s\" command", CMD_NAME);
-               return ERROR_OK;
+               command_print(CMD, "Error: target must be stopped for \"%s\" command", CMD_NAME);
+               return ERROR_TARGET_NOT_HALTED;
        }
 
        bool icache = false;
@@ -3347,8 +3347,8 @@ COMMAND_HANDLER(xscale_handle_trace_buffer_command)
                return retval;
 
        if (target->state != TARGET_HALTED) {
-               command_print(CMD, "target must be stopped for \"%s\" command", CMD_NAME);
-               return ERROR_OK;
+               command_print(CMD, "Error: target must be stopped for \"%s\" command", CMD_NAME);
+               return ERROR_TARGET_NOT_HALTED;
        }
 
        if (CMD_ARGC >= 1) {
@@ -3451,8 +3451,8 @@ COMMAND_HANDLER(xscale_handle_dump_trace_command)
                return retval;
 
        if (target->state != TARGET_HALTED) {
-               command_print(CMD, "target must be stopped for \"%s\" command", CMD_NAME);
-               return ERROR_OK;
+               command_print(CMD, "Error: target must be stopped for \"%s\" command", CMD_NAME);
+               return ERROR_TARGET_NOT_HALTED;
        }
 
        if (CMD_ARGC < 1)
@@ -3514,8 +3514,8 @@ COMMAND_HANDLER(xscale_handle_cp15)
                return retval;
 
        if (target->state != TARGET_HALTED) {
-               command_print(CMD, "target must be stopped for \"%s\" command", CMD_NAME);
-               return ERROR_OK;
+               command_print(CMD, "Error: target must be stopped for \"%s\" command", CMD_NAME);
+               return ERROR_TARGET_NOT_HALTED;
        }
        uint32_t reg_no = 0;
        struct reg *reg = NULL;

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)