[RFC] target: Move bulk_write_memory to arm7_9
[openocd.git] / src / target / target.c
index 442f0d9f1cb5f4c93d37a053cf5b8dcc4f89441d..6aee09832e3983362d278c3caef9394c66cf7fed 100644 (file)
@@ -228,6 +228,7 @@ static const Jim_Nvp nvp_target_debug_reason[] = {
        { .name = "watchpoint-and-breakpoint", .value = DBG_REASON_WPTANDBKPT },
        { .name = "single-step"              , .value = DBG_REASON_SINGLESTEP },
        { .name = "target-not-halted"        , .value = DBG_REASON_NOTHALTED  },
+       { .name = "program-exit"             , .value = DBG_REASON_EXIT },
        { .name = "undefined"                , .value = DBG_REASON_UNDEFINED },
        { .name = NULL, .value = -1 },
 };
@@ -582,8 +583,10 @@ static int target_process_reset(struct command_context *cmd_ctx, enum target_res
        retval = target_call_timer_callbacks_now();
 
        struct target *target;
-       for (target = all_targets; target; target = target->next)
+       for (target = all_targets; target; target = target->next) {
                target->type->check_reset(target);
+               target->running_alg = false;
+       }
 
        return retval;
 }
@@ -983,12 +986,6 @@ int target_write_phys_memory(struct target *target,
        return target->type->write_phys_memory(target, address, size, count, buffer);
 }
 
-static int target_bulk_write_memory_default(struct target *target,
-               uint32_t address, uint32_t count, const uint8_t *buffer)
-{
-       return target_write_memory(target, address, 4, count, buffer);
-}
-
 int target_add_breakpoint(struct target *target,
                struct breakpoint *breakpoint)
 {
@@ -1170,9 +1167,6 @@ static int target_init_one(struct command_context *cmd_ctx,
        if (target->type->write_buffer == NULL)
                target->type->write_buffer = target_write_buffer_default;
 
-       if (target->type->bulk_write_memory == NULL)
-               target->type->bulk_write_memory = target_bulk_write_memory_default;
-
        if (target->type->get_gdb_fileio_info == NULL)
                target->type->get_gdb_fileio_info = target_get_gdb_fileio_info_default;
 
@@ -1731,14 +1725,16 @@ int target_arch_state(struct target *target)
 static int target_get_gdb_fileio_info_default(struct target *target,
                struct gdb_fileio_info *fileio_info)
 {
-       LOG_ERROR("Not implemented: %s", __func__);
+       /* If target does not support semi-hosting function, target
+          has no need to provide .get_gdb_fileio_info callback.
+          It just return ERROR_FAIL and gdb_server will return "Txx"
+          as target halted every time.  */
        return ERROR_FAIL;
 }
 
 static int target_gdb_fileio_end_default(struct target *target,
                int retcode, int fileio_errno, bool ctrl_c)
 {
-       LOG_ERROR("Not implemented: %s", __func__);
        return ERROR_OK;
 }
 
@@ -1797,16 +1793,9 @@ static int target_write_buffer_default(struct target *target, uint32_t address,
        if (size >= 4) {
                int aligned = size - (size % 4);
 
-               /* use bulk writes above a certain limit. This may have to be changed */
-               if (aligned > 128) {
-                       retval = target->type->bulk_write_memory(target, address, aligned / 4, buffer);
-                       if (retval != ERROR_OK)
-                               return retval;
-               } else {
-                       retval = target_write_memory(target, address, 4, aligned / 4, buffer);
-                       if (retval != ERROR_OK)
-                               return retval;
-               }
+               retval = target_write_memory(target, address, 4, aligned / 4, buffer);
+               if (retval != ERROR_OK)
+                       return retval;
 
                buffer += aligned;
                address += aligned;

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)