summaryrefslogtreecommitdiff
path: root/src/target/target.h
diff options
context:
space:
mode:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-31 09:38:20 +0000
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-31 09:38:20 +0000
commitfbe8cf72a5e6c80fed5fba8754d790ca63ad2b65 (patch)
treeb700b797a4a505e7926703e85724b1477712e5d4 /src/target/target.h
parent95e13054cafeeb13163d85822e4202e12007e1a7 (diff)
downloadopenocd_libswd-fbe8cf72a5e6c80fed5fba8754d790ca63ad2b65.tar.gz
openocd_libswd-fbe8cf72a5e6c80fed5fba8754d790ca63ad2b65.tar.bz2
openocd_libswd-fbe8cf72a5e6c80fed5fba8754d790ca63ad2b65.tar.xz
openocd_libswd-fbe8cf72a5e6c80fed5fba8754d790ca63ad2b65.zip
Add target_run_algorithm wrapper:
- replaces all calls to target->type->run_algorithm. - add documentation in target_s to warn not to invoke callback directly. git-svn-id: svn://svn.berlios.de/openocd/trunk@1961 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target/target.h')
-rw-r--r--src/target/target.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/target/target.h b/src/target/target.h
index 2214c06e..c319a25b 100644
--- a/src/target/target.h
+++ b/src/target/target.h
@@ -204,6 +204,10 @@ typedef struct target_type_s
/* target algorithm support */
int (*run_algorithm_imp)(struct target_s *target, int num_mem_params, mem_param_t *mem_params, int num_reg_params, reg_param_t *reg_param, u32 entry_point, u32 exit_point, int timeout_ms, void *arch_info);
+ /**
+ * Target algorithm support. Do @b not call this method directly,
+ * use target_run_algorithm() instead.
+ */
int (*run_algorithm)(struct target_s *target, int num_mem_params, mem_param_t *mem_params, int num_reg_params, reg_param_t *reg_param, u32 entry_point, u32 exit_point, int timeout_ms, void *arch_info);
int (*register_commands)(struct command_context_s *cmd_ctx);
@@ -380,6 +384,17 @@ extern int get_num_by_target(target_t *query_target);
extern target_t *get_target(const char *id);
/**
+ * Run an algorithm on the @a target given.
+ *
+ * This routine is a wrapper for target->type->run_algorithm.
+ */
+extern int target_run_algorithm(struct target_s *target,
+ int num_mem_params, mem_param_t *mem_params,
+ int num_reg_params, reg_param_t *reg_param,
+ u32 entry_point, u32 exit_point,
+ int timeout_ms, void *arch_info);
+
+/**
* Read @count items of @a size bytes from the memory of @a target at
* the @a address given.
*