X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Ftarget%2Ftarget.c;h=442f0d9f1cb5f4c93d37a053cf5b8dcc4f89441d;hp=4c31fbea23fb05463ba802a94fd19f22c31fc1ae;hb=0a4c8990c29e61fd0c2796486519cdb256b8da3b;hpb=80d412bafc03ce9a0418a2b98de2668b0f8de0e6 diff --git a/src/target/target.c b/src/target/target.c index 4c31fbea23..442f0d9f1c 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -68,6 +68,10 @@ static int target_array2mem(Jim_Interp *interp, struct target *target, static int target_mem2array(Jim_Interp *interp, struct target *target, int argc, Jim_Obj * const *argv); static int target_register_user_commands(struct command_context *cmd_ctx); +static int target_get_gdb_fileio_info_default(struct target *target, + struct gdb_fileio_info *fileio_info); +static int target_gdb_fileio_end_default(struct target *target, int retcode, + int fileio_errno, bool ctrl_c); /* targets */ extern struct target_type arm7tdmi_target; @@ -1065,6 +1069,24 @@ int target_step(struct target *target, return target->type->step(target, current, address, handle_breakpoints); } +int target_get_gdb_fileio_info(struct target *target, struct gdb_fileio_info *fileio_info) +{ + if (target->state != TARGET_HALTED) { + LOG_WARNING("target %s is not halted", target->cmd_name); + return ERROR_TARGET_NOT_HALTED; + } + return target->type->get_gdb_fileio_info(target, fileio_info); +} + +int target_gdb_fileio_end(struct target *target, int retcode, int fileio_errno, bool ctrl_c) +{ + if (target->state != TARGET_HALTED) { + LOG_WARNING("target %s is not halted", target->cmd_name); + return ERROR_TARGET_NOT_HALTED; + } + return target->type->gdb_fileio_end(target, retcode, fileio_errno, ctrl_c); +} + /** * Reset the @c examined flag for the given target. * Pure paranoia -- targets are zeroed on allocation. @@ -1151,6 +1173,12 @@ static int target_init_one(struct command_context *cmd_ctx, if (target->type->bulk_write_memory == NULL) target->type->bulk_write_memory = target_bulk_write_memory_default; + if (target->type->get_gdb_fileio_info == NULL) + target->type->get_gdb_fileio_info = target_get_gdb_fileio_info_default; + + if (target->type->gdb_fileio_end == NULL) + target->type->gdb_fileio_end = target_gdb_fileio_end_default; + return ERROR_OK; } @@ -1700,6 +1728,20 @@ int target_arch_state(struct target *target) return retval; } +static int target_get_gdb_fileio_info_default(struct target *target, + struct gdb_fileio_info *fileio_info) +{ + LOG_ERROR("Not implemented: %s", __func__); + return ERROR_FAIL; +} + +static int target_gdb_fileio_end_default(struct target *target, + int retcode, int fileio_errno, bool ctrl_c) +{ + LOG_ERROR("Not implemented: %s", __func__); + return ERROR_OK; +} + /* Single aligned words are guaranteed to use 16 or 32 bit access * mode respectively, otherwise data is handled as quickly as * possible