X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Ftarget%2Ftarget_type.h;h=947080381c172812b2751d65141c6be63882cbf1;hb=bb8d37ddf12a2ad76ede129b63522bfa2940d34e;hp=cf30cf8cc69e88b72f6f30fda4baa6a5afd9b884;hpb=358ab3483d2cad0c869585f8a340154690f56569;p=fw%2Fopenocd diff --git a/src/target/target_type.h b/src/target/target_type.h index cf30cf8cc..947080381 100644 --- a/src/target/target_type.h +++ b/src/target/target_type.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + /*************************************************************************** * Copyright (C) 2005 by Dominic Rath * * Dominic.Rath@gmx.de * @@ -7,25 +9,12 @@ * * * Copyright (C) 2008 by Spencer Oliver * * spen@spen-soft.co.uk * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * ***************************************************************************/ #ifndef OPENOCD_TARGET_TARGET_TYPE_H #define OPENOCD_TARGET_TARGET_TYPE_H -#include +#include struct target; @@ -242,6 +231,17 @@ struct target_type { /** * Free all the resources allocated by the target. * + * WARNING: deinit_target is called unconditionally regardless the target has + * ever been examined/initialised or not. + * If a problem has prevented establishing JTAG/SWD/... communication + * or + * if the target was created with -defer-examine flag and has never been + * examined + * then it is not possible to communicate with the target. + * + * If you need to talk to the target during deinit, first check if + * target_was_examined()! + * * @param target The target to deinit */ void (*deinit_target)(struct target *target); @@ -286,6 +286,15 @@ struct target_type { */ int (*gdb_fileio_end)(struct target *target, int retcode, int fileio_errno, bool ctrl_c); + /* Parse target-specific GDB query commands. + * The string pointer "response_p" is always assigned by the called function + * to a pointer to a NULL-terminated string, even when the function returns + * an error. The string memory is not freed by the caller, so this function + * must pay attention for possible memory leaks if the string memory is + * dynamically allocated. + */ + int (*gdb_query_custom)(struct target *target, const char *packet, char **response_p); + /* do target profiling */ int (*profiling)(struct target *target, uint32_t *samples,