]> git.sur5r.net Git - openocd/blobdiff - src/target/armv4_5.c
target: groundwork for "reset-assert" event
[openocd] / src / target / armv4_5.c
index dfb7094b6635e262932669801766939332516a7a..b5e33ff5466fdf2ec010349c24e2db57830c97e0 100644 (file)
@@ -390,6 +390,10 @@ void arm_set_cpsr(struct arm *arm, uint32_t cpsr)
                        state = ARMV4_5_STATE_ARM;
        }
        arm->core_state = state;
+
+       LOG_DEBUG("set CPSR %#8.8x: %s mode, %s state", (unsigned) cpsr,
+                       arm_mode_name(mode),
+                       armv4_5_state_strings[arm->core_state]);
 }
 
 /**
@@ -809,7 +813,7 @@ static const struct command_registration arm_exec_command_handlers[] = {
        },
        COMMAND_REGISTRATION_DONE
 };
-static const struct command_registration arm_command_handlers[] = {
+const struct command_registration arm_command_handlers[] = {
        {
                .name = "arm",
                .mode = COMMAND_ANY,
@@ -819,11 +823,6 @@ static const struct command_registration arm_command_handlers[] = {
        COMMAND_REGISTRATION_DONE
 };
 
-int armv4_5_register_commands(struct command_context *cmd_ctx)
-{
-       return register_commands(cmd_ctx, NULL, arm_command_handlers);
-}
-
 int armv4_5_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int *reg_list_size)
 {
        struct arm *armv4_5 = target_to_armv4_5(target);
@@ -880,7 +879,13 @@ static int armv4_5_run_algorithm_completion(struct target *target, uint32_t exit
        return ERROR_OK;
 }
 
-int armv4_5_run_algorithm_inner(struct target *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info, int (*run_it)(struct target *target, uint32_t exit_point, int timeout_ms, void *arch_info))
+int armv4_5_run_algorithm_inner(struct target *target,
+               int num_mem_params, struct mem_param *mem_params,
+               int num_reg_params, struct reg_param *reg_params,
+               uint32_t entry_point, uint32_t exit_point,
+               int timeout_ms, void *arch_info,
+               int (*run_it)(struct target *target, uint32_t exit_point,
+                               int timeout_ms, void *arch_info))
 {
        struct arm *armv4_5 = target_to_armv4_5(target);
        struct armv4_5_algorithm *armv4_5_algorithm_info = arch_info;
@@ -890,6 +895,7 @@ int armv4_5_run_algorithm_inner(struct target *target, int num_mem_params, struc
        int exit_breakpoint_size = 0;
        int i;
        int retval = ERROR_OK;
+
        LOG_DEBUG("Running algorithm");
 
        if (armv4_5_algorithm_info->common_magic != ARMV4_5_COMMON_MAGIC)