X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Ftarget%2Fmips32.c;h=6432a9034353f64a9fc25b056019cf267f626c0c;hp=ddc27a66155ae271a5cb32aa22c7f88f8891eb30;hb=04b514707f221ba00ae789e69f6f8047af96125d;hpb=74d09617b927ed7011098d5a65087dee1ef1e87a diff --git a/src/target/mips32.c b/src/target/mips32.c index ddc27a6615..6432a90343 100644 --- a/src/target/mips32.c +++ b/src/target/mips32.c @@ -88,18 +88,24 @@ struct mips32_core_reg mips32_core_reg_list_arch_info[MIPS32NUMCOREREGS] = uint8_t mips32_gdb_dummy_fp_value[] = {0, 0, 0, 0}; -reg_t mips32_gdb_dummy_fp_reg = +struct reg mips32_gdb_dummy_fp_reg = { - "GDB dummy floating-point register", mips32_gdb_dummy_fp_value, 0, 1, 32, NULL, 0, NULL, 0 + .name = "GDB dummy floating-point register", + .value = mips32_gdb_dummy_fp_value, + .dirty = 0, + .valid = 1, + .size = 32, + .arch_info = NULL, + .arch_type = 0, }; int mips32_core_reg_arch_type = -1; -int mips32_get_core_reg(reg_t *reg) +int mips32_get_core_reg(struct reg *reg) { int retval; struct mips32_core_reg *mips32_reg = reg->arch_info; - target_t *target = mips32_reg->target; + struct target *target = mips32_reg->target; struct mips32_common *mips32_target = target->arch_info; if (target->state != TARGET_HALTED) @@ -112,10 +118,10 @@ int mips32_get_core_reg(reg_t *reg) return retval; } -int mips32_set_core_reg(reg_t *reg, uint8_t *buf) +int mips32_set_core_reg(struct reg *reg, uint8_t *buf) { struct mips32_core_reg *mips32_reg = reg->arch_info; - target_t *target = mips32_reg->target; + struct target *target = mips32_reg->target; uint32_t value = buf_get_u32(buf, 0, 32); if (target->state != TARGET_HALTED) @@ -130,7 +136,7 @@ int mips32_set_core_reg(reg_t *reg, uint8_t *buf) return ERROR_OK; } -int mips32_read_core_reg(struct target_s *target, int num) +int mips32_read_core_reg(struct target *target, int num) { uint32_t reg_value; struct mips32_core_reg *mips_core_reg; @@ -150,7 +156,7 @@ int mips32_read_core_reg(struct target_s *target, int num) return ERROR_OK; } -int mips32_write_core_reg(struct target_s *target, int num) +int mips32_write_core_reg(struct target *target, int num) { uint32_t reg_value; struct mips32_core_reg *mips_core_reg; @@ -171,7 +177,7 @@ int mips32_write_core_reg(struct target_s *target, int num) return ERROR_OK; } -int mips32_invalidate_core_regs(target_t *target) +int mips32_invalidate_core_regs(struct target *target) { /* get pointers to arch-specific information */ struct mips32_common *mips32 = target->arch_info; @@ -186,7 +192,7 @@ int mips32_invalidate_core_regs(target_t *target) return ERROR_OK; } -int mips32_get_gdb_reg_list(target_t *target, reg_t **reg_list[], int *reg_list_size) +int mips32_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int *reg_list_size) { /* get pointers to arch-specific information */ struct mips32_common *mips32 = target->arch_info; @@ -194,7 +200,7 @@ int mips32_get_gdb_reg_list(target_t *target, reg_t **reg_list[], int *reg_list_ /* include floating point registers */ *reg_list_size = MIPS32NUMCOREREGS + MIPS32NUMFPREGS; - *reg_list = malloc(sizeof(reg_t*) * (*reg_list_size)); + *reg_list = malloc(sizeof(struct reg*) * (*reg_list_size)); for (i = 0; i < MIPS32NUMCOREREGS; i++) { @@ -210,7 +216,7 @@ int mips32_get_gdb_reg_list(target_t *target, reg_t **reg_list[], int *reg_list_ return ERROR_OK; } -int mips32_save_context(target_t *target) +int mips32_save_context(struct target *target) { int i; @@ -232,7 +238,7 @@ int mips32_save_context(target_t *target) return ERROR_OK; } -int mips32_restore_context(target_t *target) +int mips32_restore_context(struct target *target) { int i; @@ -254,7 +260,7 @@ int mips32_restore_context(target_t *target) return ERROR_OK; } -int mips32_arch_state(struct target_s *target) +int mips32_arch_state(struct target *target) { struct mips32_common *mips32 = target->arch_info; @@ -271,7 +277,7 @@ int mips32_arch_state(struct target_s *target) return ERROR_OK; } -struct reg_cache *mips32_build_reg_cache(target_t *target) +struct reg_cache *mips32_build_reg_cache(struct target *target) { /* get pointers to arch-specific information */ struct mips32_common *mips32 = target->arch_info; @@ -279,7 +285,7 @@ struct reg_cache *mips32_build_reg_cache(target_t *target) int num_regs = MIPS32NUMCOREREGS; struct reg_cache **cache_p = register_get_last_cache_p(&target->reg_cache); struct reg_cache *cache = malloc(sizeof(struct reg_cache)); - reg_t *reg_list = malloc(sizeof(reg_t) * num_regs); + struct reg *reg_list = malloc(sizeof(struct reg) * num_regs); struct mips32_core_reg *arch_info = malloc(sizeof(struct mips32_core_reg) * num_regs); int i; @@ -306,8 +312,6 @@ struct reg_cache *mips32_build_reg_cache(target_t *target) reg_list[i].value = calloc(1, 4); reg_list[i].dirty = 0; reg_list[i].valid = 0; - reg_list[i].bitfield_desc = NULL; - reg_list[i].num_bitfields = 0; reg_list[i].arch_type = mips32_core_reg_arch_type; reg_list[i].arch_info = &arch_info[i]; } @@ -315,7 +319,7 @@ struct reg_cache *mips32_build_reg_cache(target_t *target) return cache; } -int mips32_init_arch_info(target_t *target, struct mips32_common *mips32, struct jtag_tap *tap) +int mips32_init_arch_info(struct target *target, struct mips32_common *mips32, struct jtag_tap *tap) { target->arch_info = mips32; mips32->common_magic = MIPS32_COMMON_MAGIC; @@ -331,18 +335,18 @@ int mips32_init_arch_info(target_t *target, struct mips32_common *mips32, struct return ERROR_OK; } -int mips32_register_commands(struct command_context_s *cmd_ctx) +int mips32_register_commands(struct command_context *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, struct reg_param *reg_params, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info) +int mips32_run_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, int timeout_ms, void *arch_info) { /*TODO*/ return ERROR_OK; } -int mips32_examine(struct target_s *target) +int mips32_examine(struct target *target) { struct mips32_common *mips32 = target->arch_info; @@ -361,7 +365,7 @@ int mips32_examine(struct target_s *target) return ERROR_OK; } -int mips32_configure_break_unit(struct target_s *target) +int mips32_configure_break_unit(struct target *target) { /* get pointers to arch-specific information */ struct mips32_common *mips32 = target->arch_info; @@ -421,7 +425,7 @@ int mips32_configure_break_unit(struct target_s *target) return ERROR_OK; } -int mips32_enable_interrupts(struct target_s *target, int enable) +int mips32_enable_interrupts(struct target *target, int enable) { int retval; int update = 0;