target: add async algorithm entries to the target type

On supported targets, this may be used to start a long running algorithm in
the background so the target may be interacted with during execution and
later wait for its completion.

The most obvious use case is a double buffered flash algorithm that can
upload the next block of data while the algorithm is flashing the current.

Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
This commit is contained in:
Andreas Fritiofson
2011-07-15 22:18:39 +02:00
parent e56e5a3929
commit 3f6ef7a40b
3 changed files with 99 additions and 0 deletions

View File

@@ -431,6 +431,28 @@ int target_run_algorithm(struct target *target,
uint32_t entry_point, uint32_t exit_point,
int timeout_ms, void *arch_info);
/**
* Starts an algorithm in the background on the @a target given.
*
* This routine is a wrapper for target->type->start_algorithm.
*/
int target_start_algorithm(struct target *target,
int num_mem_params, struct mem_param *mem_params,
int num_reg_params, struct reg_param *reg_params,
uint32_t entry_point, uint32_t exit_point,
void *arch_info);
/**
* Wait for an algorithm on the @a target given.
*
* This routine is a wrapper for target->type->wait_algorithm.
*/
int target_wait_algorithm(struct target *target,
int num_mem_params, struct mem_param *mem_params,
int num_reg_params, struct reg_param *reg_params,
uint32_t exit_point, int timeout_ms,
void *arch_info);
/**
* Read @a count items of @a size bytes from the memory of @a target at
* the @a address given.