X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Ftarget%2Farm966e.c;h=b3d8e158553a1c5b3d69e369798adc05c20dd33c;hp=e61943a3e96d04aa0e60414602a8cae951d42d20;hb=ab3bdfb2cb7b0c16800195951e4ee549cf8e86a5;hpb=cfc4d5c6b7b6f8f82dc5bbf3ee661c179814666e diff --git a/src/target/arm966e.c b/src/target/arm966e.c index e61943a3e9..b3d8e15855 100644 --- a/src/target/arm966e.c +++ b/src/target/arm966e.c @@ -32,10 +32,10 @@ #define _DEBUG_INSTRUCTION_EXECUTION_ #endif -int arm966e_init_arch_info(target_t *target, arm966e_common_t *arm966e, jtag_tap_t *tap) +int arm966e_init_arch_info(struct target *target, struct arm966e_common *arm966e, struct jtag_tap *tap) { - arm9tdmi_common_t *arm9tdmi = &arm966e->arm9tdmi_common; - arm7_9_common_t *arm7_9 = &arm9tdmi->arm7_9_common; + struct arm9tdmi_common *arm9tdmi = &arm966e->arm9tdmi_common; + struct arm7_9_common *arm7_9 = &arm9tdmi->arm7_9_common; arm9tdmi_init_arch_info(target, arm9tdmi, tap); @@ -50,15 +50,15 @@ int arm966e_init_arch_info(target_t *target, arm966e_common_t *arm966e, jtag_tap return ERROR_OK; } -static int arm966e_target_create(struct target_s *target, Jim_Interp *interp) +static int arm966e_target_create(struct target *target, Jim_Interp *interp) { - arm966e_common_t *arm966e = calloc(1,sizeof(arm966e_common_t)); + struct arm966e_common *arm966e = calloc(1,sizeof(struct arm966e_common)); return arm966e_init_arch_info(target, arm966e, target->tap); } -static int arm966e_verify_pointer(struct command_context_s *cmd_ctx, - struct arm966e_common_s *arm966e) +static int arm966e_verify_pointer(struct command_context *cmd_ctx, + struct arm966e_common *arm966e) { if (arm966e->common_magic != ARM966E_COMMON_MAGIC) { command_print(cmd_ctx, "target is not an ARM966"); @@ -67,12 +67,12 @@ static int arm966e_verify_pointer(struct command_context_s *cmd_ctx, return ERROR_OK; } -static int arm966e_read_cp15(target_t *target, int reg_addr, uint32_t *value) +static int arm966e_read_cp15(struct target *target, int reg_addr, uint32_t *value) { int retval = ERROR_OK; - struct arm7_9_common_s *arm7_9 = target_to_arm7_9(target); - arm_jtag_t *jtag_info = &arm7_9->jtag_info; - scan_field_t fields[3]; + struct arm7_9_common *arm7_9 = target_to_arm7_9(target); + struct arm_jtag *jtag_info = &arm7_9->jtag_info; + struct scan_field fields[3]; uint8_t reg_addr_buf = reg_addr & 0x3f; uint8_t nr_w_buf = 0; @@ -119,12 +119,12 @@ static int arm966e_read_cp15(target_t *target, int reg_addr, uint32_t *value) } // EXPORTED to str9x (flash) -int arm966e_write_cp15(target_t *target, int reg_addr, uint32_t value) +int arm966e_write_cp15(struct target *target, int reg_addr, uint32_t value) { int retval = ERROR_OK; - struct arm7_9_common_s *arm7_9 = target_to_arm7_9(target); - arm_jtag_t *jtag_info = &arm7_9->jtag_info; - scan_field_t fields[3]; + struct arm7_9_common *arm7_9 = target_to_arm7_9(target); + struct arm_jtag *jtag_info = &arm7_9->jtag_info; + struct scan_field fields[3]; uint8_t reg_addr_buf = reg_addr & 0x3f; uint8_t nr_w_buf = 1; uint8_t value_buf[4]; @@ -165,8 +165,8 @@ int arm966e_write_cp15(target_t *target, int reg_addr, uint32_t value) COMMAND_HANDLER(arm966e_handle_cp15_command) { int retval; - target_t *target = get_current_target(cmd_ctx); - struct arm966e_common_s *arm966e = target_to_arm966(target); + struct target *target = get_current_target(cmd_ctx); + struct arm966e_common *arm966e = target_to_arm966(target); retval = arm966e_verify_pointer(cmd_ctx, arm966e); if (retval != ERROR_OK) @@ -174,7 +174,7 @@ COMMAND_HANDLER(arm966e_handle_cp15_command) if (target->state != TARGET_HALTED) { - command_print(cmd_ctx, "target must be stopped for \"%s\" command", cmd); + command_print(cmd_ctx, "target must be stopped for \"%s\" command", CMD_NAME); return ERROR_OK; } @@ -189,7 +189,9 @@ COMMAND_HANDLER(arm966e_handle_cp15_command) uint32_t value; if ((retval = arm966e_read_cp15(target, address, &value)) != ERROR_OK) { - command_print(cmd_ctx, "couldn't access reg %i", address); + command_print(cmd_ctx, + "couldn't access reg %" PRIi32, + address); return ERROR_OK; } if ((retval = jtag_execute_queue()) != ERROR_OK) @@ -197,7 +199,8 @@ COMMAND_HANDLER(arm966e_handle_cp15_command) return retval; } - command_print(cmd_ctx, "%i: %8.8" PRIx32 "", address, value); + command_print(cmd_ctx, "%" PRIi32 ": %8.8" PRIx32, + address, value); } else if (argc == 2) { @@ -205,10 +208,13 @@ COMMAND_HANDLER(arm966e_handle_cp15_command) COMMAND_PARSE_NUMBER(u32, args[1], value); if ((retval = arm966e_write_cp15(target, address, value)) != ERROR_OK) { - command_print(cmd_ctx, "couldn't access reg %i", address); + command_print(cmd_ctx, + "couldn't access reg %" PRIi32, + address); return ERROR_OK; } - command_print(cmd_ctx, "%i: %8.8" PRIx32 "", address, value); + command_print(cmd_ctx, "%" PRIi32 ": %8.8" PRIx32, + address, value); } } @@ -216,10 +222,10 @@ COMMAND_HANDLER(arm966e_handle_cp15_command) } /** Registers commands used to access coprocessor resources. */ -int arm966e_register_commands(struct command_context_s *cmd_ctx) +int arm966e_register_commands(struct command_context *cmd_ctx) { int retval; - command_t *arm966e_cmd; + struct command *arm966e_cmd; retval = arm9tdmi_register_commands(cmd_ctx); arm966e_cmd = register_command(cmd_ctx, NULL, "arm966e", @@ -233,7 +239,7 @@ int arm966e_register_commands(struct command_context_s *cmd_ctx) } /** Holds methods for ARM966 targets. */ -target_type_t arm966e_target = +struct target_type arm966e_target = { .name = "arm966e", @@ -268,5 +274,5 @@ target_type_t arm966e_target = .register_commands = arm966e_register_commands, .target_create = arm966e_target_create, .init_target = arm9tdmi_init_target, - .examine = arm9tdmi_examine, + .examine = arm7_9_examine, };