diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 159ded63..70e16b1e 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -20,6 +20,9 @@ Statically sort the structure lists so that we can mark them readonly and thus share them across instances of urjtag. + * include/urjtag/bfin.h, src/bfin/bfin.c, src/bfin/bfin-part-bfin.c: Switch + from local register_value to common urj_tap_register_get_value. + 2010-01-28 Mike Frysinger * src/cmd/cmd_bfin.c: Replace one-insn-a-file option with dynamic instruction diff --git a/urjtag/include/urjtag/bfin.h b/urjtag/include/urjtag/bfin.h index b4d418a6..08fd9099 100644 --- a/urjtag/include/urjtag/bfin.h +++ b/urjtag/include/urjtag/bfin.h @@ -219,7 +219,6 @@ int part_is_bfin (urj_chain_t *, int); void part_bypass (urj_chain_t *, int); urj_tap_register_t *register_init_value (urj_tap_register_t *, uint64_t); -uint64_t register_value (urj_tap_register_t *); int part_scan_select (urj_chain_t *, int, int); int chain_scan_select (urj_chain_t *, int); diff --git a/urjtag/src/bfin/bfin-part-bfin.c b/urjtag/src/bfin/bfin-part-bfin.c index 364720dd..ee57c1d0 100644 --- a/urjtag/src/bfin/bfin-part-bfin.c +++ b/urjtag/src/bfin/bfin-part-bfin.c @@ -21,10 +21,11 @@ #include #include #include - + #include #include #include +#include #include /* The helper functions for Blackfin DBGCTL and DBGSTAT operations. */ @@ -38,7 +39,7 @@ bfin_dbgctl_init (urj_part_t *part, uint16_t v) static uint16_t bfin_dbgstat_value (urj_part_t *part) { - return register_value (part->active_instruction->data_register->out); + return urj_tap_register_get_value (part->active_instruction->data_register->out); } static uint32_t diff --git a/urjtag/src/bfin/bfin.c b/urjtag/src/bfin/bfin.c index b95c638c..df0cba9f 100644 --- a/urjtag/src/bfin/bfin.c +++ b/urjtag/src/bfin/bfin.c @@ -103,18 +103,6 @@ register_init_value (urj_tap_register_t *tr, uint64_t value) return tr; } -uint64_t -register_value (urj_tap_register_t *tr) -{ - uint64_t v = 0; - int i; - - for (i = 0; i < tr->len; i++) - v = (v << 1) | tr->data[i]; - - return v; -} - static int bfin_set_scan (urj_part_t *part, int scan) { @@ -466,7 +454,7 @@ chain_emupc_get (urj_chain_t *chain, int save) continue; r = part->active_instruction->data_register->out; - BFIN_PART_EMUPC (part) = register_value (r); + BFIN_PART_EMUPC (part) = urj_tap_register_get_value (r); if (save) BFIN_PART_EMUPC_ORIG (part) = BFIN_PART_EMUPC (part); } @@ -486,7 +474,7 @@ part_emupc_get (urj_chain_t *chain, int n, int save) part = chain->parts->parts[n]; r = part->active_instruction->data_register->out; - BFIN_PART_EMUPC (part) = register_value (r); + BFIN_PART_EMUPC (part) = urj_tap_register_get_value (r); if (save) BFIN_PART_EMUPC_ORIG (part) = BFIN_PART_EMUPC (part); @@ -1043,7 +1031,7 @@ emudat_value (urj_tap_register_t *r) { uint64_t value; - value = register_value (r); + value = urj_tap_register_get_value (r); value >>= (r->len - 32); return value;