Remove misleading typedef and redundant suffix from struct mem_param.
int retval;
struct lpc2000_flash_bank *lpc2000_info = bank->driver_priv;
target_t *target = bank->target;
- mem_param_t mem_params[2];
+ struct mem_param mem_params[2];
reg_param_t reg_params[5];
armv4_5_algorithm_t armv4_5_info; /* for LPC2000 */
armv7m_algorithm_t armv7m_info; /* for LPC1700 */
#include "binarybuffer.h"
-void init_mem_param(mem_param_t *param, uint32_t address, uint32_t size, enum param_direction direction)
+void init_mem_param(struct mem_param *param, uint32_t address, uint32_t size, enum param_direction direction)
{
param->address = address;
param->size = size;
param->direction = direction;
}
-void destroy_mem_param(mem_param_t *param)
+void destroy_mem_param(struct mem_param *param)
{
free(param->value);
param->value = NULL;
PARAM_IN_OUT
};
-typedef struct mem_param_s
+struct mem_param
{
uint32_t address;
uint32_t size;
uint8_t *value;
enum param_direction direction;
-} mem_param_t;
+};
typedef struct reg_param_s
{
enum param_direction direction;
} reg_param_t;
-void init_mem_param(mem_param_t *param,
+void init_mem_param(struct mem_param *param,
uint32_t address, uint32_t size, enum param_direction dir);
-void destroy_mem_param(mem_param_t *param);
+void destroy_mem_param(struct mem_param *param);
void init_reg_param(reg_param_t *param,
char *reg_name, uint32_t size, enum param_direction dir);
// HACKHACKHACK - FIXME mode/state
/* target algorithm support */
static int arm11_run_algorithm(struct target_s *target,
- int num_mem_params, mem_param_t *mem_params,
+ int num_mem_params, struct mem_param *mem_params,
int num_reg_params, reg_param_t *reg_params,
uint32_t entry_point, uint32_t exit_point,
int timeout_ms, void *arch_info)
0xeafffff9 /* b w */
};
-int armv4_5_run_algorithm_inner(struct target_s *target, int num_mem_params, mem_param_t *mem_params, int num_reg_params, reg_param_t *reg_params, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info, int (*run_it)(struct target_s *target, uint32_t exit_point, int timeout_ms, void *arch_info));
+int armv4_5_run_algorithm_inner(struct target_s *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, reg_param_t *reg_params, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info, int (*run_it)(struct target_s *target, uint32_t exit_point, int timeout_ms, void *arch_info));
int arm7_9_bulk_write_memory(target_t *target, uint32_t address, uint32_t count, uint8_t *buffer)
{
int arm7_9_checksum_memory(struct target_s *target, uint32_t address, uint32_t count, uint32_t* checksum);
int arm7_9_blank_check_memory(struct target_s *target, uint32_t address, uint32_t count, uint32_t* blank);
-int arm7_9_run_algorithm(struct target_s *target, int num_mem_params, mem_param_t *mem_params, int num_reg_prams, reg_param_t *reg_param, uint32_t entry_point, void *arch_info);
+int arm7_9_run_algorithm(struct target_s *target, int num_mem_params, struct mem_param *mem_params, int num_reg_prams, reg_param_t *reg_param, uint32_t entry_point, void *arch_info);
int arm7_9_add_breakpoint(struct target_s *target, breakpoint_t *breakpoint);
int arm7_9_remove_breakpoint(struct target_s *target, breakpoint_t *breakpoint);
return ERROR_OK;
}
-int armv4_5_run_algorithm_inner(struct target_s *target, int num_mem_params, mem_param_t *mem_params, int num_reg_params, reg_param_t *reg_params, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info, int (*run_it)(struct target_s *target, uint32_t exit_point, int timeout_ms, void *arch_info))
+int armv4_5_run_algorithm_inner(struct target_s *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, reg_param_t *reg_params, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info, int (*run_it)(struct target_s *target, uint32_t exit_point, int timeout_ms, void *arch_info))
{
struct armv4_5_common_s *armv4_5 = target_to_armv4_5(target);
armv4_5_algorithm_t *armv4_5_algorithm_info = arch_info;
return retval;
}
-int armv4_5_run_algorithm(struct target_s *target, int num_mem_params, mem_param_t *mem_params, int num_reg_params, reg_param_t *reg_params, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info)
+int armv4_5_run_algorithm(struct target_s *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, reg_param_t *reg_params, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info)
{
return armv4_5_run_algorithm_inner(target, num_mem_params, mem_params, num_reg_params, reg_params, entry_point, exit_point, timeout_ms, arch_info, armv4_5_run_algorithm_completion);
}
int armv4_5_init_arch_info(target_t *target, armv4_5_common_t *armv4_5);
int armv4_5_run_algorithm(struct target_s *target,
- int num_mem_params, mem_param_t *mem_params,
+ int num_mem_params, struct mem_param *mem_params,
int num_reg_params, reg_param_t *reg_params,
uint32_t entry_point, uint32_t exit_point,
int timeout_ms, void *arch_info);
/** Runs a Thumb algorithm in the target. */
int armv7m_run_algorithm(struct target_s *target,
- int num_mem_params, mem_param_t *mem_params,
+ int num_mem_params, struct mem_param *mem_params,
int num_reg_params, reg_param_t *reg_params,
uint32_t entry_point, uint32_t exit_point,
int timeout_ms, void *arch_info)
int armv7m_init_arch_info(target_t *target, armv7m_common_t *armv7m);
int armv7m_run_algorithm(struct target_s *target,
- int num_mem_params, mem_param_t *mem_params,
+ int num_mem_params, struct mem_param *mem_params,
int num_reg_params, reg_param_t *reg_params,
uint32_t entry_point, uint32_t exit_point,
int timeout_ms, void *arch_info);
return ERROR_OK;
}
-int mips32_run_algorithm(struct target_s *target, int num_mem_params, mem_param_t *mem_params, int num_reg_params, reg_param_t *reg_params, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info)
+int mips32_run_algorithm(struct target_s *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, reg_param_t *reg_params, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info)
{
/*TODO*/
return ERROR_OK;
reg_cache_t *mips32_build_reg_cache(target_t *target);
int mips32_run_algorithm(struct target_s *target,
- int num_mem_params, mem_param_t *mem_params,
+ int num_mem_params, struct mem_param *mem_params,
int num_reg_params, reg_param_t *reg_params,
uint32_t entry_point, uint32_t exit_point,
int timeout_ms, void *arch_info);
return target->type->soft_reset_halt_imp(target);
}
-static int target_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, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info)
+static int target_run_algorithm_imp(struct target_s *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, reg_param_t *reg_param, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info)
{
if (!target_was_examined(target))
{
int target_run_algorithm(struct target_s *target,
- int num_mem_params, mem_param_t *mem_params,
+ int num_mem_params, struct mem_param *mem_params,
int num_reg_params, reg_param_t *reg_param,
uint32_t entry_point, uint32_t exit_point,
int timeout_ms, void *arch_info)
* This routine is a wrapper for target->type->run_algorithm.
*/
int target_run_algorithm(struct target_s *target,
- int num_mem_params, mem_param_t *mem_params,
+ int num_mem_params, struct mem_param *mem_params,
int num_reg_params, reg_param_t *reg_param,
uint32_t entry_point, uint32_t exit_point,
int timeout_ms, void *arch_info);
int (*remove_watchpoint)(struct target_s *target, watchpoint_t *watchpoint);
/* 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, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info);
+ int (*run_algorithm_imp)(struct target_s *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, reg_param_t *reg_param, uint32_t entry_point, uint32_t 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, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info);
+ int (*run_algorithm)(struct target_s *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, reg_param_t *reg_param, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info);
int (*register_commands)(struct command_context_s *cmd_ctx);