hla_target: Update target state when polling
[openocd.git] / src / target / target.c
index 9cc94f3a09782f73750f5148c1f827b10b1b7ac3..942dbc1c38c1020fcbeee10fa4e1a5c75466fd0d 100644 (file)
@@ -87,7 +87,7 @@ extern struct target_type fa526_target;
 extern struct target_type feroceon_target;
 extern struct target_type dragonite_target;
 extern struct target_type xscale_target;
-extern struct target_type cortexm3_target;
+extern struct target_type cortexm_target;
 extern struct target_type cortexa8_target;
 extern struct target_type cortexr4_target;
 extern struct target_type arm11_target;
@@ -101,6 +101,7 @@ extern struct target_type hla_target;
 extern struct target_type nds32_v2_target;
 extern struct target_type nds32_v3_target;
 extern struct target_type nds32_v3m_target;
+extern struct target_type or1k_target;
 
 static struct target_type *target_types[] = {
        &arm7tdmi_target,
@@ -114,7 +115,7 @@ static struct target_type *target_types[] = {
        &feroceon_target,
        &dragonite_target,
        &xscale_target,
-       &cortexm3_target,
+       &cortexm_target,
        &cortexa8_target,
        &cortexr4_target,
        &arm11_target,
@@ -128,6 +129,7 @@ static struct target_type *target_types[] = {
        &nds32_v2_target,
        &nds32_v3_target,
        &nds32_v3m_target,
+       &or1k_target,
        NULL,
 };
 
@@ -2031,12 +2033,13 @@ int target_read_u16(struct target *target, uint32_t address, uint16_t *value)
 
 int target_read_u8(struct target *target, uint32_t address, uint8_t *value)
 {
-       int retval = target_read_memory(target, address, 1, 1, value);
        if (!target_was_examined(target)) {
                LOG_ERROR("Target not examined yet");
                return ERROR_FAIL;
        }
 
+       int retval = target_read_memory(target, address, 1, 1, value);
+
        if (retval == ERROR_OK) {
                LOG_DEBUG("address: 0x%8.8" PRIx32 ", value: 0x%2.2x",
                                  address,
@@ -2744,12 +2747,6 @@ COMMAND_HANDLER(handle_md_command)
 typedef int (*target_write_fn)(struct target *target,
                uint32_t address, uint32_t size, uint32_t count, const uint8_t *buffer);
 
-static int target_write_memory_fast(struct target *target,
-               uint32_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
-{
-       return target_write_buffer(target, address, size * count, buffer);
-}
-
 static int target_fill_mem(struct target *target,
                uint32_t address,
                target_write_fn fn,
@@ -2814,7 +2811,7 @@ COMMAND_HANDLER(handle_mw_command)
                CMD_ARGV++;
                fn = target_write_phys_memory;
        } else
-               fn = target_write_memory_fast;
+               fn = target_write_memory;
        if ((CMD_ARGC < 2) || (CMD_ARGC > 3))
                return ERROR_COMMAND_SYNTAX_ERROR;
 
@@ -4375,7 +4372,7 @@ static int jim_target_mw(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
        }
 
        target_write_fn fn;
-       fn = target_write_memory_fast;
+       fn = target_write_memory;
 
        int e;
        if (strcmp(Jim_GetString(argv[1], NULL), "phys") == 0) {

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)