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
This commit is contained in:
zwelch
2009-05-31 09:38:20 +00:00
parent 95e13054ca
commit fbe8cf72a5
14 changed files with 41 additions and 15 deletions

View File

@@ -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);
@@ -379,6 +383,17 @@ extern target_t* get_current_target(struct command_context_s *cmd_ctx);
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.