* Copyright (C) 2005 by Dominic Rath *
* Dominic.Rath@gmx.de *
* *
- * Copyright (C) 2007,2008 Øyvind Harboe *
+ * Copyright (C) 2007,2008 Øyvind Harboe *
* oyvind.harboe@zylin.com *
* *
* Copyright (C) 2009 SoftPLC Corporation *
*/
static tap_state_t state_follower = TAP_RESET;
-void tap_set_state_impl( tap_state_t new_state )
+void tap_set_state_impl(tap_state_t new_state)
{
/* this is the state we think the TAPs are in now, was cur_state */
state_follower = new_state;
*/
static tap_state_t end_state_follower = TAP_RESET;
-void tap_set_end_state( tap_state_t new_end_state )
+void tap_set_end_state(tap_state_t new_end_state)
{
/* this is the state we think the TAPs will be in at completion of the
current TAP operation, was end_state
}
-int tap_move_ndx( tap_state_t astate )
+int tap_move_ndx(tap_state_t astate)
{
/* given a stable state, return the index into the tms_seqs[] array within tap_get_tms_path() */
int ndx;
- switch ( astate )
+ switch (astate)
{
case TAP_RESET: ndx = 0; break;
case TAP_DRSHIFT: ndx = 2; break;
case TAP_IRSHIFT: ndx = 4; break;
case TAP_IRPAUSE: ndx = 5; break;
default:
- LOG_ERROR( "fatal: unstable state \"%s\" used in tap_move_ndx()", tap_state_name(astate) );
+ LOG_ERROR("fatal: unstable state \"%s\" used in tap_move_ndx()", tap_state_name(astate));
exit(1);
}
#define HEX__(n) 0x##n##LU
#define B8__(x) \
- (((x) & 0x0000000FLU)?(1<<0):0) \
- +(((x) & 0x000000F0LU)?(1<<1):0) \
- +(((x) & 0x00000F00LU)?(1<<2):0) \
- +(((x) & 0x0000F000LU)?(1<<3):0) \
- +(((x) & 0x000F0000LU)?(1<<4):0) \
- +(((x) & 0x00F00000LU)?(1<<5):0) \
- +(((x) & 0x0F000000LU)?(1<<6):0) \
- +(((x) & 0xF0000000LU)?(1<<7):0)
+ (((x) & 0x0000000FLU)?(1 << 0):0) \
+ +(((x) & 0x000000F0LU)?(1 << 1):0) \
+ +(((x) & 0x00000F00LU)?(1 << 2):0) \
+ +(((x) & 0x0000F000LU)?(1 << 3):0) \
+ +(((x) & 0x000F0000LU)?(1 << 4):0) \
+ +(((x) & 0x00F00000LU)?(1 << 5):0) \
+ +(((x) & 0x0F000000LU)?(1 << 6):0) \
+ +(((x) & 0xF0000000LU)?(1 << 7):0)
#define B8(bits,count) { ((uint8_t)B8__(HEX__(bits))), (count) }
static tms_table *tms_seqs=&short_tms_seqs;
-int tap_get_tms_path( tap_state_t from, tap_state_t to )
+int tap_get_tms_path(tap_state_t from, tap_state_t to)
{
return (*tms_seqs)[tap_move_ndx(from)][tap_move_ndx(to)].bits;
}
-int tap_get_tms_path_len( tap_state_t from, tap_state_t to )
+int tap_get_tms_path_len(tap_state_t from, tap_state_t to)
{
return (*tms_seqs)[tap_move_ndx(from)][tap_move_ndx(to)].bit_count;
}
/* A switch () is used because it is symbol dependent
(not value dependent like an array), and can also check bounds.
*/
- switch ( astate )
+ switch (astate)
{
case TAP_RESET:
case TAP_IDLE:
new_state = TAP_IREXIT2;
break;
default:
- LOG_ERROR( "fatal: invalid argument cur_state=%d", cur_state );
+ LOG_ERROR("fatal: invalid argument cur_state=%d", cur_state);
exit(1);
break;
}
new_state = TAP_IRPAUSE;
break;
default:
- LOG_ERROR( "fatal: invalid argument cur_state=%d", cur_state );
+ LOG_ERROR("fatal: invalid argument cur_state=%d", cur_state);
exit(1);
break;
}
{
const char* ret;
- switch ( state )
+ switch (state)
{
case TAP_RESET: ret = "RESET"; break;
case TAP_IDLE: ret = "RUN/IDLE"; break;
{
tap_state_t x;
- for ( x = 0 ; x < TAP_NUM_STATES ; x++ ){
+ for (x = 0 ; x < TAP_NUM_STATES ; x++) {
/* be nice to the human */
- if ( 0 == strcasecmp( name, tap_state_name(x) ) ){
+ if (0 == strcasecmp(name, tap_state_name(x))) {
return x;
}
}