Commit b1de5eb9 authored by Zachary T Welch's avatar Zachary T Welch
Browse files

reg_param_t -> struct reg_param

Remove misleading typedef and redundant suffix from struct reg_param.
parent 6c965a3d
......@@ -163,7 +163,7 @@ static int aduc702x_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint
uint32_t buffer_size = 7000;
working_area_t *source;
uint32_t address = bank->base + offset;
reg_param_t reg_params[6];
struct reg_param reg_params[6];
armv4_5_algorithm_t armv4_5_info;
int retval = ERROR_OK;
......
......@@ -44,7 +44,7 @@ int arm_nandwrite(struct arm_nand_data *nand, uint8_t *data, int size)
target_t *target = nand->target;
armv4_5_algorithm_t algo;
armv4_5_common_t *armv4_5 = target->arch_info;
reg_param_t reg_params[3];
struct reg_param reg_params[3];
uint32_t target_buf;
uint32_t exit = 0;
int retval;
......
......@@ -1020,7 +1020,7 @@ static int cfi_intel_write_block(struct flash_bank_s *bank, uint8_t *buffer, uin
{
struct cfi_flash_bank *cfi_info = bank->driver_priv;
target_t *target = bank->target;
reg_param_t reg_params[7];
struct reg_param reg_params[7];
armv4_5_algorithm_t armv4_5_info;
working_area_t *source;
uint32_t buffer_size = 32768;
......@@ -1265,7 +1265,7 @@ static int cfi_spansion_write_block(struct flash_bank_s *bank, uint8_t *buffer,
struct cfi_flash_bank *cfi_info = bank->driver_priv;
struct cfi_spansion_pri_ext *pri_ext = cfi_info->pri_ext;
target_t *target = bank->target;
reg_param_t reg_params[10];
struct reg_param reg_params[10];
armv4_5_algorithm_t armv4_5_info;
working_area_t *source;
uint32_t buffer_size = 32768;
......
......@@ -206,7 +206,7 @@ static int runCode(struct ecosflash_flash_bank *info,
{
target_t *target = info->target;
reg_param_t reg_params[3];
struct reg_param reg_params[3];
armv4_5_algorithm_t armv4_5_info;
armv4_5_info.common_magic = ARMV4_5_COMMON_MAGIC;
armv4_5_info.core_mode = ARMV4_5_MODE_SVC;
......
......@@ -240,7 +240,7 @@ static int lpc2000_iap_call(flash_bank_t *bank, int code, uint32_t param_table[5
struct lpc2000_flash_bank *lpc2000_info = bank->driver_priv;
target_t *target = bank->target;
struct mem_param mem_params[2];
reg_param_t reg_params[5];
struct reg_param reg_params[5];
armv4_5_algorithm_t armv4_5_info; /* for LPC2000 */
armv7m_algorithm_t armv7m_info; /* for LPC1700 */
uint32_t status_code;
......
......@@ -1313,7 +1313,7 @@ static int lpc2900_write(struct flash_bank_s *bank, uint8_t *buffer,
if( warea )
{
reg_param_t reg_params[5];
struct reg_param reg_params[5];
armv4_5_algorithm_t armv4_5_info;
/* We can use target mode. Download the algorithm. */
......
......@@ -835,7 +835,7 @@ static int stellaris_write_block(struct flash_bank_s *bank, uint8_t *buffer, uin
working_area_t *source;
working_area_t *write_algorithm;
uint32_t address = bank->base + offset;
reg_param_t reg_params[3];
struct reg_param reg_params[3];
armv7m_algorithm_t armv7m_info;
int retval = ERROR_OK;
......
......@@ -437,7 +437,7 @@ static int stm32x_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint32
uint32_t buffer_size = 16384;
working_area_t *source;
uint32_t address = bank->base + offset;
reg_param_t reg_params[4];
struct reg_param reg_params[4];
armv7m_algorithm_t armv7m_info;
int retval = ERROR_OK;
......
......@@ -315,7 +315,7 @@ static int str7x_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint32_
uint32_t buffer_size = 8192;
working_area_t *source;
uint32_t address = bank->base + offset;
reg_param_t reg_params[6];
struct reg_param reg_params[6];
armv4_5_algorithm_t armv4_5_info;
int retval = ERROR_OK;
......
......@@ -353,7 +353,7 @@ static int str9x_write_block(struct flash_bank_s *bank,
uint32_t buffer_size = 8192;
working_area_t *source;
uint32_t address = bank->base + offset;
reg_param_t reg_params[4];
struct reg_param reg_params[4];
armv4_5_algorithm_t armv4_5_info;
int retval = ERROR_OK;
......
......@@ -39,7 +39,7 @@ void destroy_mem_param(struct mem_param *param)
param->value = NULL;
}
void init_reg_param(reg_param_t *param, char *reg_name, uint32_t size, enum param_direction direction)
void init_reg_param(struct reg_param *param, char *reg_name, uint32_t size, enum param_direction direction)
{
param->reg_name = reg_name;
param->size = size;
......@@ -47,7 +47,7 @@ void init_reg_param(reg_param_t *param, char *reg_name, uint32_t size, enum para
param->direction = direction;
}
void destroy_reg_param(reg_param_t *param)
void destroy_reg_param(struct reg_param *param)
{
free(param->value);
param->value = NULL;
......
......@@ -37,20 +37,20 @@ struct mem_param
enum param_direction direction;
};
typedef struct reg_param_s
struct reg_param
{
char *reg_name;
uint32_t size;
uint8_t *value;
enum param_direction direction;
} reg_param_t;
};
void init_mem_param(struct mem_param *param,
uint32_t address, uint32_t size, enum param_direction dir);
void destroy_mem_param(struct mem_param *param);
void init_reg_param(reg_param_t *param,
void init_reg_param(struct reg_param *param,
char *reg_name, uint32_t size, enum param_direction dir);
void destroy_reg_param(reg_param_t *param);
void destroy_reg_param(struct reg_param *param);
#endif /* ALGORITHM_H */
......@@ -1615,7 +1615,7 @@ static int arm11_remove_watchpoint(struct target_s *target,
/* target algorithm support */
static int arm11_run_algorithm(struct target_s *target,
int num_mem_params, struct mem_param *mem_params,
int num_reg_params, reg_param_t *reg_params,
int num_reg_params, struct reg_param *reg_params,
uint32_t entry_point, uint32_t exit_point,
int timeout_ms, void *arch_info)
{
......
......@@ -2654,7 +2654,7 @@ static const uint32_t dcc_code[] =
0xeafffff9 /* b w */
};
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 armv4_5_run_algorithm_inner(struct target_s *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, 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)
{
......@@ -2691,7 +2691,7 @@ int arm7_9_bulk_write_memory(target_t *target, uint32_t address, uint32_t count,
}
armv4_5_algorithm_t armv4_5_info;
reg_param_t reg_params[1];
struct reg_param reg_params[1];
armv4_5_info.common_magic = ARMV4_5_COMMON_MAGIC;
armv4_5_info.core_mode = ARMV4_5_MODE_SVC;
......@@ -2725,7 +2725,7 @@ int arm7_9_checksum_memory(struct target_s *target, uint32_t address, uint32_t c
{
working_area_t *crc_algorithm;
armv4_5_algorithm_t armv4_5_info;
reg_param_t reg_params[2];
struct reg_param reg_params[2];
int retval;
static const uint32_t arm7_9_crc_code[] = {
......@@ -2808,7 +2808,7 @@ int arm7_9_checksum_memory(struct target_s *target, uint32_t address, uint32_t c
int arm7_9_blank_check_memory(struct target_s *target, uint32_t address, uint32_t count, uint32_t* blank)
{
working_area_t *erase_check_algorithm;
reg_param_t reg_params[3];
struct reg_param reg_params[3];
armv4_5_algorithm_t armv4_5_info;
int retval;
uint32_t i;
......
......@@ -141,7 +141,7 @@ int arm7_9_bulk_write_memory(target_t *target, uint32_t address, uint32_t count,
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, struct mem_param *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, struct reg_param *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);
......
......@@ -543,7 +543,7 @@ static int armv4_5_run_algorithm_completion(struct target_s *target, uint32_t ex
return ERROR_OK;
}
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 armv4_5_run_algorithm_inner(struct target_s *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, 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;
......@@ -708,7 +708,7 @@ int armv4_5_run_algorithm_inner(struct target_s *target, int num_mem_params, str
return retval;
}
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)
int armv4_5_run_algorithm(struct target_s *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, 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);
}
......
......@@ -184,7 +184,7 @@ 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, struct mem_param *mem_params,
int num_reg_params, reg_param_t *reg_params,
int num_reg_params, struct reg_param *reg_params,
uint32_t entry_point, uint32_t exit_point,
int timeout_ms, void *arch_info);
......
......@@ -358,7 +358,7 @@ static int armv7m_run_and_wait(struct target_s *target, uint32_t entry_point, in
/** Runs a Thumb algorithm in the target. */
int armv7m_run_algorithm(struct target_s *target,
int num_mem_params, struct mem_param *mem_params,
int num_reg_params, reg_param_t *reg_params,
int num_reg_params, struct reg_param *reg_params,
uint32_t entry_point, uint32_t exit_point,
int timeout_ms, void *arch_info)
{
......@@ -590,7 +590,7 @@ int armv7m_checksum_memory(struct target_s *target,
{
working_area_t *crc_algorithm;
armv7m_algorithm_t armv7m_info;
reg_param_t reg_params[2];
struct reg_param reg_params[2];
int retval;
static const uint16_t cortex_m3_crc_code[] = {
......@@ -672,7 +672,7 @@ int armv7m_blank_check_memory(struct target_s *target,
uint32_t address, uint32_t count, uint32_t* blank)
{
working_area_t *erase_check_algorithm;
reg_param_t reg_params[3];
struct reg_param reg_params[3];
armv7m_algorithm_t armv7m_info;
int retval;
uint32_t i;
......
......@@ -147,7 +147,7 @@ int armv7m_init_arch_info(target_t *target, armv7m_common_t *armv7m);
int armv7m_run_algorithm(struct target_s *target,
int num_mem_params, struct mem_param *mem_params,
int num_reg_params, reg_param_t *reg_params,
int num_reg_params, struct reg_param *reg_params,
uint32_t entry_point, uint32_t exit_point,
int timeout_ms, void *arch_info);
......
......@@ -336,7 +336,7 @@ int mips32_register_commands(struct command_context_s *cmd_ctx)
return ERROR_OK;
}
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)
int mips32_run_algorithm(struct target_s *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, int timeout_ms, void *arch_info)
{
/*TODO*/
return ERROR_OK;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment