From: David B. <dbr...@us...> - 2009-11-17 10:10:26
|
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 0181296f61f11e4390e5a381906021db4ddd4bcd (commit) via 812ab89f58f43979a402ecf4bef7f09f84695cc6 (commit) via a2df544fd9cb758163b049f389c5cc07e97e029f (commit) from e722396890bdb07553959258c585853edfbb291c (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 0181296f61f11e4390e5a381906021db4ddd4bcd Author: David Brownell <dbr...@us...> Date: Tue Nov 17 01:09:50 2009 -0800 ARM9TDMI: remove now-needless "struct arm9tdmi" And move the rest of the vector_catch stuff into the C file; it's not part of the module interface. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm920t.c b/src/target/arm920t.c index fca3743..62dd3a1 100644 --- a/src/target/arm920t.c +++ b/src/target/arm920t.c @@ -62,7 +62,7 @@ static int arm920t_read_cp15_physical(struct target *target, uint8_t reg_addr_buf = reg_addr & 0x3f; uint8_t nr_w_buf = 0; - jtag_info = &arm920t->arm9tdmi_common.arm7_9_common.jtag_info; + jtag_info = &arm920t->arm7_9_common.jtag_info; jtag_set_end_state(TAP_IDLE); arm_jtag_scann(jtag_info, 0xf); @@ -115,7 +115,7 @@ static int arm920t_write_cp15_physical(struct target *target, uint8_t nr_w_buf = 1; uint8_t value_buf[4]; - jtag_info = &arm920t->arm9tdmi_common.arm7_9_common.jtag_info; + jtag_info = &arm920t->arm7_9_common.jtag_info; buf_set_u32(value_buf, 0, 32, value); @@ -164,7 +164,7 @@ static int arm920t_execute_cp15(struct target *target, uint32_t cp15_opcode, uint8_t nr_w_buf = 0; uint8_t cp15_opcode_buf[4]; - jtag_info = &arm920t->arm9tdmi_common.arm7_9_common.jtag_info; + jtag_info = &arm920t->arm7_9_common.jtag_info; jtag_set_end_state(TAP_IDLE); arm_jtag_scann(jtag_info, 0xf); @@ -444,7 +444,7 @@ int arm920t_arch_state(struct target *target) return ERROR_TARGET_INVALID; } - armv4_5 = &arm920t->arm9tdmi_common.arm7_9_common.armv4_5_common; + armv4_5 = &arm920t->arm7_9_common.armv4_5_common; LOG_USER("target halted in %s state due to %s, current mode: %s\n" "cpsr: 0x%8.8" PRIx32 " pc: 0x%8.8" PRIx32 "\n" @@ -623,12 +623,10 @@ int arm920t_soft_reset_halt(struct target *target) int arm920t_init_arch_info(struct target *target, struct arm920t_common *arm920t, struct jtag_tap *tap) { - struct arm9tdmi_common *arm9tdmi = &arm920t->arm9tdmi_common; - struct arm7_9_common *arm7_9 = &arm9tdmi->arm7_9_common; + struct arm7_9_common *arm7_9 = &arm920t->arm7_9_common; - /* initialize arm9tdmi specific info (including arm7_9 and armv4_5) - */ - arm9tdmi_init_arch_info(target, arm9tdmi, tap); + /* initialize arm7/arm9 specific info (including armv4_5) */ + arm9tdmi_init_arch_info(target, arm7_9, tap); arm920t->common_magic = ARM920T_COMMON_MAGIC; diff --git a/src/target/arm920t.h b/src/target/arm920t.h index 567c8de..ca6be7e 100644 --- a/src/target/arm920t.h +++ b/src/target/arm920t.h @@ -27,7 +27,7 @@ struct arm920t_common { - struct arm9tdmi_common arm9tdmi_common; + struct arm7_9_common arm7_9_common; uint32_t common_magic; struct armv4_5_mmu_common armv4_5_mmu; uint32_t cp15_control_reg; @@ -42,7 +42,7 @@ static inline struct arm920t_common * target_to_arm920(struct target *target) { return container_of(target->arch_info, struct arm920t_common, - arm9tdmi_common.arm7_9_common.armv4_5_common); + arm7_9_common.armv4_5_common); } struct arm920t_cache_line diff --git a/src/target/arm926ejs.c b/src/target/arm926ejs.c index f305390..e38e7df 100644 --- a/src/target/arm926ejs.c +++ b/src/target/arm926ejs.c @@ -502,7 +502,7 @@ int arm926ejs_arch_state(struct target *target) return ERROR_TARGET_INVALID; } - armv4_5 = &arm926ejs->arm9tdmi_common.arm7_9_common.armv4_5_common; + armv4_5 = &arm926ejs->arm7_9_common.armv4_5_common; LOG_USER("target halted in %s state due to %s, current mode: %s\n" "cpsr: 0x%8.8" PRIx32 " pc: 0x%8.8" PRIx32 "\n" @@ -670,12 +670,10 @@ static int arm926ejs_read_phys_memory(struct target *target, int arm926ejs_init_arch_info(struct target *target, struct arm926ejs_common *arm926ejs, struct jtag_tap *tap) { - struct arm9tdmi_common *arm9tdmi = &arm926ejs->arm9tdmi_common; - struct arm7_9_common *arm7_9 = &arm9tdmi->arm7_9_common; + struct arm7_9_common *arm7_9 = &arm926ejs->arm7_9_common; - /* initialize arm9tdmi specific info (including arm7_9 and armv4_5) - */ - arm9tdmi_init_arch_info(target, arm9tdmi, tap); + /* initialize arm7/arm9 specific info (including armv4_5) */ + arm9tdmi_init_arch_info(target, arm7_9, tap); arm926ejs->common_magic = ARM926EJS_COMMON_MAGIC; diff --git a/src/target/arm926ejs.h b/src/target/arm926ejs.h index 22081f4..514f054 100644 --- a/src/target/arm926ejs.h +++ b/src/target/arm926ejs.h @@ -27,7 +27,7 @@ struct arm926ejs_common { - struct arm9tdmi_common arm9tdmi_common; + struct arm7_9_common arm7_9_common; uint32_t common_magic; struct armv4_5_mmu_common armv4_5_mmu; int (*read_cp15)(struct target *target, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t *value); @@ -42,7 +42,7 @@ static inline struct arm926ejs_common * target_to_arm926(struct target *target) { return container_of(target->arch_info, struct arm926ejs_common, - arm9tdmi_common.arm7_9_common.armv4_5_common); + arm7_9_common.armv4_5_common); } diff --git a/src/target/arm966e.c b/src/target/arm966e.c index 3b85a5c..fc50acb 100644 --- a/src/target/arm966e.c +++ b/src/target/arm966e.c @@ -34,10 +34,10 @@ int arm966e_init_arch_info(struct target *target, struct arm966e_common *arm966e, struct jtag_tap *tap) { - struct arm9tdmi_common *arm9tdmi = &arm966e->arm9tdmi_common; - struct arm7_9_common *arm7_9 = &arm9tdmi->arm7_9_common; + struct arm7_9_common *arm7_9 = &arm966e->arm7_9_common; - arm9tdmi_init_arch_info(target, arm9tdmi, tap); + /* initialize arm7/arm9 specific info (including armv4_5) */ + arm9tdmi_init_arch_info(target, arm7_9, tap); arm966e->common_magic = ARM966E_COMMON_MAGIC; diff --git a/src/target/arm966e.h b/src/target/arm966e.h index b58f3a2..45aeb4e 100644 --- a/src/target/arm966e.h +++ b/src/target/arm966e.h @@ -29,7 +29,7 @@ struct arm966e_common { - struct arm9tdmi_common arm9tdmi_common; + struct arm7_9_common arm7_9_common; int common_magic; uint32_t cp15_control_reg; }; @@ -38,7 +38,7 @@ static inline struct arm966e_common * target_to_arm966(struct target *target) { return container_of(target->arch_info, struct arm966e_common, - arm9tdmi_common.arm7_9_common.armv4_5_common); + arm7_9_common.armv4_5_common); } int arm966e_init_arch_info(struct target *target, diff --git a/src/target/arm9tdmi.c b/src/target/arm9tdmi.c index 8e8f4d6..3492c2a 100644 --- a/src/target/arm9tdmi.c +++ b/src/target/arm9tdmi.c @@ -46,8 +46,22 @@ #define _DEBUG_INSTRUCTION_EXECUTION_ #endif -static const struct arm9tdmi_vector arm9tdmi_vectors[] = +enum arm9tdmi_vector_bit { + ARM9TDMI_RESET_VECTOR = 0x01, + ARM9TDMI_UNDEF_VECTOR = 0x02, + ARM9TDMI_SWI_VECTOR = 0x04, + ARM9TDMI_PABT_VECTOR = 0x08, + ARM9TDMI_DABT_VECTOR = 0x10, + /* BIT(5) reserved -- must be zero */ + ARM9TDMI_IRQ_VECTOR = 0x40, + ARM9TDMI_FIQ_VECTOR = 0x80, +}; + +static const struct arm9tdmi_vector { + char *name; + uint32_t value; +} arm9tdmi_vectors[] = { {"reset", ARM9TDMI_RESET_VECTOR}, {"undef", ARM9TDMI_UNDEF_VECTOR}, {"swi", ARM9TDMI_SWI_VECTOR}, @@ -750,14 +764,9 @@ int arm9tdmi_init_target(struct command_context *cmd_ctx, return ERROR_OK; } -int arm9tdmi_init_arch_info(struct target *target, struct arm9tdmi_common *arm9tdmi, struct jtag_tap *tap) +int arm9tdmi_init_arch_info(struct target *target, + struct arm7_9_common *arm7_9, struct jtag_tap *tap) { - struct arm *armv4_5; - struct arm7_9_common *arm7_9; - - arm7_9 = &arm9tdmi->arm7_9_common; - armv4_5 = &arm7_9->armv4_5_common; - /* prepare JTAG information for the new target */ arm7_9->jtag_info.tap = tap; arm7_9->jtag_info.scann_size = 5; @@ -812,10 +821,10 @@ int arm9tdmi_init_arch_info(struct target *target, struct arm9tdmi_common *arm9t static int arm9tdmi_target_create(struct target *target, Jim_Interp *interp) { - struct arm9tdmi_common *arm9tdmi = calloc(1,sizeof(struct arm9tdmi_common)); + struct arm7_9_common *arm7_9 = calloc(1,sizeof(struct arm7_9_common)); - arm9tdmi_init_arch_info(target, arm9tdmi, target->tap); - arm9tdmi->arm7_9_common.armv4_5_common.is_armv4 = true; + arm9tdmi_init_arch_info(target, arm7_9, target->tap); + arm7_9->armv4_5_common.is_armv4 = true; return ERROR_OK; } diff --git a/src/target/arm9tdmi.h b/src/target/arm9tdmi.h index 496e4c5..351b00a 100644 --- a/src/target/arm9tdmi.h +++ b/src/target/arm9tdmi.h @@ -25,36 +25,10 @@ #include "embeddedice.h" -/* FIXME we don't really need a separate arm9tdmi struct any more... - * remove it, the arm7/arm9 common struct suffices. - */ -struct arm9tdmi_common -{ - struct arm7_9_common arm7_9_common; -}; - -struct arm9tdmi_vector -{ - char *name; - uint32_t value; -}; - -enum arm9tdmi_vector_bit -{ - ARM9TDMI_RESET_VECTOR = 0x01, - ARM9TDMI_UNDEF_VECTOR = 0x02, - ARM9TDMI_SWI_VECTOR = 0x04, - ARM9TDMI_PABT_VECTOR = 0x08, - ARM9TDMI_DABT_VECTOR = 0x10, - /* BIT(5) reserved -- must be zero */ - ARM9TDMI_IRQ_VECTOR = 0x40, - ARM9TDMI_FIQ_VECTOR = 0x80, -}; - int arm9tdmi_init_target(struct command_context *cmd_ctx, struct target *target); int arm9tdmi_init_arch_info(struct target *target, - struct arm9tdmi_common *arm9tdmi, struct jtag_tap *tap); + struct arm7_9_common *arm7_9, struct jtag_tap *tap); int arm9tdmi_register_commands(struct command_context *cmd_ctx); int arm9tdmi_clock_out(struct arm_jtag *jtag_info, diff --git a/src/target/fa526.c b/src/target/fa526.c index e7c1a2e..9c22a75 100644 --- a/src/target/fa526.c +++ b/src/target/fa526.c @@ -256,12 +256,8 @@ static void fa526_branch_resume_thumb(struct target *target) } static int fa526_init_arch_info_2(struct target *target, - struct arm9tdmi_common *arm9tdmi, struct jtag_tap *tap) + struct arm7_9_common *arm7_9, struct jtag_tap *tap) { - struct arm7_9_common *arm7_9; - - arm7_9 = &arm9tdmi->arm7_9_common; - /* prepare JTAG information for the new target */ arm7_9->jtag_info.tap = tap; arm7_9->jtag_info.scann_size = 5; @@ -317,12 +313,10 @@ static int fa526_init_arch_info_2(struct target *target, static int fa526_init_arch_info(struct target *target, struct arm920t_common *arm920t, struct jtag_tap *tap) { - struct arm9tdmi_common *arm9tdmi = &arm920t->arm9tdmi_common; - struct arm7_9_common *arm7_9 = &arm9tdmi->arm7_9_common; + struct arm7_9_common *arm7_9 = &arm920t->arm7_9_common; - /* initialize arm9tdmi specific info (including arm7_9 and armv4_5) - */ - fa526_init_arch_info_2(target, arm9tdmi, tap); + /* initialize arm7/arm9 specific info (including armv4_5) */ + fa526_init_arch_info_2(target, arm7_9, tap); arm920t->common_magic = ARM920T_COMMON_MAGIC; commit 812ab89f58f43979a402ecf4bef7f09f84695cc6 Author: David Brownell <dbr...@us...> Date: Tue Nov 17 01:09:06 2009 -0800 ARM7TDMI: remove now-needless "struct arm7tdmi" Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm720t.c b/src/target/arm720t.c index 5d83517..3bac0be 100644 --- a/src/target/arm720t.c +++ b/src/target/arm720t.c @@ -49,7 +49,7 @@ static int arm720t_scan_cp15(struct target *target, uint8_t out_buf[4]; uint8_t instruction_buf = instruction; - jtag_info = &arm720t->arm7tdmi_common.arm7_9_common.jtag_info; + jtag_info = &arm720t->arm7_9_common.jtag_info; buf_set_u32(out_buf, 0, 32, flip_u32(out, 32)); @@ -232,7 +232,7 @@ static int arm720t_arch_state(struct target *target) "disabled", "enabled" }; - armv4_5 = &arm720t->arm7tdmi_common.arm7_9_common.armv4_5_common; + armv4_5 = &arm720t->arm7_9_common.armv4_5_common; LOG_USER("target halted in %s state due to %s, current mode: %s\n" "cpsr: 0x%8.8" PRIx32 " pc: 0x%8.8" PRIx32 "\n" @@ -305,10 +305,10 @@ static int arm720t_soft_reset_halt(struct target *target) { int retval = ERROR_OK; struct arm720t_common *arm720t = target_to_arm720(target); - struct reg *dbg_stat = &arm720t->arm7tdmi_common.arm7_9_common + struct reg *dbg_stat = &arm720t->arm7_9_common .eice_cache->reg_list[EICE_DBG_STAT]; - struct armv4_5_common_s *armv4_5 = &arm720t->arm7tdmi_common - .arm7_9_common.armv4_5_common; + struct armv4_5_common_s *armv4_5 = &arm720t->arm7_9_common + .armv4_5_common; if ((retval = target_halt(target)) != ERROR_OK) { @@ -380,10 +380,9 @@ static int arm720t_init_target(struct command_context *cmd_ctx, struct target *t static int arm720t_init_arch_info(struct target *target, struct arm720t_common *arm720t, struct jtag_tap *tap) { - struct arm7tdmi_common *arm7tdmi = &arm720t->arm7tdmi_common; - struct arm7_9_common *arm7_9 = &arm7tdmi->arm7_9_common; + struct arm7_9_common *arm7_9 = &arm720t->arm7_9_common; - arm7tdmi_init_arch_info(target, arm7tdmi, tap); + arm7tdmi_init_arch_info(target, arm7_9, tap); arm720t->common_magic = ARM720T_COMMON_MAGIC; @@ -406,7 +405,7 @@ static int arm720t_target_create(struct target *target, Jim_Interp *interp) { struct arm720t_common *arm720t = calloc(1, sizeof(*arm720t)); - arm720t->arm7tdmi_common.arm7_9_common.armv4_5_common.is_armv4 = true; + arm720t->arm7_9_common.armv4_5_common.is_armv4 = true; return arm720t_init_arch_info(target, arm720t, target->tap); } @@ -421,7 +420,7 @@ COMMAND_HANDLER(arm720t_handle_cp15_command) if (retval != ERROR_OK) return retval; - jtag_info = &arm720t->arm7tdmi_common.arm7_9_common.jtag_info; + jtag_info = &arm720t->arm7_9_common.jtag_info; if (target->state != TARGET_HALTED) { diff --git a/src/target/arm720t.h b/src/target/arm720t.h index 6bbac24..f0ab444 100644 --- a/src/target/arm720t.h +++ b/src/target/arm720t.h @@ -27,7 +27,7 @@ struct arm720t_common { - struct arm7tdmi_common arm7tdmi_common; + struct arm7_9_common arm7_9_common; uint32_t common_magic; struct armv4_5_mmu_common armv4_5_mmu; uint32_t cp15_control_reg; @@ -39,7 +39,7 @@ static inline struct arm720t_common * target_to_arm720(struct target *target) { return container_of(target->arch_info, struct arm720t_common, - arm7tdmi_common.arm7_9_common.armv4_5_common); + arm7_9_common.armv4_5_common); } #endif /* ARM720T_H */ diff --git a/src/target/arm7tdmi.c b/src/target/arm7tdmi.c index ba993ee..3bd5236 100644 --- a/src/target/arm7tdmi.c +++ b/src/target/arm7tdmi.c @@ -654,10 +654,9 @@ int arm7tdmi_init_target(struct command_context *cmd_ctx, struct target *target) return ERROR_OK; } -int arm7tdmi_init_arch_info(struct target *target, struct arm7tdmi_common *arm7tdmi, struct jtag_tap *tap) +int arm7tdmi_init_arch_info(struct target *target, + struct arm7_9_common *arm7_9, struct jtag_tap *tap) { - struct arm7_9_common *arm7_9 = &arm7tdmi->arm7_9_common; - /* prepare JTAG information for the new target */ arm7_9->jtag_info.tap = tap; arm7_9->jtag_info.scann_size = 4; @@ -706,11 +705,11 @@ int arm7tdmi_init_arch_info(struct target *target, struct arm7tdmi_common *arm7t static int arm7tdmi_target_create(struct target *target, Jim_Interp *interp) { - struct arm7tdmi_common *arm7tdmi; + struct arm7_9_common *arm7_9; - arm7tdmi = calloc(1,sizeof(struct arm7tdmi_common)); - arm7tdmi_init_arch_info(target, arm7tdmi, target->tap); - arm7tdmi->arm7_9_common.armv4_5_common.is_armv4 = true; + arm7_9 = calloc(1,sizeof(struct arm7_9_common)); + arm7tdmi_init_arch_info(target, arm7_9, target->tap); + arm7_9->armv4_5_common.is_armv4 = true; return ERROR_OK; } diff --git a/src/target/arm7tdmi.h b/src/target/arm7tdmi.h index 4ed6f3e..b6bbe59 100644 --- a/src/target/arm7tdmi.h +++ b/src/target/arm7tdmi.h @@ -25,15 +25,9 @@ #include "embeddedice.h" -/* FIXME we don't really need a separate arm7tdmi struct any more... - * remove it, the arm7/arm9 common struct suffices. - */ -struct arm7tdmi_common -{ - struct arm7_9_common arm7_9_common; -}; - -int arm7tdmi_init_arch_info(struct target *target, struct arm7tdmi_common *arm7tdmi, struct jtag_tap *tap); -int arm7tdmi_init_target(struct command_context *cmd_ctx, struct target *target); +int arm7tdmi_init_arch_info(struct target *target, + struct arm7_9_common *arm7_9, struct jtag_tap *tap); +int arm7tdmi_init_target(struct command_context *cmd_ctx, + struct target *target); #endif /* ARM7TDMI_H */ commit a2df544fd9cb758163b049f389c5cc07e97e029f Author: David Brownell <dbr...@us...> Date: Tue Nov 17 01:06:16 2009 -0800 target: remove some more duplicate includes Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm11.c b/src/target/arm11.c index f0ed85f..31135e4 100644 --- a/src/target/arm11.c +++ b/src/target/arm11.c @@ -27,7 +27,6 @@ #endif #include "etm.h" -#include "arm11.h" #include "breakpoints.h" #include "arm11_dbgtap.h" #include "arm_simulator.h" diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index 27a9b8d..923c8cd 100644 --- a/src/target/arm7_9_common.c +++ b/src/target/arm7_9_common.c @@ -33,7 +33,6 @@ #include "breakpoints.h" #include "embeddedice.h" #include "target_request.h" -#include "arm7_9_common.h" #include "etm.h" #include "time_support.h" #include "arm_simulator.h" diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index f4b5550..4cd6c0a 100644 --- a/src/target/cortex_a8.c +++ b/src/target/cortex_a8.c @@ -35,7 +35,6 @@ #include "breakpoints.h" #include "cortex_a8.h" -#include "armv4_5.h" #include "register.h" #include "target_request.h" #include "target_type.h" diff --git a/src/target/xscale.c b/src/target/xscale.c index e97e082..742dd25 100644 --- a/src/target/xscale.c +++ b/src/target/xscale.c @@ -30,7 +30,7 @@ #include "breakpoints.h" #include "xscale.h" #include "target_type.h" -#include "arm7_9_common.h" +#include "arm_jtag.h" #include "arm_simulator.h" #include "arm_disassembler.h" #include "time_support.h" ----------------------------------------------------------------------- Summary of changes: src/target/arm11.c | 1 - src/target/arm720t.c | 19 +++++++++---------- src/target/arm720t.h | 4 ++-- src/target/arm7_9_common.c | 1 - src/target/arm7tdmi.c | 13 ++++++------- src/target/arm7tdmi.h | 14 ++++---------- src/target/arm920t.c | 16 +++++++--------- src/target/arm920t.h | 4 ++-- src/target/arm926ejs.c | 10 ++++------ src/target/arm926ejs.h | 4 ++-- src/target/arm966e.c | 6 +++--- src/target/arm966e.h | 4 ++-- src/target/arm9tdmi.c | 31 ++++++++++++++++++++----------- src/target/arm9tdmi.h | 28 +--------------------------- src/target/cortex_a8.c | 1 - src/target/fa526.c | 14 ++++---------- src/target/xscale.c | 2 +- 17 files changed, 67 insertions(+), 105 deletions(-) hooks/post-receive -- Main OpenOCD repository |