summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2009-11-15 10:35:41 -0800
committerDavid Brownell <dbrownell@users.sourceforge.net>2009-11-15 10:35:41 -0800
commit2280ddeea5fd82554696f1caa97f7a485a035da4 (patch)
tree033efaaabce65eb4925690698cd37bc4d35d6a3d
parent269040bbad7f18066f5ec5707447c33de6290ef5 (diff)
downloadopenocd+libswd-2280ddeea5fd82554696f1caa97f7a485a035da4.tar.gz
openocd+libswd-2280ddeea5fd82554696f1caa97f7a485a035da4.tar.bz2
openocd+libswd-2280ddeea5fd82554696f1caa97f7a485a035da4.tar.xz
openocd+libswd-2280ddeea5fd82554696f1caa97f7a485a035da4.zip
ARM11: fixup method table
Three changes: remove ARM11_HANDLER() in favor of normal structure initialization syntax; fix goofy indentation in that structure; and don't needlessly export arm11_register_commands(), it's only called through that method table. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
-rw-r--r--src/target/arm11.c88
-rw-r--r--src/target/arm11.h2
2 files changed, 43 insertions, 47 deletions
diff --git a/src/target/arm11.c b/src/target/arm11.c
index a88d597d..0b2fa2cf 100644
--- a/src/target/arm11.c
+++ b/src/target/arm11.c
@@ -2139,51 +2139,7 @@ static int arm11_mcr(struct target *target, int cpnum,
return arm11_mrc_inner(target, cpnum, op1, op2, CRn, CRm, &value, false);
}
-#define ARM11_HANDLER(x) .x = arm11_##x
-
-struct target_type arm11_target = {
- .name = "arm11",
-
- ARM11_HANDLER(poll),
- ARM11_HANDLER(arch_state),
-
- ARM11_HANDLER(target_request_data),
-
- ARM11_HANDLER(halt),
- ARM11_HANDLER(resume),
- ARM11_HANDLER(step),
-
- ARM11_HANDLER(assert_reset),
- ARM11_HANDLER(deassert_reset),
- ARM11_HANDLER(soft_reset_halt),
-
- ARM11_HANDLER(get_gdb_reg_list),
-
- ARM11_HANDLER(read_memory),
- ARM11_HANDLER(write_memory),
-
- ARM11_HANDLER(bulk_write_memory),
-
- ARM11_HANDLER(checksum_memory),
-
- ARM11_HANDLER(add_breakpoint),
- ARM11_HANDLER(remove_breakpoint),
- ARM11_HANDLER(add_watchpoint),
- ARM11_HANDLER(remove_watchpoint),
-
- ARM11_HANDLER(run_algorithm),
-
- ARM11_HANDLER(register_commands),
- ARM11_HANDLER(target_create),
- ARM11_HANDLER(init_target),
- ARM11_HANDLER(examine),
-
- ARM11_HANDLER(mrc),
- ARM11_HANDLER(mcr),
- };
-
-
-int arm11_register_commands(struct command_context *cmd_ctx)
+static int arm11_register_commands(struct command_context *cmd_ctx)
{
FNC_INFO;
@@ -2222,3 +2178,45 @@ int arm11_register_commands(struct command_context *cmd_ctx)
return etm_register_commands(cmd_ctx);
}
+
+/** Holds methods for ARM11xx targets. */
+struct target_type arm11_target = {
+ .name = "arm11",
+
+ .poll = arm11_poll,
+ .arch_state = arm11_arch_state,
+
+ .target_request_data = arm11_target_request_data,
+
+ .halt = arm11_halt,
+ .resume = arm11_resume,
+ .step = arm11_step,
+
+ .assert_reset = arm11_assert_reset,
+ .deassert_reset = arm11_deassert_reset,
+ .soft_reset_halt = arm11_soft_reset_halt,
+
+ .get_gdb_reg_list = arm11_get_gdb_reg_list,
+
+ .read_memory = arm11_read_memory,
+ .write_memory = arm11_write_memory,
+
+ .bulk_write_memory = arm11_bulk_write_memory,
+
+ .checksum_memory = arm11_checksum_memory,
+
+ .add_breakpoint = arm11_add_breakpoint,
+ .remove_breakpoint = arm11_remove_breakpoint,
+ .add_watchpoint = arm11_add_watchpoint,
+ .remove_watchpoint = arm11_remove_watchpoint,
+
+ .run_algorithm = arm11_run_algorithm,
+
+ .register_commands = arm11_register_commands,
+ .target_create = arm11_target_create,
+ .init_target = arm11_init_target,
+ .examine = arm11_examine,
+
+ .mrc = arm11_mrc,
+ .mcr = arm11_mcr,
+};
diff --git a/src/target/arm11.h b/src/target/arm11.h
index e48758f4..9bc6eb44 100644
--- a/src/target/arm11.h
+++ b/src/target/arm11.h
@@ -188,6 +188,4 @@ struct arm11_reg_state
struct target * target;
};
-int arm11_register_commands(struct command_context *cmd_ctx);
-
#endif /* ARM11_H */