From: David B. <dbr...@us...> - 2009-12-08 22:11:41
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via f0da635e554704f96b676406f433739a196afacd (commit) via cbea1ed71febd8cf64482b36381765eaabfc66ec (commit) via e7acbdf5dbfcea427fc8b0fc7e8dd2e1005a4cc8 (commit) from ac19fc0da7e9b5542d5bcb9d6a6370efdeb2f1ee (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f0da635e554704f96b676406f433739a196afacd Author: David Brownell <dbr...@us...> Date: Tue Dec 8 13:09:38 2009 -0800 target: remove more exit() calls These were all basically "can't happen" cases ... like having state be corrupted by an alpha particle after the previous check for whether a value was in-range. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index 5563a4e..280704e 100644 --- a/src/target/arm7_9_common.c +++ b/src/target/arm7_9_common.c @@ -2362,10 +2362,6 @@ int arm7_9_read_memory(struct target *target, uint32_t address, uint32_t size, u } } break; - default: - LOG_ERROR("BUG: we shouldn't get here"); - exit(-1); - break; } if (!is_arm_mode(armv4_5->core_mode)) @@ -2546,10 +2542,6 @@ int arm7_9_write_memory(struct target *target, uint32_t address, uint32_t size, num_accesses += thisrun_accesses; } break; - default: - LOG_ERROR("BUG: we shouldn't get here"); - exit(-1); - break; } /* Re-Set DBGACK */ diff --git a/src/target/target.c b/src/target/target.c index a9f4dd8..70130d9 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -2154,8 +2154,9 @@ static void handle_md_output(struct command_context *cmd_ctx, case 2: value_fmt = "%4.2x "; break; case 1: value_fmt = "%2.2x "; break; default: + /* "can't happen", caller checked */ LOG_ERROR("invalid memory read size: %u", size); - exit(-1); + return; } for (unsigned i = 0; i < count; i++) commit cbea1ed71febd8cf64482b36381765eaabfc66ec Author: David Brownell <dbr...@us...> Date: Tue Dec 8 13:06:41 2009 -0800 target: remove needless "extern"s Most of these happened to be in the target.h file. Some of those are associated with symbols that could be removed at some point ... e.g. NVP_ASSERT/true and its sibling NVP_DEASSERT/false. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/cortex_a8.h b/src/target/cortex_a8.h index adffe93..82a34a7 100644 --- a/src/target/cortex_a8.h +++ b/src/target/cortex_a8.h @@ -31,8 +31,6 @@ #include <target/armv7a.h> -extern char* cortex_a8_state_strings[]; - #define CORTEX_A8_COMMON_MAGIC 0x411fc082 /* See Cortex-A8 TRM section 12.5 */ diff --git a/src/target/etm.c b/src/target/etm.c index 3aace81..e0671d5 100644 --- a/src/target/etm.c +++ b/src/target/etm.c @@ -27,6 +27,8 @@ #include "image.h" #include "arm_disassembler.h" #include "register.h" +#include "etm_dummy.h" +#include "oocd_trace.h" /* @@ -613,13 +615,7 @@ static int etm_write_reg(struct reg *reg, uint32_t value) } -/* ETM trace analysis functionality - * - */ -extern struct etm_capture_driver etm_dummy_capture_driver; -#if BUILD_OOCD_TRACE == 1 -extern struct etm_capture_driver oocd_trace_capture_driver; -#endif +/* ETM trace analysis functionality */ static struct etm_capture_driver *etm_capture_drivers[] = { diff --git a/src/target/target.c b/src/target/target.c index f249d38..a9f4dd8 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -90,7 +90,7 @@ struct target *all_targets = NULL; struct target_event_callback *target_event_callbacks = NULL; struct target_timer_callback *target_timer_callbacks = NULL; -const Jim_Nvp nvp_assert[] = { +static const Jim_Nvp nvp_assert[] = { { .name = "assert", NVP_ASSERT }, { .name = "deassert", NVP_DEASSERT }, { .name = "T", NVP_ASSERT }, @@ -100,7 +100,7 @@ const Jim_Nvp nvp_assert[] = { { .name = NULL, .value = -1 } }; -const Jim_Nvp nvp_error_target[] = { +static const Jim_Nvp nvp_error_target[] = { { .value = ERROR_TARGET_INVALID, .name = "err-invalid" }, { .value = ERROR_TARGET_INIT_FAILED, .name = "err-init-failed" }, { .value = ERROR_TARGET_TIMEOUT, .name = "err-timeout" }, @@ -178,7 +178,7 @@ static const Jim_Nvp nvp_target_event[] = { { .name = NULL, .value = -1 } }; -const Jim_Nvp nvp_target_state[] = { +static const Jim_Nvp nvp_target_state[] = { { .name = "unknown", .value = TARGET_UNKNOWN }, { .name = "running", .value = TARGET_RUNNING }, { .name = "halted", .value = TARGET_HALTED }, @@ -198,7 +198,7 @@ static const Jim_Nvp nvp_target_debug_reason [] = { { .name = NULL, .value = -1 }, }; -const Jim_Nvp nvp_target_endian[] = { +static const Jim_Nvp nvp_target_endian[] = { { .name = "big", .value = TARGET_BIG_ENDIAN }, { .name = "little", .value = TARGET_LITTLE_ENDIAN }, { .name = "be", .value = TARGET_BIG_ENDIAN }, @@ -206,7 +206,7 @@ const Jim_Nvp nvp_target_endian[] = { { .name = NULL, .value = -1 }, }; -const Jim_Nvp nvp_reset_modes[] = { +static const Jim_Nvp nvp_reset_modes[] = { { .name = "unknown", .value = RESET_UNKNOWN }, { .name = "run" , .value = RESET_RUN }, { .name = "halt" , .value = RESET_HALT }, diff --git a/src/target/target.h b/src/target/target.h index dd3d4f7..fededb9 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -61,15 +61,11 @@ enum target_state TARGET_DEBUG_RUNNING = 4, }; -extern const Jim_Nvp nvp_target_state[]; - enum nvp_assert { NVP_DEASSERT, NVP_ASSERT, }; -extern const Jim_Nvp nvp_assert[]; - enum target_reset_mode { RESET_UNKNOWN = 0, @@ -78,8 +74,6 @@ enum target_reset_mode RESET_INIT = 3, /* reset and halt target out of reset, then run init script */ }; -extern const Jim_Nvp nvp_reset_mode[]; - enum target_debug_reason { DBG_REASON_DBGRQ = 0, @@ -97,8 +91,6 @@ enum target_endianess TARGET_BIG_ENDIAN = 1, TARGET_LITTLE_ENDIAN = 2 }; -extern const Jim_Nvp nvp_target_endian[]; - struct working_area { uint32_t address; @@ -490,8 +482,6 @@ void target_all_handle_event(enum target_event e); #define ERROR_TARGET_NOT_RUNNING (-310) #define ERROR_TARGET_NOT_EXAMINED (-311) -extern const Jim_Nvp nvp_error_target[]; - const char *target_strerror_safe(int err); #endif /* TARGET_H */ commit e7acbdf5dbfcea427fc8b0fc7e8dd2e1005a4cc8 Author: David Brownell <dbr...@us...> Date: Tue Dec 8 13:06:41 2009 -0800 target: move 'extern' decls to *.h files The exception being declarations for drivers. Those should be split out in some clean way -- like driver add/remove calls made by initialization code -- but that's for another day. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm.h b/src/target/arm.h index 00dbe2d..36763b4 100644 --- a/src/target/arm.h +++ b/src/target/arm.h @@ -191,6 +191,13 @@ int armv4_5_run_algorithm(struct target *target, int num_reg_params, struct reg_param *reg_params, uint32_t entry_point, 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)); int arm_checksum_memory(struct target *target, uint32_t address, uint32_t count, uint32_t *checksum); @@ -200,6 +207,8 @@ int arm_blank_check_memory(struct target *target, void arm_set_cpsr(struct arm *arm, uint32_t cpsr); struct reg *arm_reg_current(struct arm *arm, unsigned regnum); +void arm_endianness(uint8_t *tmp, void *in, int size, int be, int flip); + extern struct reg arm_gdb_dummy_fp_reg; extern struct reg arm_gdb_dummy_fps_reg; diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index 64a99fb..5563a4e 100644 --- a/src/target/arm7_9_common.c +++ b/src/target/arm7_9_common.c @@ -2652,14 +2652,6 @@ static const uint32_t dcc_code[] = 0xeafffff9 /* b w */ }; -extern 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 arm7_9_bulk_write_memory(struct target *target, uint32_t address, uint32_t count, uint8_t *buffer) { int retval; diff --git a/src/target/arm9tdmi.c b/src/target/arm9tdmi.c index 301412c..0e99cd1 100644 --- a/src/target/arm9tdmi.c +++ b/src/target/arm9tdmi.c @@ -269,8 +269,6 @@ int arm9tdmi_clock_data_in(struct arm_jtag *jtag_info, uint32_t *in) return ERROR_OK; } -extern void arm_endianness(uint8_t *tmp, void *in, int size, int be, int flip); - static int arm9endianness(jtag_callback_data_t arg, jtag_callback_data_t size, jtag_callback_data_t be, jtag_callback_data_t captured) diff --git a/src/target/armv7m.h b/src/target/armv7m.h index f662e16..07090b4 100644 --- a/src/target/armv7m.h +++ b/src/target/armv7m.h @@ -34,6 +34,12 @@ #define ARMV7_GDB_HACKS #endif +#ifdef ARMV7_GDB_HACKS +extern uint8_t armv7m_gdb_dummy_cpsr_value[]; +extern struct reg armv7m_gdb_dummy_cpsr_reg; +#endif + + enum armv7m_mode { ARMV7M_MODE_THREAD = 0, diff --git a/src/target/cortex_m3.c b/src/target/cortex_m3.c index bdd3233..6bc427a 100644 --- a/src/target/cortex_m3.c +++ b/src/target/cortex_m3.c @@ -52,11 +52,6 @@ static void cortex_m3_enable_watchpoints(struct target *target); static int cortex_m3_store_core_reg_u32(struct target *target, enum armv7m_regtype type, uint32_t num, uint32_t value); -#ifdef ARMV7_GDB_HACKS -extern uint8_t armv7m_gdb_dummy_cpsr_value[]; -extern struct reg armv7m_gdb_dummy_cpsr_reg; -#endif - static int cortexm3_dap_read_coreregister_u32(struct swjdp_common *swjdp, uint32_t *value, int regnum) { ----------------------------------------------------------------------- Summary of changes: src/target/arm.h | 9 +++++++++ src/target/arm7_9_common.c | 16 ---------------- src/target/arm9tdmi.c | 2 -- src/target/armv7m.h | 6 ++++++ src/target/cortex_a8.h | 2 -- src/target/cortex_m3.c | 5 ----- src/target/etm.c | 10 +++------- src/target/target.c | 13 +++++++------ src/target/target.h | 10 ---------- 9 files changed, 25 insertions(+), 48 deletions(-) hooks/post-receive -- Main OpenOCD repository |