diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2009-11-17 01:09:50 -0800 |
---|---|---|
committer | David Brownell <dbrownell@users.sourceforge.net> | 2009-11-17 01:09:50 -0800 |
commit | 0181296f61f11e4390e5a381906021db4ddd4bcd (patch) | |
tree | 603fd56c8c2925ed3869a79309721c177f6eef8c /src/target/arm9tdmi.c | |
parent | 812ab89f58f43979a402ecf4bef7f09f84695cc6 (diff) | |
download | riscv-openocd-0181296f61f11e4390e5a381906021db4ddd4bcd.zip riscv-openocd-0181296f61f11e4390e5a381906021db4ddd4bcd.tar.gz riscv-openocd-0181296f61f11e4390e5a381906021db4ddd4bcd.tar.bz2 |
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 <dbrownell@users.sourceforge.net>
Diffstat (limited to 'src/target/arm9tdmi.c')
-rw-r--r-- | src/target/arm9tdmi.c | 31 |
1 files changed, 20 insertions, 11 deletions
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; } |