diff --git a/include/jtag/part.h b/include/jtag/part.h index 5941c06d..917200f1 100644 --- a/include/jtag/part.h +++ b/include/jtag/part.h @@ -40,6 +40,7 @@ struct part { instruction *active_instruction; int boundary_length; bsbit **bsbits; + tap_register *idr; tap_register *bsr; tap_register *prev_bsr; }; diff --git a/jtag/src/part/parse.c b/jtag/src/part/parse.c index 64658a81..5e809189 100644 --- a/jtag/src/part/parse.c +++ b/jtag/src/part/parse.c @@ -38,7 +38,7 @@ get_token( char *buf ) } part * -read_part( FILE *f ) +read_part( FILE *f, tap_register *idr ) { int line = 0; part *part; @@ -52,6 +52,8 @@ read_part( FILE *f ) return NULL; } + part->idr = register_duplicate( idr ); + for (;;) { char *t; char buf[1024]; diff --git a/jtag/src/part/part.c b/jtag/src/part/part.c index a66a4876..2386159d 100644 --- a/jtag/src/part/part.c +++ b/jtag/src/part/part.c @@ -42,6 +42,7 @@ part_alloc( void ) p->active_instruction = NULL; p->boundary_length = 0; p->bsbits = NULL; + p->idr = NULL; p->bsr = NULL; p->prev_bsr = NULL; @@ -75,6 +76,9 @@ part_free( part *p ) bsbit_free( p->bsbits[i] ); free( p->bsbits ); + /* idr */ + register_free( p->idr ); + /* bsr */ register_free( p->bsr ); register_free( p->prev_bsr );