From ab98640b1409e5d121a233c099142bcff045ae09 Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Tue, 27 Aug 2002 07:58:12 +0000 Subject: [PATCH] Added part_find_data_register(). git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@117 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- include/jtag/part.h | 1 + jtag/src/part/part.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/include/jtag/part.h b/include/jtag/part.h index 98b49ced..dda8917e 100644 --- a/include/jtag/part.h +++ b/include/jtag/part.h @@ -51,6 +51,7 @@ part *part_alloc( void ); void part_free( part *p ); part *read_part( FILE *f, const tap_register *idr ); instruction *part_find_instruction( part *p, const char *iname ); +data_register *part_find_data_register( part *p, const char *drname ); void part_set_signal( part *p, const char *pname, int out, int val ); int part_get_signal( part *p, const char *pname ); diff --git a/jtag/src/part/part.c b/jtag/src/part/part.c index e4755359..6c8b16e9 100644 --- a/jtag/src/part/part.c +++ b/jtag/src/part/part.c @@ -111,6 +111,24 @@ part_find_instruction( part *p, const char *iname ) return i; } +data_register * +part_find_data_register( part *p, const char *drname ) +{ + data_register *dr; + + if (!p || !drname) + return NULL; + + dr = p->data_registers; + while (dr) { + if (strcmp( drname, dr->name ) == 0) + break; + dr = dr->next + } + + return dr; +} + void part_set_signal( part *p, const char *pname, int out, int val ) {