diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 6b98ae76..548fd430 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -1,4 +1,15 @@ +2009-04-22 Rutger Hofman + A very few typedef'ed types do NOT have an _t prefix. Orthogonize this by + adding _t to typedefs: instruction, data_register, tap_register. + * include/part.h, include/data_register.h, include/instruction.h, + include/register.h, include/tap.h, src/cmd/instruction.c, + src/cmd/register.c, src/cmd/dr.c, src/cmd/bit.c, src/cmd/scan.c, + src/cmd/print.c, src/tap/discovery.c, src/tap/detect.c, src/tap/register.c, + src/tap/tap.c, src/tap/idcode.c, src/part/instruction.c, src/part/part.c, + src/part/data_register.c, src/bus/fjmem.c, src/bus/ejtag_dma.c, + src/bus/avr32.c, src/bus/ejtag.c, src/svf/svf.c, src/svf/svf.h + 2009-04-22 Rutger Hofman Check suspicious-looking public symbols whether they shouldn't be in fact diff --git a/urjtag/include/data_register.h b/urjtag/include/data_register.h index cf5ac6b9..4987d58a 100644 --- a/urjtag/include/data_register.h +++ b/urjtag/include/data_register.h @@ -29,17 +29,17 @@ #define MAXLEN_DATA_REGISTER 32 -typedef struct data_register data_register; +typedef struct data_register data_register_t; struct data_register { char name[MAXLEN_DATA_REGISTER + 1]; /* (public) register name */ - tap_register *in; /* (public) register value clocked in */ - tap_register *out; /* (public) register value clocked out */ - data_register *next; + tap_register_t *in; /* (public) register value clocked in */ + tap_register_t *out; /* (public) register value clocked out */ + data_register_t *next; }; -data_register *data_register_alloc (const char *name, int len); -void data_register_free (data_register *dr); +data_register_t *data_register_alloc (const char *name, int len); +void data_register_free (data_register_t *dr); #endif /* DATA_REGISTER_H */ diff --git a/urjtag/include/instruction.h b/urjtag/include/instruction.h index 616657b4..8ea5a1a4 100644 --- a/urjtag/include/instruction.h +++ b/urjtag/include/instruction.h @@ -35,13 +35,13 @@ typedef struct instruction instruction; struct instruction { char name[MAXLEN_INSTRUCTION + 1]; - tap_register *value; - tap_register *out; - data_register *data_register; - instruction *next; + tap_register_t *value; + tap_register_t *out; + data_register_t *data_register; + instruction_t *next; }; -instruction *instruction_alloc (const char *name, int len, const char *val); -void instruction_free (instruction *i); +instruction_t *instruction_alloc (const char *name, int len, const char *val); +void instruction_free (instruction_t *i); #endif /* INSTRUCTION_H */ diff --git a/urjtag/include/part.h b/urjtag/include/part.h index 9de6773f..b799c50f 100644 --- a/urjtag/include/part.h +++ b/urjtag/include/part.h @@ -40,7 +40,7 @@ typedef struct part part_t; struct part { - tap_register *id; + tap_register_t *id; char *alias; /* djf refdes */ char manufacturer[MAXLEN_MANUFACTURER + 1]; char part[MAXLEN_PART + 1]; @@ -48,18 +48,18 @@ struct part signal_t *signals; salias_t *saliases; int instruction_length; - instruction *instructions; - instruction *active_instruction; - data_register *data_registers; + instruction_t *instructions; + instruction_t *active_instruction; + data_register_t *data_registers; int boundary_length; bsbit_t **bsbits; }; -part_t *part_alloc (const tap_register *id); +part_t *part_alloc (const tap_register_t *id); void part_free (part_t *p); part_t *read_part (FILE *f, tap_register_t *idr); -instruction *part_find_instruction (part_t *p, const char *iname); -data_register *part_find_data_register (part_t *p, const char *drname); +instruction_t *part_find_instruction (part_t *p, const char *iname); +data_register_t *part_find_data_register (part_t *p, const char *drname); signal_t *part_find_signal (part_t *p, const char *signalname); void part_set_instruction (part_t *p, const char *iname); void part_set_signal (part_t *p, signal_t *s, int out, int val); diff --git a/urjtag/include/register.h b/urjtag/include/register.h index 02fe2122..063e4920 100644 --- a/urjtag/include/register.h +++ b/urjtag/include/register.h @@ -25,7 +25,6 @@ #ifndef REGISTER_H #define REGISTER_H -#define tap_register_t tap_register typedef struct tap_register { char *data; /* (public, r/w) register data */ @@ -33,18 +32,18 @@ typedef struct tap_register char *string; /* (private) string representation of register data */ } tap_register_t; -tap_register *register_alloc (int len); -tap_register *register_duplicate (const tap_register_t *tr); +tap_register_t *register_alloc (int len); +tap_register_t *register_duplicate (const tap_register_t *tr); void register_free (tap_register_t *tr); -tap_register *register_fill (tap_register_t *tr, int val); +tap_register_t *register_fill (tap_register_t *tr, int val); const char *register_get_string (const tap_register_t *tr); int register_all_bits_same_value (const tap_register_t *tr); -tap_register *register_init (tap_register_t *tr, const char *value); +tap_register_t *register_init (tap_register_t *tr, const char *value); int register_compare (const tap_register_t *tr, const tap_register_t *tr2); int register_match (const tap_register_t *tr, const char *expr); -tap_register *register_inc (tap_register_t *tr); -tap_register *register_dec (tap_register_t *tr); -tap_register *register_shift_right (tap_register_t *tr, int shift); -tap_register *register_shift_left (tap_register_t *tr, int shift); +tap_register_t *register_inc (tap_register_t *tr); +tap_register_t *register_dec (tap_register_t *tr); +tap_register_t *register_shift_right (tap_register_t *tr, int shift); +tap_register_t *register_shift_left (tap_register_t *tr, int shift); #endif /* REGISTER_H */ diff --git a/urjtag/include/tap.h b/urjtag/include/tap.h index ef170771..5c71f93f 100644 --- a/urjtag/include/tap.h +++ b/urjtag/include/tap.h @@ -32,11 +32,11 @@ void tap_reset (chain_t *chain); void tap_reset_bypass (chain_t *chain); void tap_capture_dr (chain_t *chain); void tap_capture_ir (chain_t *chain); -void tap_defer_shift_register (chain_t *chain, const tap_register *in, - tap_register *out, int tap_exit); -void tap_shift_register_output (chain_t *chain, const tap_register *in, - tap_register *out, int tap_exit); -void tap_shift_register (chain_t *chain, const tap_register *in, - tap_register *out, int tap_exit); +void tap_defer_shift_register (chain_t *chain, const tap_register_t *in, + tap_register_t *out, int tap_exit); +void tap_shift_register_output (chain_t *chain, const tap_register_t *in, + tap_register_t *out, int tap_exit); +void tap_shift_register (chain_t *chain, const tap_register_t *in, + tap_register_t *out, int tap_exit); #endif /* TAP_H */ diff --git a/urjtag/src/bus/avr32.c b/urjtag/src/bus/avr32.c index 354714b2..494c4f4a 100644 --- a/urjtag/src/bus/avr32.c +++ b/urjtag/src/bus/avr32.c @@ -130,13 +130,13 @@ typedef struct /* ------------------------------------------------------------------------- */ static inline void -register_set_bit (tap_register *tr, unsigned int bitno, unsigned int val) +register_set_bit (tap_register_t *tr, unsigned int bitno, unsigned int val) { tr->data[bitno] = (val) ? 1 : 0; } static inline int -register_get_bit (tap_register *tr, unsigned int bitno) +register_get_bit (tap_register_t *tr, unsigned int bitno) { return (tr->data[bitno] & 1) ? 1 : 0; } @@ -144,7 +144,7 @@ register_get_bit (tap_register *tr, unsigned int bitno) static inline void shift_instr (bus_t *bus, unsigned int bit) { - tap_register *r = PART->active_instruction->out; + tap_register_t *r = PART->active_instruction->out; do { @@ -161,7 +161,7 @@ shift_instr (bus_t *bus, unsigned int bit) static inline void shift_data (bus_t *bus, unsigned int bit) { - data_register *dr = PART->active_instruction->data_register; + data_register_t *dr = PART->active_instruction->data_register; do { @@ -186,7 +186,7 @@ mwa_scan_in_instr (bus_t *bus) static void mwa_scan_in_addr (bus_t *bus, unsigned int slave, uint32_t addr, int mode) { - tap_register *r = PART->active_instruction->data_register->in; + tap_register_t *r = PART->active_instruction->data_register->in; int i; DBG (DBG_BASIC, _("%s: slave=%01x, addr=%08x, %s\n"), @@ -211,7 +211,7 @@ mwa_scan_in_addr (bus_t *bus, unsigned int slave, uint32_t addr, int mode) static void mwa_scan_in_data (bus_t *bus, uint32_t data) { - tap_register *r = PART->active_instruction->data_register->in; + tap_register_t *r = PART->active_instruction->data_register->in; int i; DBG (DBG_BASIC, _("%s: data=%08x\n"), __FUNCTION__, data); @@ -229,7 +229,7 @@ mwa_scan_in_data (bus_t *bus, uint32_t data) static void mwa_scan_out_data (bus_t *bus, uint32_t *pdata) { - tap_register *r = PART->active_instruction->data_register->out; + tap_register_t *r = PART->active_instruction->data_register->out; uint32_t data; int i; @@ -277,7 +277,7 @@ nexus_access_end (bus_t *bus) static void nexus_access_set_addr (bus_t *bus, uint32_t addr, int mode) { - tap_register *r = PART->active_instruction->data_register->in; + tap_register_t *r = PART->active_instruction->data_register->in; int i; DBG (DBG_BASIC, _("%s: addr=%08x, mode=%s\n"), __FUNCTION__, addr, @@ -299,7 +299,7 @@ nexus_access_set_addr (bus_t *bus, uint32_t addr, int mode) static void nexus_access_read_data (bus_t *bus, uint32_t *pdata) { - tap_register *r = PART->active_instruction->data_register->out; + tap_register_t *r = PART->active_instruction->data_register->out; uint32_t data; int i; @@ -317,7 +317,7 @@ nexus_access_read_data (bus_t *bus, uint32_t *pdata) static void nexus_access_write_data (bus_t *bus, uint32_t data) { - tap_register *r = PART->active_instruction->data_register->in; + tap_register_t *r = PART->active_instruction->data_register->in; int i; DBG (DBG_BASIC, _("%s: data=%08x\n"), __FUNCTION__, data); diff --git a/urjtag/src/bus/ejtag.c b/urjtag/src/bus/ejtag.c index 53c1d47b..9e274c0f 100644 --- a/urjtag/src/bus/ejtag.c +++ b/urjtag/src/bus/ejtag.c @@ -153,7 +153,7 @@ ejtag_bus_printinfo (bus_t *bus) } static uint32_t -reg_value (tap_register *reg) +reg_value (tap_register_t *reg) { uint32_t retval = 0; int i; @@ -169,7 +169,7 @@ reg_value (tap_register *reg) static uint32_t ejtag_run_pracc (bus_t *bus, const uint32_t *code, unsigned int len) { - data_register *ejaddr, *ejdata, *ejctrl; + data_register_t *ejaddr, *ejdata, *ejctrl; int i, pass; uint32_t addr, data, retval; @@ -281,7 +281,7 @@ ejtag_run_pracc (bus_t *bus, const uint32_t *code, unsigned int len) static int ejtag_bus_init (bus_t *bus) { - data_register *ejctrl, *ejimpl, *ejaddr, *ejdata, *ejall; + data_register_t *ejctrl, *ejimpl, *ejaddr, *ejdata, *ejall; uint32_t code[4] = { 0x3c04ff20, // lui $4,0xff20 0x349f0200, // ori $31,$4,0x0200 diff --git a/urjtag/src/bus/ejtag_dma.c b/urjtag/src/bus/ejtag_dma.c index a1efe7a6..bc4e24d5 100644 --- a/urjtag/src/bus/ejtag_dma.c +++ b/urjtag/src/bus/ejtag_dma.c @@ -130,7 +130,7 @@ ejtag_dma_bus_printinfo (bus_t *bus) * */ static uint32_t -reg_value (tap_register *reg) +reg_value (tap_register_t *reg) { uint32_t retval = 0; int i; @@ -170,9 +170,9 @@ siz_ (int sz) static void ejtag_dma_write (unsigned int addr, unsigned int data, int sz) { - static data_register *ejctrl = NULL; - static data_register *ejaddr = NULL; - static data_register *ejdata = NULL; + static data_register_t *ejctrl = NULL; + static data_register_t *ejaddr = NULL; + static data_register_t *ejdata = NULL; int i = 0; int timeout = 5; @@ -263,9 +263,9 @@ ejtag_dma_write (unsigned int addr, unsigned int data, int sz) static unsigned int ejtag_dma_read (unsigned int addr, int sz) { - static data_register *ejctrl = NULL; - static data_register *ejaddr = NULL; - static data_register *ejdata = NULL; + static data_register_t *ejctrl = NULL; + static data_register_t *ejaddr = NULL; + static data_register_t *ejdata = NULL; int i = 0; int timeout = 5; unsigned int ret; @@ -365,7 +365,7 @@ ejtag_dma_read (unsigned int addr, int sz) static int ejtag_dma_bus_init (bus_t *bus) { - data_register *ejctrl = NULL, *ejimpl = NULL, *ejaddr = NULL, *ejdata = + data_register_t *ejctrl = NULL, *ejimpl = NULL, *ejaddr = NULL, *ejdata = NULL; int timeout = 100; diff --git a/urjtag/src/bus/fjmem.c b/urjtag/src/bus/fjmem.c index 5f3f23ce..fd389488 100644 --- a/urjtag/src/bus/fjmem.c +++ b/urjtag/src/bus/fjmem.c @@ -72,7 +72,7 @@ typedef struct block_desc block_desc_t; typedef struct { uint32_t last_addr; - data_register *fjmem_reg; + data_register_t *fjmem_reg; block_desc_t block_desc; } bus_params_t; @@ -83,8 +83,8 @@ typedef struct static int fjmem_detect_reg_len (chain_t *chain, part_t *part, char *opcode, int len) { - data_register *dr; - instruction *i; + data_register_t *dr; + instruction_t *i; int l, fjmem_reg_len; char *tdo_bit; @@ -174,7 +174,7 @@ static int fjmem_detect_fields (chain_t *chain, part_t *part, bus_t *bus) { block_desc_t *bd = &(BLOCK_DESC); - data_register *dr = FJMEM_REG; + data_register_t *dr = FJMEM_REG; int idx; #ifdef DEBUG const char *reg_string; @@ -254,7 +254,7 @@ static int fjmem_query_blocks (chain_t *chain, part_t *part, bus_t *bus) { block_desc_t *bd = &(BLOCK_DESC); - data_register *dr = FJMEM_REG; + data_register_t *dr = FJMEM_REG; int max_block_num, block_num; int failed = 0; #ifdef DEBUG @@ -476,7 +476,7 @@ fjmem_free_blocks (block_param_t *bl) static void fjmem_bus_free (bus_t *bus) { - data_register *dr = FJMEM_REG; + data_register_t *dr = FJMEM_REG; /* fill all fields with '0' -> prepare idle instruction for next startup/detect */ @@ -583,7 +583,7 @@ fjmem_bus_area (bus_t *bus, uint32_t adr, bus_area_t *area) static void setup_address (bus_t *bus, uint32_t a, block_param_t *block) { - data_register *dr = FJMEM_REG; + data_register_t *dr = FJMEM_REG; block_desc_t *bd = &(BLOCK_DESC); int idx; uint16_t num = block->num; @@ -611,7 +611,7 @@ setup_address (bus_t *bus, uint32_t a, block_param_t *block) static void setup_data (bus_t *bus, uint32_t d, block_param_t *block) { - data_register *dr = FJMEM_REG; + data_register_t *dr = FJMEM_REG; block_desc_t *bd = &(BLOCK_DESC); int idx; @@ -632,7 +632,7 @@ fjmem_bus_read_start (bus_t *bus, uint32_t adr) { chain_t *chain = CHAIN; block_desc_t *bd = &(BLOCK_DESC); - data_register *dr = FJMEM_REG; + data_register_t *dr = FJMEM_REG; bus_area_t area; block_param_t *block; @@ -663,7 +663,7 @@ fjmem_bus_read_next (bus_t *bus, uint32_t adr) { chain_t *chain = CHAIN; block_desc_t *bd = &(BLOCK_DESC); - data_register *dr = FJMEM_REG; + data_register_t *dr = FJMEM_REG; uint32_t d; bus_area_t area; block_param_t *block; @@ -698,7 +698,7 @@ fjmem_bus_read_end (bus_t *bus) { chain_t *chain = CHAIN; block_desc_t *bd = &(BLOCK_DESC); - data_register *dr = FJMEM_REG; + data_register_t *dr = FJMEM_REG; uint32_t d; bus_area_t area; block_param_t *block; @@ -736,7 +736,7 @@ fjmem_bus_write (bus_t *bus, uint32_t adr, uint32_t data) { chain_t *chain = CHAIN; block_desc_t *bd = &(BLOCK_DESC); - data_register *dr = FJMEM_REG; + data_register_t *dr = FJMEM_REG; bus_area_t area; block_param_t *block; diff --git a/urjtag/src/cmd/bit.c b/urjtag/src/cmd/bit.c index 241f7097..39fb3422 100644 --- a/urjtag/src/cmd/bit.c +++ b/urjtag/src/cmd/bit.c @@ -48,7 +48,7 @@ static int cmd_bit_run (chain_t *chain, char *params[]) { part_t *part; - data_register *bsr; + data_register_t *bsr; unsigned int bit; int type; int safe; diff --git a/urjtag/src/cmd/dr.c b/urjtag/src/cmd/dr.c index aa26a639..6bf4b11c 100644 --- a/urjtag/src/cmd/dr.c +++ b/urjtag/src/cmd/dr.c @@ -36,7 +36,7 @@ static int cmd_dr_run (chain_t *chain, char *params[]) { int dir = 1; - tap_register *r; + tap_register_t *r; if (cmd_params (params) < 1 || cmd_params (params) > 2) return -1; diff --git a/urjtag/src/cmd/instruction.c b/urjtag/src/cmd/instruction.c index 5573018d..b09ce994 100644 --- a/urjtag/src/cmd/instruction.c +++ b/urjtag/src/cmd/instruction.c @@ -85,7 +85,7 @@ cmd_instruction_run (chain_t *chain, char *params[]) if (cmd_params (params) == 4) { - instruction *i; + instruction_t *i; if (strlen (params[2]) != part->instruction_length) { diff --git a/urjtag/src/cmd/print.c b/urjtag/src/cmd/print.c index 90b026c2..d494389f 100644 --- a/urjtag/src/cmd/print.c +++ b/urjtag/src/cmd/print.c @@ -1,4 +1,4 @@ -/* +/src* * $Id$ * * Copyright (C) 2003 ETC s.r.o. @@ -104,7 +104,7 @@ cmd_print_run (chain_t *chain, char *params[]) if (strcasecmp (params[1], "instructions") == 0) { part_t *part; - instruction *inst; + instruction_t *inst; snprintf (format, 128, _(" Active %%-%ds %%-%ds"), MAXLEN_INSTRUCTION, MAXLEN_DATA_REGISTER); diff --git a/urjtag/src/cmd/register.c b/urjtag/src/cmd/register.c index 3f378f5a..5b6c2969 100644 --- a/urjtag/src/cmd/register.c +++ b/urjtag/src/cmd/register.c @@ -37,7 +37,7 @@ cmd_register_run (chain_t *chain, char *params[]) { part_t *part; unsigned int len; - data_register *dr; + data_register_t *dr; if (cmd_params (params) != 3) return -1; diff --git a/urjtag/src/cmd/scan.c b/urjtag/src/cmd/scan.c index c739c3f3..6f6eceda 100644 --- a/urjtag/src/cmd/scan.c +++ b/urjtag/src/cmd/scan.c @@ -36,8 +36,8 @@ static int cmd_scan_run (chain_t *chain, char *params[]) { part_t *part; - data_register *bsr; - tap_register *obsr; + data_register_t *bsr; + tap_register_t *obsr; int i; if ((i = cmd_params (params)) < 1) diff --git a/urjtag/src/part/data_register.c b/urjtag/src/part/data_register.c index cdcec7a5..5485c586 100644 --- a/urjtag/src/part/data_register.c +++ b/urjtag/src/part/data_register.c @@ -30,10 +30,10 @@ #include "data_register.h" -data_register * +data_register_t * data_register_alloc (const char *name, int len) { - data_register *dr; + data_register_t *dr; if (!name) return NULL; @@ -72,7 +72,7 @@ data_register_alloc (const char *name, int len) } void -data_register_free (data_register *dr) +data_register_free (data_register_t *dr) { if (!dr) return; diff --git a/urjtag/src/part/instruction.c b/urjtag/src/part/instruction.c index 01d43357..92e6c0bb 100644 --- a/urjtag/src/part/instruction.c +++ b/urjtag/src/part/instruction.c @@ -30,10 +30,10 @@ #include "instruction.h" -instruction * +instruction_t * instruction_alloc (const char *name, int len, const char *val) { - instruction *i; + instruction_t *i; if (!name || !val) return NULL; @@ -69,7 +69,7 @@ instruction_alloc (const char *name, int len, const char *val) } void -instruction_free (instruction *i) +instruction_free (instruction_t *i) { if (!i) return; diff --git a/urjtag/src/part/part.c b/urjtag/src/part/part.c index 874426f0..91447b6a 100644 --- a/urjtag/src/part/part.c +++ b/urjtag/src/part/part.c @@ -32,7 +32,7 @@ /* part */ part_t * -part_alloc (const tap_register *id) +part_alloc (const tap_register_t *id) { part_t *p = malloc (sizeof *p); if (!p) @@ -87,7 +87,7 @@ part_free (part_t *p) /* instructions */ while (p->instructions) { - instruction *i = p->instructions; + instruction_t *i = p->instructions; p->instructions = i->next; instruction_free (i); } @@ -95,7 +95,7 @@ part_free (part_t *p) /* data registers */ while (p->data_registers) { - data_register *dr = p->data_registers; + data_register_t *dr = p->data_registers; p->data_registers = dr->next; data_register_free (dr); } @@ -108,10 +108,10 @@ part_free (part_t *p) free (p); } -instruction * +instruction_t * part_find_instruction (part_t *p, const char *iname) { - instruction *i; + instruction_t *i; if (!p || !iname) return NULL; @@ -127,10 +127,10 @@ part_find_instruction (part_t *p, const char *iname) return i; } -data_register * +data_register_t * part_find_data_register (part_t *p, const char *drname) { - data_register *dr; + data_register_t *dr; if (!p || !drname) return NULL; @@ -184,7 +184,7 @@ part_set_instruction (part_t *p, const char *iname) void part_set_signal (part_t *p, signal_t *s, int out, int val) { - data_register *bsr; + data_register_t *bsr; if (!p || !s) return; @@ -230,7 +230,7 @@ part_set_signal (part_t *p, signal_t *s, int out, int val) int part_get_signal (part_t *p, signal_t *s) { - data_register *bsr; + data_register_t *bsr; if (!p || !s) return -1; diff --git a/urjtag/src/svf/svf.c b/urjtag/src/svf/svf.c index da4377e2..0f23469e 100644 --- a/urjtag/src/svf/svf.c +++ b/urjtag/src/svf/svf.c @@ -407,7 +407,7 @@ svf_build_bit_string (char *hex_string, int len) * 0 : error occurred */ static int -svf_copy_hex_to_register (char *hex_string, tap_register *reg) +svf_copy_hex_to_register (char *hex_string, tap_register_t *reg) { char *bit_string; @@ -443,7 +443,7 @@ svf_copy_hex_to_register (char *hex_string, tap_register *reg) */ static int svf_compare_tdo (parser_priv_t *priv, char *tdo, char *mask, - tap_register *reg, YYLTYPE * loc) + tap_register_t *reg, YYLTYPE * loc) { char *tdo_bit, *mask_bit; int pos, mismatch, result = 1; diff --git a/urjtag/src/svf/svf.h b/urjtag/src/svf/svf.h index 34c9fbd2..2273ee62 100644 --- a/urjtag/src/svf/svf.h +++ b/urjtag/src/svf/svf.h @@ -95,8 +95,8 @@ struct parser_priv struct svf_parser_params parser_params; void *scanner; part_t *part; - instruction *ir; - data_register *dr; + instruction_t *ir; + data_register_t *dr; sxr_t sir_params; sxr_t sdr_params; int endir; diff --git a/urjtag/src/tap/detect.c b/urjtag/src/tap/detect.c index b5050f08..2024b312 100644 --- a/urjtag/src/tap/detect.c +++ b/urjtag/src/tap/detect.c @@ -49,10 +49,10 @@ struct id_record }; static int -find_record (char *filename, tap_register *key, struct id_record *idr) +find_record (char *filename, tap_register_t *key, struct id_record *idr) { FILE *file; - tap_register *tr; + tap_register_t *tr; int r = 0; file = fopen (filename, "r"); @@ -168,7 +168,7 @@ find_record (char *filename, tap_register *key, struct id_record *idr) } static uint64_t -bits_to_uint64 (tap_register *t) +bits_to_uint64 (tap_register_t *t) { int i; uint64_t l, b; @@ -189,12 +189,12 @@ int detect_parts (chain_t *chain, const char *db_path) { int irlen; - tap_register *ir; + tap_register_t *ir; int chlen; - tap_register *one; - tap_register *ones; - tap_register *br; - tap_register *id; + tap_register_t *one; + tap_register_t *ones; + tap_register_t *br; + tap_register_t *id; parts_t *ps; int i; @@ -262,8 +262,8 @@ detect_parts (chain_t *chain, const char *db_path) for (i = 0; i < chlen; i++) { part_t *part; - tap_register *did = br; /* detected id (length is 1 or 32) */ - tap_register *key; + tap_register_t *did = br; /* detected id (length is 1 or 32) */ + tap_register_t *key; struct id_record idr; char *p; @@ -421,7 +421,7 @@ detect_parts (chain_t *chain, const char *db_path) int manual_add (chain_t *chain, int instr_len) { - tap_register *id; + tap_register_t *id; part_t *part; char *cmd[] = { NULL, NULL, NULL, NULL, NULL }; char *str; diff --git a/urjtag/src/tap/discovery.c b/urjtag/src/tap/discovery.c index 06e5ae73..21562478 100644 --- a/urjtag/src/tap/discovery.c +++ b/urjtag/src/tap/discovery.c @@ -44,9 +44,9 @@ int detect_register_size (chain_t *chain) { int len; - tap_register *rz; - tap_register *rout; - tap_register *rpat; + tap_register_t *rz; + tap_register_t *rout; + tap_register_t *rpat; /* This seems to be a good place to check if TDO changes at all */ int tdo, tdo_stuck = -2; @@ -132,8 +132,8 @@ void discovery (chain_t *chain) { int irlen; - tap_register *ir; - tap_register *irz; + tap_register_t *ir; + tap_register_t *irz; /* detecting IR size */ jtag_reset (chain); diff --git a/urjtag/src/tap/idcode.c b/urjtag/src/tap/idcode.c index 363566db..6e9e62aa 100644 --- a/urjtag/src/tap/idcode.c +++ b/urjtag/src/tap/idcode.c @@ -37,9 +37,9 @@ urj_tap_idcode (chain_t *chain, unsigned int bytes) { int i; int hit = 0; - tap_register *rz; - tap_register *rout; - tap_register *rnull; + tap_register_t *rz; + tap_register_t *rout; + tap_register_t *rnull; chain_set_trst (chain, 0); chain_set_trst (chain, 1); diff --git a/urjtag/src/tap/register.c b/urjtag/src/tap/register.c index b238de3b..c2fe32cf 100644 --- a/urjtag/src/tap/register.c +++ b/urjtag/src/tap/register.c @@ -27,15 +27,15 @@ #include "register.h" -tap_register * +tap_register_t * register_alloc (int len) { - tap_register *tr; + tap_register_t *tr; if (len < 1) return NULL; - tr = malloc (sizeof (tap_register)); + tr = malloc (sizeof (tap_register_t)); if (!tr) return NULL; @@ -62,8 +62,8 @@ register_alloc (int len) return tr; } -tap_register * -register_duplicate (const tap_register *tr) +tap_register_t * +register_duplicate (const tap_register_t *tr) { if (!tr) return NULL; @@ -72,7 +72,7 @@ register_duplicate (const tap_register *tr) } void -register_free (tap_register *tr) +register_free (tap_register_t *tr) { if (tr) { @@ -82,8 +82,8 @@ register_free (tap_register *tr) free (tr); } -tap_register * -register_fill (tap_register *tr, int val) +tap_register_t * +register_fill (tap_register_t *tr, int val) { if (tr) memset (tr->data, val & 1, tr->len); @@ -92,7 +92,7 @@ register_fill (tap_register *tr, int val) } const char * -register_get_string (const tap_register *tr) +register_get_string (const tap_register_t *tr) { int i; @@ -106,7 +106,7 @@ register_get_string (const tap_register *tr) } int -register_all_bits_same_value (const tap_register *tr) +register_all_bits_same_value (const tap_register_t *tr) { int i, value; if (!tr) @@ -127,8 +127,8 @@ register_all_bits_same_value (const tap_register *tr) return value; } -tap_register * -register_init (tap_register *tr, const char *value) +tap_register_t * +register_init (tap_register_t *tr, const char *value) { int i; @@ -154,7 +154,7 @@ register_init (tap_register *tr, const char *value) } int -register_compare (const tap_register *tr, const tap_register *tr2) +register_compare (const tap_register_t *tr, const tap_register_t *tr2) { int i; @@ -175,7 +175,7 @@ register_compare (const tap_register *tr, const tap_register *tr2) } int -register_match (const tap_register *tr, const char *expr) +register_match (const tap_register_t *tr, const char *expr) { int i; const char *s; @@ -192,8 +192,8 @@ register_match (const tap_register *tr, const char *expr) return 1; } -tap_register * -register_inc (tap_register *tr) +tap_register_t * +register_inc (tap_register_t *tr) { int i; @@ -211,8 +211,8 @@ register_inc (tap_register *tr) return tr; } -tap_register * -register_dec (tap_register *tr) +tap_register_t * +register_dec (tap_register_t *tr) { int i; @@ -230,8 +230,8 @@ register_dec (tap_register *tr) return tr; } -tap_register * -register_shift_right (tap_register *tr, int shift) +tap_register_t * +register_shift_right (tap_register_t *tr, int shift) { int i; @@ -252,8 +252,8 @@ register_shift_right (tap_register *tr, int shift) return tr; } -tap_register * -register_shift_left (tap_register *tr, int shift) +tap_register_t * +register_shift_left (tap_register_t *tr, int shift) { int i; diff --git a/urjtag/src/tap/tap.c b/urjtag/src/tap/tap.c index 1cda3eb1..1483642d 100644 --- a/urjtag/src/tap/tap.c +++ b/urjtag/src/tap/tap.c @@ -49,7 +49,7 @@ tap_reset_bypass (chain_t *chain) instruction register length of the chain is already known */ if (chain->total_instr_len > 0) { - tap_register *ir = + tap_register_t *ir = register_fill (register_alloc (chain->total_instr_len), 1); if (!ir) { @@ -66,8 +66,8 @@ tap_reset_bypass (chain_t *chain) } void -tap_defer_shift_register (chain_t *chain, const tap_register *in, - tap_register *out, int tap_exit) +tap_defer_shift_register (chain_t *chain, const tap_register_t *in, + tap_register_t *out, int tap_exit) { int i; @@ -108,8 +108,8 @@ tap_defer_shift_register (chain_t *chain, const tap_register *in, } void -tap_shift_register_output (chain_t *chain, const tap_register *in, - tap_register *out, int tap_exit) +tap_shift_register_output (chain_t *chain, const tap_register_t *in, + tap_register_t *out, int tap_exit) { if (out != NULL) { @@ -131,8 +131,8 @@ tap_shift_register_output (chain_t *chain, const tap_register *in, } void -tap_shift_register (chain_t *chain, const tap_register *in, - tap_register *out, int tap_exit) +tap_shift_register (chain_t *chain, const tap_register_t *in, + tap_register_t *out, int tap_exit) { tap_defer_shift_register (chain, in, out, tap_exit); tap_shift_register_output (chain, in, out, tap_exit);