target/xtensa: avoid IHI for writes to non-executable memory
[openocd.git] / src / target / esirisc.c
index c9ac1d606c3873aebf4687f699c51fd678fd49da..0f76b5982ecd8b693102163a537eaeedd0193157 100644 (file)
@@ -1486,6 +1486,32 @@ static struct reg_cache *esirisc_build_reg_cache(struct target *target)
        return cache;
 }
 
+static void esirisc_free_reg_cache(struct target *target)
+{
+       struct esirisc_common *esirisc = target_to_esirisc(target);
+       struct reg_cache *cache = esirisc->reg_cache;
+       struct reg *reg_list = cache->reg_list;
+
+       for (int i = 0; i < esirisc->num_regs; ++i) {
+               struct reg *reg = reg_list + esirisc_regs[i].number;
+
+               free(reg->arch_info);
+               free(reg->value);
+               free(reg->reg_data_type);
+       }
+
+       for (size_t i = 0; i < ARRAY_SIZE(esirisc_csrs); ++i) {
+               struct reg *reg = reg_list + esirisc_csrs[i].number;
+
+               free(reg->arch_info);
+               free(reg->value);
+               free(reg->reg_data_type);
+       }
+
+       free(reg_list);
+       free(cache);
+}
+
 static int esirisc_identify(struct target *target)
 {
        struct esirisc_common *esirisc = target_to_esirisc(target);
@@ -1584,6 +1610,19 @@ static int esirisc_init_target(struct command_context *cmd_ctx, struct target *t
        return ERROR_OK;
 }
 
+static void esirisc_deinit_target(struct target *target)
+{
+       struct esirisc_common *esirisc = target_to_esirisc(target);
+
+       if (!target_was_examined(target))
+               return;
+
+       esirisc_free_reg_cache(target);
+
+       free(esirisc->gdb_arch);
+       free(esirisc);
+}
+
 static int esirisc_examine(struct target *target)
 {
        struct esirisc_common *esirisc = target_to_esirisc(target);
@@ -1822,5 +1861,6 @@ struct target_type esirisc_target = {
 
        .target_create = esirisc_target_create,
        .init_target = esirisc_init_target,
+       .deinit_target = esirisc_deinit_target,
        .examine = esirisc_examine,
 };

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)