X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fjtag%2Fcommands.c;h=e2d22cc94a3436d6efd655a43612c0810d1c6207;hb=e72b2601e71f49af10f72c4bb6220ee2061ef173;hp=750ebab0d6eab01bd661aaa79e8a00aae09f8d38;hpb=2bb9256c34e75180450053787f98b13b8b07164d;p=openocd.git diff --git a/src/jtag/commands.c b/src/jtag/commands.c index 750ebab0d6..e2d22cc94a 100644 --- a/src/jtag/commands.c +++ b/src/jtag/commands.c @@ -23,9 +23,7 @@ * 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, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + * along with this program. If not, see . * ***************************************************************************/ #ifdef HAVE_CONFIG_H @@ -146,6 +144,18 @@ void jtag_command_queue_reset(void) next_command_pointer = &jtag_command_queue; } +/** + * Copy a struct scan_field for insertion into the queue. + * + * This allocates a new copy of out_value using cmd_queue_alloc. + */ +void jtag_scan_field_clone(struct scan_field *dst, const struct scan_field *src) +{ + dst->num_bits = src->num_bits; + dst->out_value = buf_cpy(src->out_value, cmd_queue_alloc(DIV_ROUND_UP(src->num_bits, 8)), src->num_bits); + dst->in_value = src->in_value; +} + enum scan_type jtag_scan_type(const struct scan_command *cmd) { int i;