forked from auracaster/openocd
armv7m: implement async algorithm functions
Split armv7m_run_algorithm into two pieces and use them to reimplement it. The arch_info parameter is used to keep context between the two calls, so both calls must refer to the same armv7m_algorithm struct. Ugly but works for a proof-of-concept. Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
This commit is contained in:
@@ -142,6 +142,8 @@ struct armv7m_algorithm
|
||||
int common_magic;
|
||||
|
||||
enum armv7m_mode core_mode;
|
||||
|
||||
uint32_t context[ARMV7M_CONTROL + 1]; //ARMV7M_NUM_REGS
|
||||
};
|
||||
|
||||
struct armv7m_core_reg
|
||||
@@ -168,6 +170,18 @@ int armv7m_run_algorithm(struct target *target,
|
||||
uint32_t entry_point, uint32_t exit_point,
|
||||
int timeout_ms, void *arch_info);
|
||||
|
||||
int armv7m_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);
|
||||
|
||||
int armv7m_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);
|
||||
|
||||
int armv7m_invalidate_core_regs(struct target *target);
|
||||
|
||||
int armv7m_restore_context(struct target *target);
|
||||
|
||||
Reference in New Issue
Block a user