X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Ftarget%2Fcortex_a.c;h=c9401af7dea6f5587d3d109b14c2f8b374cc0059;hb=0c2f8b6eb8f4b379aa0c78caba73ec1ebaae8414;hp=7547f17f6328b97fe2e357864d5a7c0d89b9502e;hpb=00ded4eb012006da1f56c0ba39af09cc4a66db07;p=fw%2Fopenocd diff --git a/src/target/cortex_a.c b/src/target/cortex_a.c index 7547f17f6..c9401af7d 100755 --- a/src/target/cortex_a.c +++ b/src/target/cortex_a.c @@ -92,7 +92,7 @@ static int cortex_a8_restore_cp15_control_reg(struct target* target) 1, 0, /* CRn, CRm */ cortex_a8->cp15_control_reg); } - return ERROR_OK; + return retval; } /* check address before cortex_a8_apb read write access with mmu on @@ -1021,6 +1021,8 @@ static int cortex_a8_internal_restore(struct target *target, int current, /* called it now before restoring context because it uses cpu * register r0 for restoring cp15 control register */ retval = cortex_a8_restore_cp15_control_reg(target); + if (retval != ERROR_OK) + return retval; retval = cortex_a8_restore_context(target, handle_breakpoints); if (retval != ERROR_OK) return retval; @@ -1147,7 +1149,9 @@ static int cortex_a8_resume(struct target *target, int current, cortex_a8_internal_restore(target, current, &address, handle_breakpoints, debug_execution); if (target->smp) { target->gdb_service->core[0] = -1; - retval += cortex_a8_restore_smp(target, handle_breakpoints); + retval = cortex_a8_restore_smp(target, handle_breakpoints); + if (retval != ERROR_OK) + return retval; } cortex_a8_internal_restart(target); @@ -1902,7 +1906,7 @@ static int cortex_a8_write_apb_ab_memory(struct target *target, /* write memory through APB-AP */ - int retval = ERROR_INVALID_ARGUMENTS; + int retval = ERROR_COMMAND_SYNTAX_ERROR; struct armv7a_common *armv7a = target_to_armv7a(target); struct arm *armv4_5 = &armv7a->armv4_5_common; int total_bytes = count * size; @@ -1975,7 +1979,7 @@ static int cortex_a8_read_apb_ab_memory(struct target *target, /* read memory through APB-AP */ - int retval = ERROR_INVALID_ARGUMENTS; + int retval = ERROR_COMMAND_SYNTAX_ERROR; struct armv7a_common *armv7a = target_to_armv7a(target); struct arm *armv4_5 = &armv7a->armv4_5_common; int total_bytes = count * size; @@ -2043,7 +2047,7 @@ static int cortex_a8_read_phys_memory(struct target *target, { struct armv7a_common *armv7a = target_to_armv7a(target); struct adiv5_dap *swjdp = armv7a->armv4_5_common.dap; - int retval = ERROR_INVALID_ARGUMENTS; + int retval = ERROR_COMMAND_SYNTAX_ERROR; uint8_t apsel = swjdp->apsel; LOG_DEBUG("Reading memory at real address 0x%x; size %d; count %d", address, size, count); @@ -2128,7 +2132,7 @@ static int cortex_a8_write_phys_memory(struct target *target, { struct armv7a_common *armv7a = target_to_armv7a(target); struct adiv5_dap *swjdp = armv7a->armv4_5_common.dap; - int retval = ERROR_INVALID_ARGUMENTS; + int retval = ERROR_COMMAND_SYNTAX_ERROR; uint8_t apsel = swjdp->apsel; LOG_DEBUG("Writing memory to real address 0x%x; size %d; count %d", address, @@ -2633,29 +2637,34 @@ static const struct command_registration cortex_a8_exec_command_handlers[] = { .handler = cortex_a8_handle_cache_info_command, .mode = COMMAND_EXEC, .help = "display information about target caches", + .usage = "", }, { .name = "dbginit", .handler = cortex_a8_handle_dbginit_command, .mode = COMMAND_EXEC, .help = "Initialize core debug", + .usage = "", }, { .name ="smp_off", .handler = cortex_a8_handle_smp_off_command, .mode = COMMAND_EXEC, .help = "Stop smp handling", + .usage = "", }, { .name ="smp_on", .handler = cortex_a8_handle_smp_on_command, .mode = COMMAND_EXEC, .help = "Restart smp handling", + .usage = "", }, { .name ="smp_gdb", .handler = cortex_a8_handle_smp_gdb_command, .mode = COMMAND_EXEC, .help = "display/fix current core played to gdb", + .usage = "", }, @@ -2672,6 +2681,7 @@ static const struct command_registration cortex_a8_command_handlers[] = { .name = "cortex_a8", .mode = COMMAND_ANY, .help = "Cortex-A8 command group", + .usage = "", .chain = cortex_a8_exec_command_handlers, }, COMMAND_REGISTRATION_DONE