arm_adi_v5: describe Class 0x9 Device Architecture register
[openocd.git] / src / target / arm7_9_common.c
index 36ca5b930143235ead03ed55b0469cc9ecb0bfad..da047c3d026323fd8ad6afd481d918e16420194e 100644 (file)
@@ -93,19 +93,20 @@ static void arm7_9_assign_wp(struct arm7_9_common *arm7_9, struct breakpoint *br
 {
        if (!arm7_9->wp0_used) {
                arm7_9->wp0_used = 1;
-               breakpoint->set = 1;
+               breakpoint_hw_set(breakpoint, 0);
                arm7_9->wp_available--;
        } else if (!arm7_9->wp1_used) {
                arm7_9->wp1_used = 1;
-               breakpoint->set = 2;
+               breakpoint_hw_set(breakpoint, 1);
                arm7_9->wp_available--;
-       } else
+       } else {
                LOG_ERROR("BUG: no hardware comparator available");
+       }
 
-       LOG_DEBUG("BPID: %" PRIu32 " (0x%08" TARGET_PRIxADDR ") using hw wp: %d",
+       LOG_DEBUG("BPID: %" PRIu32 " (0x%08" TARGET_PRIxADDR ") using hw wp: %u",
                        breakpoint->unique_id,
                        breakpoint->address,
-                       breakpoint->set);
+                       breakpoint->number);
 }
 
 /**
@@ -203,16 +204,16 @@ static int arm7_9_set_breakpoint(struct target *target, struct breakpoint *break
                uint32_t mask = (breakpoint->length == 4) ? 0x3u : 0x1u;
 
                /* reassign a hw breakpoint */
-               if (breakpoint->set == 0)
+               if (!breakpoint->is_set)
                        arm7_9_assign_wp(arm7_9, breakpoint);
 
-               if (breakpoint->set == 1) {
+               if (breakpoint->number == 0) {
                        embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_ADDR_VALUE], breakpoint->address);
                        embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_ADDR_MASK], mask);
                        embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_DATA_MASK], 0xffffffffu);
                        embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_CONTROL_MASK], ~EICE_W_CTRL_NOPC & 0xff);
                        embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_CONTROL_VALUE], EICE_W_CTRL_ENABLE);
-               } else if (breakpoint->set == 2) {
+               } else if (breakpoint->number == 1) {
                        embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W1_ADDR_VALUE], breakpoint->address);
                        embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W1_ADDR_MASK], mask);
                        embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W1_DATA_MASK], 0xffffffffu);
@@ -226,7 +227,7 @@ static int arm7_9_set_breakpoint(struct target *target, struct breakpoint *break
                retval = jtag_execute_queue();
        } else if (breakpoint->type == BKPT_SOFT) {
                /* did we already set this breakpoint? */
-               if (breakpoint->set)
+               if (breakpoint->is_set)
                        return ERROR_OK;
 
                if (breakpoint->length == 4) {
@@ -277,7 +278,7 @@ static int arm7_9_set_breakpoint(struct target *target, struct breakpoint *break
 
                arm7_9->sw_breakpoint_count++;
 
-               breakpoint->set = 1;
+               breakpoint->is_set = true;
        }
 
        return retval;
@@ -304,7 +305,7 @@ static int arm7_9_unset_breakpoint(struct target *target, struct breakpoint *bre
                breakpoint->unique_id,
                breakpoint->address);
 
-       if (!breakpoint->set) {
+       if (!breakpoint->is_set) {
                LOG_WARNING("breakpoint not set");
                return ERROR_OK;
        }
@@ -312,18 +313,18 @@ static int arm7_9_unset_breakpoint(struct target *target, struct breakpoint *bre
        if (breakpoint->type == BKPT_HARD) {
                LOG_DEBUG("BPID: %" PRIu32 " Releasing hw wp: %d",
                        breakpoint->unique_id,
-                       breakpoint->set);
-               if (breakpoint->set == 1) {
+                       breakpoint->is_set);
+               if (breakpoint->number == 0) {
                        embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_CONTROL_VALUE], 0x0);
                        arm7_9->wp0_used = 0;
                        arm7_9->wp_available++;
-               } else if (breakpoint->set == 2) {
+               } else if (breakpoint->number == 1) {
                        embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W1_CONTROL_VALUE], 0x0);
                        arm7_9->wp1_used = 0;
                        arm7_9->wp_available++;
                }
                retval = jtag_execute_queue();
-               breakpoint->set = 0;
+               breakpoint->is_set = false;
        } else {
                /* restore original instruction (kept in target endianness) */
                if (breakpoint->length == 4) {
@@ -368,7 +369,7 @@ static int arm7_9_unset_breakpoint(struct target *target, struct breakpoint *bre
                                                EICE_W1_CONTROL_VALUE], 0);
                }
 
-               breakpoint->set = 0;
+               breakpoint->is_set = false;
        }
 
        return retval;
@@ -491,7 +492,7 @@ static int arm7_9_set_watchpoint(struct target *target, struct watchpoint *watch
                retval = jtag_execute_queue();
                if (retval != ERROR_OK)
                        return retval;
-               watchpoint->set = 1;
+               watchpoint_set(watchpoint, 1);
                arm7_9->wp0_used = 2;
        } else if (!arm7_9->wp1_used) {
                embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W1_ADDR_VALUE],
@@ -510,7 +511,7 @@ static int arm7_9_set_watchpoint(struct target *target, struct watchpoint *watch
                retval = jtag_execute_queue();
                if (retval != ERROR_OK)
                        return retval;
-               watchpoint->set = 2;
+               watchpoint_set(watchpoint, 2);
                arm7_9->wp1_used = 2;
        } else {
                LOG_ERROR("BUG: no hardware comparator available");
@@ -538,25 +539,25 @@ static int arm7_9_unset_watchpoint(struct target *target, struct watchpoint *wat
                return ERROR_TARGET_NOT_HALTED;
        }
 
-       if (!watchpoint->set) {
+       if (!watchpoint->is_set) {
                LOG_WARNING("breakpoint not set");
                return ERROR_OK;
        }
 
-       if (watchpoint->set == 1) {
+       if (watchpoint->number == 1) {
                embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_CONTROL_VALUE], 0x0);
                retval = jtag_execute_queue();
                if (retval != ERROR_OK)
                        return retval;
                arm7_9->wp0_used = 0;
-       } else if (watchpoint->set == 2) {
+       } else if (watchpoint->number == 2) {
                embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W1_CONTROL_VALUE], 0x0);
                retval = jtag_execute_queue();
                if (retval != ERROR_OK)
                        return retval;
                arm7_9->wp1_used = 0;
        }
-       watchpoint->set = 0;
+       watchpoint->is_set = false;
 
        return ERROR_OK;
 }
@@ -597,7 +598,7 @@ int arm7_9_remove_watchpoint(struct target *target, struct watchpoint *watchpoin
        int retval = ERROR_OK;
        struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
 
-       if (watchpoint->set) {
+       if (watchpoint->is_set) {
                retval = arm7_9_unset_watchpoint(target, watchpoint);
                if (retval != ERROR_OK)
                        return retval;
@@ -1684,7 +1685,7 @@ static void arm7_9_enable_watchpoints(struct target *target)
        struct watchpoint *watchpoint = target->watchpoints;
 
        while (watchpoint) {
-               if (watchpoint->set == 0)
+               if (!watchpoint->is_set)
                        arm7_9_set_watchpoint(target, watchpoint);
                watchpoint = watchpoint->next;
        }
@@ -1740,7 +1741,7 @@ int arm7_9_resume(struct target *target,
                struct breakpoint *breakpoint;
                breakpoint = breakpoint_find(target,
                                buf_get_u32(arm->pc->value, 0, 32));
-               if (breakpoint != NULL) {
+               if (breakpoint) {
                        LOG_DEBUG("unset breakpoint at 0x%8.8" TARGET_PRIxADDR " (id: %" PRIu32,
                                breakpoint->address,
                                breakpoint->unique_id);
@@ -1932,7 +1933,7 @@ int arm7_9_step(struct target *target, int current, target_addr_t address, int h
        /* the front-end may request us not to handle breakpoints */
        if (handle_breakpoints)
                breakpoint = breakpoint_find(target, current_pc);
-       if (breakpoint != NULL) {
+       if (breakpoint) {
                retval = arm7_9_unset_breakpoint(target, breakpoint);
                if (retval != ERROR_OK)
                        return retval;
@@ -2675,7 +2676,7 @@ int arm7_9_examine(struct target *target)
                struct reg_cache *t, **cache_p;
 
                t = embeddedice_build_reg_cache(target, arm7_9);
-               if (t == NULL)
+               if (!t)
                        return ERROR_FAIL;
 
                cache_p = register_get_last_cache_p(&target->reg_cache);

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)