jtag_tap_t -> struct jtag_tap

Search and destroy the jtag_tap_t typedef.  This also cleans up a
layering violation, removing the declaration from types.h.
__archive__
Zachary T Welch 2009-11-13 03:19:35 -08:00
parent 9f212b01be
commit 42ef503d37
50 changed files with 149 additions and 156 deletions

View File

@ -56,17 +56,17 @@ avrf_type_t avft_chips_info[] =
{"atmega128", 0x9702, 256, 512, 8, 512}, {"atmega128", 0x9702, 256, 512, 8, 512},
}; };
int avr_jtag_sendinstr(jtag_tap_t *tap, uint8_t *ir_in, uint8_t ir_out); int avr_jtag_sendinstr(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out);
int avr_jtag_senddat(jtag_tap_t *tap, uint32_t *dr_in, uint32_t dr_out, int len); int avr_jtag_senddat(struct jtag_tap *tap, uint32_t *dr_in, uint32_t dr_out, int len);
int mcu_write_ir(jtag_tap_t *tap, uint8_t *ir_in, uint8_t *ir_out, int ir_len, int rti); int mcu_write_ir(struct jtag_tap *tap, uint8_t *ir_in, uint8_t *ir_out, int ir_len, int rti);
int mcu_write_dr(jtag_tap_t *tap, uint8_t *ir_in, uint8_t *ir_out, int dr_len, int rti); int mcu_write_dr(struct jtag_tap *tap, uint8_t *ir_in, uint8_t *ir_out, int dr_len, int rti);
int mcu_write_ir_u8(jtag_tap_t *tap, uint8_t *ir_in, uint8_t ir_out, int ir_len, int rti); int mcu_write_ir_u8(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out, int ir_len, int rti);
int mcu_write_dr_u8(jtag_tap_t *tap, uint8_t *ir_in, uint8_t ir_out, int dr_len, int rti); int mcu_write_dr_u8(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out, int dr_len, int rti);
int mcu_write_ir_u16(jtag_tap_t *tap, uint16_t *ir_in, uint16_t ir_out, int ir_len, int rti); int mcu_write_ir_u16(struct jtag_tap *tap, uint16_t *ir_in, uint16_t ir_out, int ir_len, int rti);
int mcu_write_dr_u16(jtag_tap_t *tap, uint16_t *ir_in, uint16_t ir_out, int dr_len, int rti); int mcu_write_dr_u16(struct jtag_tap *tap, uint16_t *ir_in, uint16_t ir_out, int dr_len, int rti);
int mcu_write_ir_u32(jtag_tap_t *tap, uint32_t *ir_in, uint32_t ir_out, int ir_len, int rti); int mcu_write_ir_u32(struct jtag_tap *tap, uint32_t *ir_in, uint32_t ir_out, int ir_len, int rti);
int mcu_write_dr_u32(jtag_tap_t *tap, uint32_t *ir_in, uint32_t ir_out, int dr_len, int rti); int mcu_write_dr_u32(struct jtag_tap *tap, uint32_t *ir_in, uint32_t ir_out, int dr_len, int rti);
int mcu_execute_queue(void); int mcu_execute_queue(void);
/* avr program functions */ /* avr program functions */

View File

@ -32,7 +32,7 @@ static int str9xpec_erase_area(struct flash_bank_s *bank, int first, int last);
static int str9xpec_set_address(struct flash_bank_s *bank, uint8_t sector); static int str9xpec_set_address(struct flash_bank_s *bank, uint8_t sector);
static int str9xpec_write_options(struct flash_bank_s *bank); static int str9xpec_write_options(struct flash_bank_s *bank);
int str9xpec_set_instr(jtag_tap_t *tap, uint32_t new_instr, tap_state_t end_state) int str9xpec_set_instr(struct jtag_tap *tap, uint32_t new_instr, tap_state_t end_state)
{ {
if (tap == NULL) { if (tap == NULL) {
return ERROR_TARGET_INVALID; return ERROR_TARGET_INVALID;
@ -56,7 +56,7 @@ int str9xpec_set_instr(jtag_tap_t *tap, uint32_t new_instr, tap_state_t end_stat
return ERROR_OK; return ERROR_OK;
} }
static uint8_t str9xpec_isc_status(jtag_tap_t *tap) static uint8_t str9xpec_isc_status(struct jtag_tap *tap)
{ {
scan_field_t field; scan_field_t field;
uint8_t status; uint8_t status;
@ -84,7 +84,7 @@ static uint8_t str9xpec_isc_status(jtag_tap_t *tap)
static int str9xpec_isc_enable(struct flash_bank_s *bank) static int str9xpec_isc_enable(struct flash_bank_s *bank)
{ {
uint8_t status; uint8_t status;
jtag_tap_t *tap; struct jtag_tap *tap;
str9xpec_flash_controller_t *str9xpec_info = bank->driver_priv; str9xpec_flash_controller_t *str9xpec_info = bank->driver_priv;
tap = str9xpec_info->tap; tap = str9xpec_info->tap;
@ -111,7 +111,7 @@ static int str9xpec_isc_enable(struct flash_bank_s *bank)
static int str9xpec_isc_disable(struct flash_bank_s *bank) static int str9xpec_isc_disable(struct flash_bank_s *bank)
{ {
uint8_t status; uint8_t status;
jtag_tap_t *tap; struct jtag_tap *tap;
str9xpec_flash_controller_t *str9xpec_info = bank->driver_priv; str9xpec_flash_controller_t *str9xpec_info = bank->driver_priv;
tap = str9xpec_info->tap; tap = str9xpec_info->tap;
@ -141,7 +141,7 @@ static int str9xpec_read_config(struct flash_bank_s *bank)
{ {
scan_field_t field; scan_field_t field;
uint8_t status; uint8_t status;
jtag_tap_t *tap; struct jtag_tap *tap;
str9xpec_flash_controller_t *str9xpec_info = bank->driver_priv; str9xpec_flash_controller_t *str9xpec_info = bank->driver_priv;
@ -273,7 +273,7 @@ static int str9xpec_blank_check(struct flash_bank_s *bank, int first, int last)
{ {
scan_field_t field; scan_field_t field;
uint8_t status; uint8_t status;
jtag_tap_t *tap; struct jtag_tap *tap;
int i; int i;
uint8_t *buffer = NULL; uint8_t *buffer = NULL;
@ -362,7 +362,7 @@ static int str9xpec_erase_area(struct flash_bank_s *bank, int first, int last)
{ {
scan_field_t field; scan_field_t field;
uint8_t status; uint8_t status;
jtag_tap_t *tap; struct jtag_tap *tap;
int i; int i;
uint8_t *buffer = NULL; uint8_t *buffer = NULL;
@ -444,7 +444,7 @@ static int str9xpec_lock_device(struct flash_bank_s *bank)
{ {
scan_field_t field; scan_field_t field;
uint8_t status; uint8_t status;
jtag_tap_t *tap; struct jtag_tap *tap;
str9xpec_flash_controller_t *str9xpec_info = NULL; str9xpec_flash_controller_t *str9xpec_info = NULL;
str9xpec_info = bank->driver_priv; str9xpec_info = bank->driver_priv;
@ -539,7 +539,7 @@ static int str9xpec_protect(struct flash_bank_s *bank, int set, int first, int l
static int str9xpec_set_address(struct flash_bank_s *bank, uint8_t sector) static int str9xpec_set_address(struct flash_bank_s *bank, uint8_t sector)
{ {
jtag_tap_t *tap; struct jtag_tap *tap;
scan_field_t field; scan_field_t field;
str9xpec_flash_controller_t *str9xpec_info = bank->driver_priv; str9xpec_flash_controller_t *str9xpec_info = bank->driver_priv;
@ -566,7 +566,7 @@ static int str9xpec_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t o
uint32_t bytes_written = 0; uint32_t bytes_written = 0;
uint8_t status; uint8_t status;
uint32_t check_address = offset; uint32_t check_address = offset;
jtag_tap_t *tap; struct jtag_tap *tap;
scan_field_t field; scan_field_t field;
uint8_t *scanbuf; uint8_t *scanbuf;
int i; int i;
@ -730,7 +730,7 @@ COMMAND_HANDLER(str9xpec_handle_part_id_command)
{ {
scan_field_t field; scan_field_t field;
uint8_t *buffer = NULL; uint8_t *buffer = NULL;
jtag_tap_t *tap; struct jtag_tap *tap;
uint32_t idcode; uint32_t idcode;
str9xpec_flash_controller_t *str9xpec_info = NULL; str9xpec_flash_controller_t *str9xpec_info = NULL;
@ -837,7 +837,7 @@ static int str9xpec_write_options(struct flash_bank_s *bank)
{ {
scan_field_t field; scan_field_t field;
uint8_t status; uint8_t status;
jtag_tap_t *tap; struct jtag_tap *tap;
str9xpec_flash_controller_t *str9xpec_info = NULL; str9xpec_flash_controller_t *str9xpec_info = NULL;
str9xpec_info = bank->driver_priv; str9xpec_info = bank->driver_priv;
@ -1081,9 +1081,9 @@ COMMAND_HANDLER(str9xpec_handle_flash_unlock_command)
COMMAND_HANDLER(str9xpec_handle_flash_enable_turbo_command) COMMAND_HANDLER(str9xpec_handle_flash_enable_turbo_command)
{ {
jtag_tap_t *tap0; struct jtag_tap *tap0;
jtag_tap_t *tap1; struct jtag_tap *tap1;
jtag_tap_t *tap2; struct jtag_tap *tap2;
str9xpec_flash_controller_t *str9xpec_info = NULL; str9xpec_flash_controller_t *str9xpec_info = NULL;
if (argc < 1) if (argc < 1)
@ -1130,7 +1130,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_enable_turbo_command)
COMMAND_HANDLER(str9xpec_handle_flash_disable_turbo_command) COMMAND_HANDLER(str9xpec_handle_flash_disable_turbo_command)
{ {
jtag_tap_t *tap; struct jtag_tap *tap;
str9xpec_flash_controller_t *str9xpec_info = NULL; str9xpec_flash_controller_t *str9xpec_info = NULL;
if (argc < 1) if (argc < 1)

View File

@ -28,7 +28,7 @@
typedef struct str9xpec_flash_controller_s typedef struct str9xpec_flash_controller_s
{ {
jtag_tap_t *tap; struct jtag_tap *tap;
uint32_t *sector_bits; uint32_t *sector_bits;
int chain_pos; int chain_pos;
int isc_enable; int isc_enable;

View File

@ -33,8 +33,6 @@
#include <inttypes.h> #include <inttypes.h>
#endif #endif
typedef struct jtag_tap_s jtag_tap_t;
#ifdef HAVE_STDBOOL_H #ifdef HAVE_STDBOOL_H
#include <stdbool.h> #include <stdbool.h>
#else /* HAVE_STDBOOL_H */ #else /* HAVE_STDBOOL_H */

View File

@ -78,7 +78,7 @@ static int jtag_srst = -1;
/** /**
* List all TAPs that have been created. * List all TAPs that have been created.
*/ */
static jtag_tap_t *__jtag_all_taps = NULL; static struct jtag_tap *__jtag_all_taps = NULL;
/** /**
* The number of TAPs in the __jtag_all_taps list, used to track the * The number of TAPs in the __jtag_all_taps list, used to track the
* assigned chain position to new TAPs * assigned chain position to new TAPs
@ -164,7 +164,7 @@ void jtag_poll_set_enabled(bool value)
/************/ /************/
jtag_tap_t *jtag_all_taps(void) struct jtag_tap *jtag_all_taps(void)
{ {
return __jtag_all_taps; return __jtag_all_taps;
}; };
@ -176,7 +176,7 @@ unsigned jtag_tap_count(void)
unsigned jtag_tap_count_enabled(void) unsigned jtag_tap_count_enabled(void)
{ {
jtag_tap_t *t = jtag_all_taps(); struct jtag_tap *t = jtag_all_taps();
unsigned n = 0; unsigned n = 0;
while (t) while (t)
{ {
@ -188,20 +188,20 @@ unsigned jtag_tap_count_enabled(void)
} }
/// Append a new TAP to the chain of all taps. /// Append a new TAP to the chain of all taps.
void jtag_tap_add(struct jtag_tap_s *t) void jtag_tap_add(struct jtag_tap *t)
{ {
t->abs_chain_position = jtag_num_taps++; t->abs_chain_position = jtag_num_taps++;
jtag_tap_t **tap = &__jtag_all_taps; struct jtag_tap **tap = &__jtag_all_taps;
while (*tap != NULL) while (*tap != NULL)
tap = &(*tap)->next_tap; tap = &(*tap)->next_tap;
*tap = t; *tap = t;
} }
/* returns a pointer to the n-th device in the scan chain */ /* returns a pointer to the n-th device in the scan chain */
static inline jtag_tap_t *jtag_tap_by_position(unsigned n) static inline struct jtag_tap *jtag_tap_by_position(unsigned n)
{ {
jtag_tap_t *t = jtag_all_taps(); struct jtag_tap *t = jtag_all_taps();
while (t && n-- > 0) while (t && n-- > 0)
t = t->next_tap; t = t->next_tap;
@ -209,10 +209,10 @@ static inline jtag_tap_t *jtag_tap_by_position(unsigned n)
return t; return t;
} }
jtag_tap_t *jtag_tap_by_string(const char *s) struct jtag_tap *jtag_tap_by_string(const char *s)
{ {
/* try by name first */ /* try by name first */
jtag_tap_t *t = jtag_all_taps(); struct jtag_tap *t = jtag_all_taps();
while (t) while (t)
{ {
@ -238,10 +238,10 @@ jtag_tap_t *jtag_tap_by_string(const char *s)
return t; return t;
} }
jtag_tap_t *jtag_tap_by_jim_obj(Jim_Interp *interp, Jim_Obj *o) struct jtag_tap *jtag_tap_by_jim_obj(Jim_Interp *interp, Jim_Obj *o)
{ {
const char *cp = Jim_GetString(o, NULL); const char *cp = Jim_GetString(o, NULL);
jtag_tap_t *t = cp ? jtag_tap_by_string(cp) : NULL; struct jtag_tap *t = cp ? jtag_tap_by_string(cp) : NULL;
if (NULL == cp) if (NULL == cp)
cp = "(unknown)"; cp = "(unknown)";
if (NULL == t) if (NULL == t)
@ -249,7 +249,7 @@ jtag_tap_t *jtag_tap_by_jim_obj(Jim_Interp *interp, Jim_Obj *o)
return t; return t;
} }
jtag_tap_t* jtag_tap_next_enabled(jtag_tap_t* p) struct jtag_tap* jtag_tap_next_enabled(struct jtag_tap* p)
{ {
p = p ? p->next_tap : jtag_all_taps(); p = p ? p->next_tap : jtag_all_taps();
while (p) while (p)
@ -261,7 +261,7 @@ jtag_tap_t* jtag_tap_next_enabled(jtag_tap_t* p)
return NULL; return NULL;
} }
const char *jtag_tap_name(const jtag_tap_t *tap) const char *jtag_tap_name(const struct jtag_tap *tap)
{ {
return (tap == NULL) ? "(unknown)" : tap->dotted_name; return (tap == NULL) ? "(unknown)" : tap->dotted_name;
} }
@ -496,7 +496,7 @@ void jtag_add_plain_dr_scan(int in_num_fields, const scan_field_t *in_fields,
jtag_set_error(retval); jtag_set_error(retval);
} }
void jtag_add_dr_out(jtag_tap_t* tap, void jtag_add_dr_out(struct jtag_tap* tap,
int num_fields, const int* num_bits, const uint32_t* value, int num_fields, const int* num_bits, const uint32_t* value,
tap_state_t end_state) tap_state_t end_state)
{ {
@ -856,7 +856,7 @@ int jtag_execute_queue(void)
static int jtag_reset_callback(enum jtag_event event, void *priv) static int jtag_reset_callback(enum jtag_event event, void *priv)
{ {
jtag_tap_t *tap = priv; struct jtag_tap *tap = priv;
if (event == JTAG_TRST_ASSERTED) if (event == JTAG_TRST_ASSERTED)
{ {
@ -989,7 +989,7 @@ static bool jtag_examine_chain_end(uint8_t *idcodes, unsigned count, unsigned ma
return triggered; return triggered;
} }
static bool jtag_examine_chain_match_tap(const struct jtag_tap_s *tap) static bool jtag_examine_chain_match_tap(const struct jtag_tap *tap)
{ {
/* ignore expected BYPASS codes; warn otherwise */ /* ignore expected BYPASS codes; warn otherwise */
if (0 == tap->expected_ids_cnt && !tap->idcode) if (0 == tap->expected_ids_cnt && !tap->idcode)
@ -1044,7 +1044,7 @@ static int jtag_examine_chain(void)
return ERROR_JTAG_INIT_FAILED; return ERROR_JTAG_INIT_FAILED;
/* point at the 1st tap */ /* point at the 1st tap */
jtag_tap_t *tap = jtag_tap_next_enabled(NULL); struct jtag_tap *tap = jtag_tap_next_enabled(NULL);
if (!tap) if (!tap)
autoprobe = true; autoprobe = true;
@ -1168,7 +1168,7 @@ static int jtag_examine_chain(void)
*/ */
static int jtag_validate_ircapture(void) static int jtag_validate_ircapture(void)
{ {
jtag_tap_t *tap; struct jtag_tap *tap;
int total_ir_length = 0; int total_ir_length = 0;
uint8_t *ir_test = NULL; uint8_t *ir_test = NULL;
scan_field_t field; scan_field_t field;
@ -1280,7 +1280,7 @@ done:
} }
void jtag_tap_init(jtag_tap_t *tap) void jtag_tap_init(struct jtag_tap *tap)
{ {
unsigned ir_len_bits; unsigned ir_len_bits;
unsigned ir_len_bytes; unsigned ir_len_bytes;
@ -1315,7 +1315,7 @@ void jtag_tap_init(jtag_tap_t *tap)
jtag_tap_add(tap); jtag_tap_add(tap);
} }
void jtag_tap_free(jtag_tap_t *tap) void jtag_tap_free(struct jtag_tap *tap)
{ {
jtag_unregister_event_callback(&jtag_reset_callback, tap); jtag_unregister_event_callback(&jtag_reset_callback, tap);
@ -1371,7 +1371,7 @@ int jtag_interface_init(struct command_context_s *cmd_ctx)
int jtag_init_inner(struct command_context_s *cmd_ctx) int jtag_init_inner(struct command_context_s *cmd_ctx)
{ {
jtag_tap_t *tap; struct jtag_tap *tap;
int retval; int retval;
bool issue_setup = true; bool issue_setup = true;

View File

@ -96,7 +96,7 @@ int interface_jtag_add_ir_scan(int in_num_fields, const scan_field_t *in_fields,
/* loop over all enabled TAPs */ /* loop over all enabled TAPs */
for (jtag_tap_t * tap = jtag_tap_next_enabled(NULL); tap != NULL; tap = jtag_tap_next_enabled(tap)) for (struct jtag_tap * tap = jtag_tap_next_enabled(NULL); tap != NULL; tap = jtag_tap_next_enabled(tap))
{ {
/* search the input field list for fields for the current TAP */ /* search the input field list for fields for the current TAP */
@ -182,7 +182,7 @@ int interface_jtag_add_dr_scan(int in_num_fields, const scan_field_t *in_fields,
size_t bypass_devices = 0; size_t bypass_devices = 0;
for (jtag_tap_t * tap = jtag_tap_next_enabled(NULL); tap != NULL; tap = jtag_tap_next_enabled(tap)) for (struct jtag_tap * tap = jtag_tap_next_enabled(NULL); tap != NULL; tap = jtag_tap_next_enabled(tap))
{ {
if (tap->bypass) if (tap->bypass)
bypass_devices++; bypass_devices++;
@ -207,7 +207,7 @@ int interface_jtag_add_dr_scan(int in_num_fields, const scan_field_t *in_fields,
/* loop over all enabled TAPs */ /* loop over all enabled TAPs */
for (jtag_tap_t * tap = jtag_tap_next_enabled(NULL); tap != NULL; tap = jtag_tap_next_enabled(tap)) for (struct jtag_tap * tap = jtag_tap_next_enabled(NULL); tap != NULL; tap = jtag_tap_next_enabled(tap))
{ {
/* if TAP is not bypassed insert matching input fields */ /* if TAP is not bypassed insert matching input fields */
@ -261,7 +261,7 @@ int interface_jtag_add_dr_scan(int in_num_fields, const scan_field_t *in_fields,
* The bypass status of TAPs is set by jtag_add_ir_scan(). * The bypass status of TAPs is set by jtag_add_ir_scan().
* *
*/ */
void interface_jtag_add_dr_out(jtag_tap_t *target_tap, void interface_jtag_add_dr_out(struct jtag_tap *target_tap,
int in_num_fields, int in_num_fields,
const int *num_bits, const int *num_bits,
const uint32_t *value, const uint32_t *value,
@ -271,7 +271,7 @@ void interface_jtag_add_dr_out(jtag_tap_t *target_tap,
size_t bypass_devices = 0; size_t bypass_devices = 0;
for (jtag_tap_t * tap = jtag_tap_next_enabled(NULL); tap != NULL; tap = jtag_tap_next_enabled(tap)) for (struct jtag_tap * tap = jtag_tap_next_enabled(NULL); tap != NULL; tap = jtag_tap_next_enabled(tap))
{ {
if (tap->bypass) if (tap->bypass)
bypass_devices++; bypass_devices++;
@ -299,7 +299,7 @@ void interface_jtag_add_dr_out(jtag_tap_t *target_tap,
/* loop over all enabled TAPs */ /* loop over all enabled TAPs */
for (jtag_tap_t * tap = jtag_tap_next_enabled(NULL); tap != NULL; tap = jtag_tap_next_enabled(tap)) for (struct jtag_tap * tap = jtag_tap_next_enabled(NULL); tap != NULL; tap = jtag_tap_next_enabled(tap))
{ {
/* if TAP is not bypassed insert matching input fields */ /* if TAP is not bypassed insert matching input fields */

View File

@ -26,7 +26,6 @@
#include "binarybuffer.h" #include "binarybuffer.h"
#include "log.h" #include "log.h"
#ifdef _DEBUG_JTAG_IO_ #ifdef _DEBUG_JTAG_IO_
#define DEBUG_JTAG_IO(expr ...) \ #define DEBUG_JTAG_IO(expr ...) \
do { if (1) LOG_DEBUG(expr); } while (0) do { if (1) LOG_DEBUG(expr); } while (0)
@ -123,7 +122,7 @@ extern tap_state_t cmd_queue_cur_state;
typedef struct scan_field_s typedef struct scan_field_s
{ {
/// A pointer to the tap structure to which this field refers. /// A pointer to the tap structure to which this field refers.
jtag_tap_t* tap; struct jtag_tap* tap;
/// The number of bits this field specifies (up to 32) /// The number of bits this field specifies (up to 32)
int num_bits; int num_bits;
@ -147,11 +146,7 @@ typedef struct scan_field_s
typedef struct jtag_tap_event_action_s jtag_tap_event_action_t; typedef struct jtag_tap_event_action_s jtag_tap_event_action_t;
/* this is really: typedef jtag_tap_t */ struct jtag_tap {
/* But - the typedef is done in "types.h" */
/* due to "forward declaration reasons" */
struct jtag_tap_s
{
const char* chip; const char* chip;
const char* tapname; const char* tapname;
const char* dotted_name; const char* dotted_name;
@ -182,17 +177,17 @@ struct jtag_tap_s
jtag_tap_event_action_t *event_action; jtag_tap_event_action_t *event_action;
jtag_tap_t* next_tap; struct jtag_tap* next_tap;
}; };
void jtag_tap_init(jtag_tap_t *tap); void jtag_tap_init(struct jtag_tap *tap);
void jtag_tap_free(jtag_tap_t *tap); void jtag_tap_free(struct jtag_tap *tap);
jtag_tap_t* jtag_all_taps(void); struct jtag_tap* jtag_all_taps(void);
const char *jtag_tap_name(const jtag_tap_t *tap); const char *jtag_tap_name(const struct jtag_tap *tap);
jtag_tap_t* jtag_tap_by_string(const char* dotted_name); struct jtag_tap* jtag_tap_by_string(const char* dotted_name);
jtag_tap_t* jtag_tap_by_jim_obj(Jim_Interp* interp, Jim_Obj* obj); struct jtag_tap* jtag_tap_by_jim_obj(Jim_Interp* interp, Jim_Obj* obj);
jtag_tap_t* jtag_tap_next_enabled(jtag_tap_t* p); struct jtag_tap* jtag_tap_next_enabled(struct jtag_tap* p);
unsigned jtag_tap_count_enabled(void); unsigned jtag_tap_count_enabled(void);
unsigned jtag_tap_count(void); unsigned jtag_tap_count(void);
@ -702,7 +697,7 @@ void jtag_sleep(uint32_t us);
* There is no jtag_add_dr_outin() version of this fn that also allows * There is no jtag_add_dr_outin() version of this fn that also allows
* clocking data back in. Patches gladly accepted! * clocking data back in. Patches gladly accepted!
*/ */
void jtag_add_dr_out(jtag_tap_t* tap, void jtag_add_dr_out(struct jtag_tap* tap,
int num_fields, const int* num_bits, const uint32_t* value, int num_fields, const int* num_bits, const uint32_t* value,
tap_state_t end_state); tap_state_t end_state);

View File

@ -81,7 +81,7 @@ static inline void interface_jtag_add_scan_check_alloc(scan_field_t *field)
field->in_value = (uint8_t *)cmd_queue_alloc(num_bytes); field->in_value = (uint8_t *)cmd_queue_alloc(num_bytes);
} }
void interface_jtag_add_dr_out(jtag_tap_t* tap, void interface_jtag_add_dr_out(struct jtag_tap* tap,
int num_fields, const int* num_bits, const uint32_t* value, int num_fields, const int* num_bits, const uint32_t* value,
tap_state_t end_state); tap_state_t end_state);

View File

@ -20,7 +20,7 @@
static __inline__ void interface_jtag_add_dr_out_core(jtag_tap_t *target_tap, static __inline__ void interface_jtag_add_dr_out_core(struct jtag_tap *target_tap,
int num_fields, int num_fields,
const int *num_bits, const int *num_bits,
const uint32_t *value, const uint32_t *value,
@ -29,7 +29,7 @@ static __inline__ void interface_jtag_add_dr_out_core(jtag_tap_t *target_tap,
/* synchronously do the operation here */ /* synchronously do the operation here */
} }
static __inline__ void interface_jtag_add_dr_out(jtag_tap_t *target_tap, static __inline__ void interface_jtag_add_dr_out(struct jtag_tap *target_tap,
int num_fields, int num_fields,
const int *num_bits, const int *num_bits,
const uint32_t *value, const uint32_t *value,

View File

@ -172,7 +172,7 @@ int interface_jtag_add_pathmove(int num_states, const tap_state_t *path)
void embeddedice_write_dcc(jtag_tap_t *tap, int reg_addr, uint8_t *buffer, int little, int count) void embeddedice_write_dcc(struct jtag_tap *tap, int reg_addr, uint8_t *buffer, int little, int count)
{ {
int i; int i;
for (i = 0; i < count; i++) for (i = 0; i < count; i++)

View File

@ -61,7 +61,7 @@ static Jim_Nvp nvp_config_opts[] = {
{ .name = NULL, .value = -1 } { .name = NULL, .value = -1 }
}; };
static int jtag_tap_configure_cmd(Jim_GetOptInfo *goi, jtag_tap_t * tap) static int jtag_tap_configure_cmd(Jim_GetOptInfo *goi, struct jtag_tap * tap)
{ {
Jim_Nvp *n; Jim_Nvp *n;
Jim_Obj *o; Jim_Obj *o;
@ -165,7 +165,7 @@ static int is_bad_irval(int ir_length, jim_wide w)
static int jim_newtap_cmd(Jim_GetOptInfo *goi) static int jim_newtap_cmd(Jim_GetOptInfo *goi)
{ {
jtag_tap_t *pTap; struct jtag_tap *pTap;
jim_wide w; jim_wide w;
int x; int x;
int e; int e;
@ -187,7 +187,7 @@ static int jim_newtap_cmd(Jim_GetOptInfo *goi)
{ .name = NULL , .value = -1 }, { .name = NULL , .value = -1 },
}; };
pTap = calloc(1, sizeof(jtag_tap_t)); pTap = calloc(1, sizeof(struct jtag_tap));
if (!pTap) { if (!pTap) {
Jim_SetResult_sprintf(goi->interp, "no memory"); Jim_SetResult_sprintf(goi->interp, "no memory");
return JIM_ERR; return JIM_ERR;
@ -335,7 +335,7 @@ static int jim_newtap_cmd(Jim_GetOptInfo *goi)
return JIM_ERR; return JIM_ERR;
} }
static void jtag_tap_handle_event(jtag_tap_t *tap, enum jtag_event e) static void jtag_tap_handle_event(struct jtag_tap *tap, enum jtag_event e)
{ {
jtag_tap_event_action_t * jteap; jtag_tap_event_action_t * jteap;
@ -459,7 +459,7 @@ static int jim_jtag_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
} }
{ {
jtag_tap_t *t; struct jtag_tap *t;
t = jtag_tap_by_jim_obj(goi.interp, goi.argv[0]); t = jtag_tap_by_jim_obj(goi.interp, goi.argv[0]);
if (t == NULL) if (t == NULL)
@ -511,7 +511,7 @@ static int jim_jtag_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
} }
{ {
jtag_tap_t *t; struct jtag_tap *t;
Jim_GetOpt_Obj(&goi, &o); Jim_GetOpt_Obj(&goi, &o);
t = jtag_tap_by_jim_obj(goi.interp, o); t = jtag_tap_by_jim_obj(goi.interp, o);
@ -532,7 +532,7 @@ static int jim_jtag_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
} }
{ {
jtag_tap_t *t; struct jtag_tap *t;
Jim_GetOpt_Obj(&goi, &o); Jim_GetOpt_Obj(&goi, &o);
t = jtag_tap_by_jim_obj(goi.interp, o); t = jtag_tap_by_jim_obj(goi.interp, o);
@ -552,7 +552,7 @@ static int jim_jtag_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
} }
Jim_SetResult(goi.interp, Jim_NewListObj(goi.interp, NULL, 0)); Jim_SetResult(goi.interp, Jim_NewListObj(goi.interp, NULL, 0));
{ {
jtag_tap_t *tap; struct jtag_tap *tap;
for (tap = jtag_all_taps(); tap; tap = tap->next_tap) { for (tap = jtag_all_taps(); tap; tap = tap->next_tap) {
Jim_ListAppendElement(goi.interp, Jim_ListAppendElement(goi.interp,
@ -572,7 +572,7 @@ static int jim_jtag_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
void jtag_notify_event(enum jtag_event event) void jtag_notify_event(enum jtag_event event)
{ {
jtag_tap_t *tap; struct jtag_tap *tap;
for (tap = jtag_all_taps(); tap; tap = tap->next_tap) for (tap = jtag_all_taps(); tap; tap = tap->next_tap)
jtag_tap_handle_event(tap, event); jtag_tap_handle_event(tap, event);
@ -664,7 +664,7 @@ COMMAND_HANDLER(handle_interface_command)
COMMAND_HANDLER(handle_scan_chain_command) COMMAND_HANDLER(handle_scan_chain_command)
{ {
jtag_tap_t *tap; struct jtag_tap *tap;
tap = jtag_all_taps(); tap = jtag_all_taps();
command_print(cmd_ctx, " TapName | Enabled | IdCode Expected IrLen IrCap IrMask Instr "); command_print(cmd_ctx, " TapName | Enabled | IdCode Expected IrLen IrCap IrMask Instr ");
@ -1079,7 +1079,7 @@ COMMAND_HANDLER(handle_irscan_command)
{ {
int i; int i;
scan_field_t *fields; scan_field_t *fields;
jtag_tap_t *tap; struct jtag_tap *tap;
tap_state_t endstate; tap_state_t endstate;
if ((argc < 2) || (argc % 2)) if ((argc < 2) || (argc % 2))
@ -1163,7 +1163,7 @@ static int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *args
int num_fields; int num_fields;
int field_count = 0; int field_count = 0;
int i, e; int i, e;
jtag_tap_t *tap; struct jtag_tap *tap;
tap_state_t endstate; tap_state_t endstate;
/* args[1] = device /* args[1] = device

View File

@ -148,7 +148,7 @@ static __inline__ void shiftValueInner(const enum tap_state state, const enum ta
static __inline__ void interface_jtag_add_dr_out_core(jtag_tap_t *target_tap, static __inline__ void interface_jtag_add_dr_out_core(struct jtag_tap *target_tap,
int num_fields, int num_fields,
const int *num_bits, const int *num_bits,
const uint32_t *value, const uint32_t *value,
@ -156,7 +156,7 @@ static __inline__ void interface_jtag_add_dr_out_core(jtag_tap_t *target_tap,
{ {
enum tap_state pause_state = TAP_DRSHIFT; enum tap_state pause_state = TAP_DRSHIFT;
jtag_tap_t *tap, *nextTap; struct jtag_tap *tap, *nextTap;
for (tap = jtag_tap_next_enabled(NULL); tap!= NULL; tap = nextTap) for (tap = jtag_tap_next_enabled(NULL); tap!= NULL; tap = nextTap)
{ {
nextTap = jtag_tap_next_enabled(tap); nextTap = jtag_tap_next_enabled(tap);
@ -180,7 +180,7 @@ static __inline__ void interface_jtag_add_dr_out_core(jtag_tap_t *target_tap,
} }
} }
static __inline__ void interface_jtag_add_dr_out(jtag_tap_t *target_tap, static __inline__ void interface_jtag_add_dr_out(struct jtag_tap *target_tap,
int num_fields, int num_fields,
const int *num_bits, const int *num_bits,
const uint32_t *value, const uint32_t *value,

View File

@ -537,7 +537,7 @@ int interface_jtag_add_ir_scan(int num_fields, const scan_field_t *fields, tap_s
int j; int j;
int scan_size = 0; int scan_size = 0;
jtag_tap_t *tap, *nextTap; struct jtag_tap *tap, *nextTap;
for (tap = jtag_tap_next_enabled(NULL); tap!= NULL; tap = nextTap) for (tap = jtag_tap_next_enabled(NULL); tap!= NULL; tap = nextTap)
{ {
nextTap = jtag_tap_next_enabled(tap); nextTap = jtag_tap_next_enabled(tap);
@ -601,7 +601,7 @@ int interface_jtag_add_dr_scan(int num_fields, const scan_field_t *fields, tap_s
{ {
int j; int j;
jtag_tap_t *tap, *nextTap; struct jtag_tap *tap, *nextTap;
for (tap = jtag_tap_next_enabled(NULL); tap!= NULL; tap = nextTap) for (tap = jtag_tap_next_enabled(NULL); tap!= NULL; tap = nextTap)
{ {
nextTap = jtag_tap_next_enabled(tap); nextTap = jtag_tap_next_enabled(tap);
@ -759,7 +759,7 @@ int interface_jtag_add_pathmove(int num_states, const tap_state_t *path)
void embeddedice_write_dcc(jtag_tap_t *tap, int reg_addr, uint8_t *buffer, int little, int count) void embeddedice_write_dcc(struct jtag_tap *tap, int reg_addr, uint8_t *buffer, int little, int count)
{ {
// static int const reg_addr = 0x5; // static int const reg_addr = 0x5;
tap_state_t end_state = jtag_get_end_state(); tap_state_t end_state = jtag_get_end_state();

View File

@ -26,7 +26,7 @@
#include "pld.h" #include "pld.h"
static int virtex2_set_instr(jtag_tap_t *tap, uint32_t new_instr) static int virtex2_set_instr(struct jtag_tap *tap, uint32_t new_instr)
{ {
if (tap == NULL) if (tap == NULL)
return ERROR_FAIL; return ERROR_FAIL;
@ -209,7 +209,7 @@ COMMAND_HANDLER(virtex2_handle_read_stat_command)
PLD_DEVICE_COMMAND_HANDLER(virtex2_pld_device_command) PLD_DEVICE_COMMAND_HANDLER(virtex2_pld_device_command)
{ {
jtag_tap_t *tap; struct jtag_tap *tap;
virtex2_pld_device_t *virtex2_info; virtex2_pld_device_t *virtex2_info;

View File

@ -24,7 +24,7 @@
typedef struct virtex2_pld_device_s typedef struct virtex2_pld_device_s
{ {
jtag_tap_t *tap; struct jtag_tap *tap;
} virtex2_pld_device_t; } virtex2_pld_device_t;
#endif /* VIRTEX2_H */ #endif /* VIRTEX2_H */

View File

@ -216,7 +216,7 @@ static char *svf_command_buffer = NULL;
static int svf_command_buffer_size = 0; static int svf_command_buffer_size = 0;
static int svf_line_number = 1; static int svf_line_number = 1;
static jtag_tap_t *tap = NULL; static struct jtag_tap *tap = NULL;
#define SVF_MAX_BUFFER_SIZE_TO_COMMIT (4 * 1024) #define SVF_MAX_BUFFER_SIZE_TO_COMMIT (4 * 1024)
static uint8_t *svf_tdi_buffer = NULL, *svf_tdo_buffer = NULL, *svf_mask_buffer = NULL; static uint8_t *svf_tdi_buffer = NULL, *svf_tdo_buffer = NULL, *svf_mask_buffer = NULL;

View File

@ -2066,7 +2066,7 @@ static const uint32_t arm11_coproc_instruction_limits[] =
static arm11_common_t * arm11_find_target(const char * arg) static arm11_common_t * arm11_find_target(const char * arg)
{ {
jtag_tap_t * tap; struct jtag_tap * tap;
target_t * t; target_t * t;
tap = jtag_tap_by_string(arg); tap = jtag_tap_by_string(arg);

View File

@ -100,7 +100,7 @@ void arm11_setup_field(arm11_common_t * arm11, int num_bits, void * out_data, vo
*/ */
void arm11_add_IR(arm11_common_t * arm11, uint8_t instr, tap_state_t state) void arm11_add_IR(arm11_common_t * arm11, uint8_t instr, tap_state_t state)
{ {
jtag_tap_t *tap; struct jtag_tap *tap;
tap = arm11->target->tap; tap = arm11->target->tap;
if (buf_get_u32(tap->cur_instr, 0, 5) == instr) if (buf_get_u32(tap->cur_instr, 0, 5) == instr)

View File

@ -377,7 +377,7 @@ static int arm720t_init_target(struct command_context_s *cmd_ctx, struct target_
} }
static int arm720t_init_arch_info(target_t *target, static int arm720t_init_arch_info(target_t *target,
arm720t_common_t *arm720t, jtag_tap_t *tap) arm720t_common_t *arm720t, struct jtag_tap *tap)
{ {
arm7tdmi_common_t *arm7tdmi = &arm720t->arm7tdmi_common; arm7tdmi_common_t *arm7tdmi = &arm720t->arm7tdmi_common;
arm7_9_common_t *arm7_9 = &arm7tdmi->arm7_9_common; arm7_9_common_t *arm7_9 = &arm7tdmi->arm7_9_common;

View File

@ -2611,7 +2611,7 @@ static int arm7_9_dcc_completion(struct target_s *target, uint32_t exit_point, i
embeddedice_reg_t *ice_reg = arm7_9->eice_cache->reg_list[EICE_COMMS_DATA].arch_info; embeddedice_reg_t *ice_reg = arm7_9->eice_cache->reg_list[EICE_COMMS_DATA].arch_info;
uint8_t reg_addr = ice_reg->addr & 0x1f; uint8_t reg_addr = ice_reg->addr & 0x1f;
jtag_tap_t *tap; struct jtag_tap *tap;
tap = ice_reg->jtag_info->tap; tap = ice_reg->jtag_info->tap;
embeddedice_write_dcc(tap, reg_addr, buffer, little, count-2); embeddedice_write_dcc(tap, reg_addr, buffer, little, count-2);

View File

@ -691,7 +691,7 @@ int arm7tdmi_init_target(struct command_context_s *cmd_ctx, struct target_s *tar
return ERROR_OK; return ERROR_OK;
} }
int arm7tdmi_init_arch_info(target_t *target, arm7tdmi_common_t *arm7tdmi, jtag_tap_t *tap) int arm7tdmi_init_arch_info(target_t *target, arm7tdmi_common_t *arm7tdmi, struct jtag_tap *tap)
{ {
struct arm7_9_common_s *arm7_9 = &arm7tdmi->arm7_9_common; struct arm7_9_common_s *arm7_9 = &arm7tdmi->arm7_9_common;

View File

@ -33,7 +33,7 @@ typedef struct arm7tdmi_common_s
arm7_9_common_t arm7_9_common; arm7_9_common_t arm7_9_common;
} arm7tdmi_common_t; } arm7tdmi_common_t;
int arm7tdmi_init_arch_info(target_t *target, arm7tdmi_common_t *arm7tdmi, jtag_tap_t *tap); int arm7tdmi_init_arch_info(target_t *target, arm7tdmi_common_t *arm7tdmi, struct jtag_tap *tap);
int arm7tdmi_init_target(struct command_context_s *cmd_ctx, struct target_s *target); int arm7tdmi_init_target(struct command_context_s *cmd_ctx, struct target_s *target);
int arm7tdmi_examine(struct target_s *target); int arm7tdmi_examine(struct target_s *target);

View File

@ -620,7 +620,7 @@ int arm920t_soft_reset_halt(struct target_s *target)
return ERROR_OK; return ERROR_OK;
} }
int arm920t_init_arch_info(target_t *target, arm920t_common_t *arm920t, jtag_tap_t *tap) int arm920t_init_arch_info(target_t *target, arm920t_common_t *arm920t, struct jtag_tap *tap)
{ {
arm9tdmi_common_t *arm9tdmi = &arm920t->arm9tdmi_common; arm9tdmi_common_t *arm9tdmi = &arm920t->arm9tdmi_common;
arm7_9_common_t *arm7_9 = &arm9tdmi->arm7_9_common; arm7_9_common_t *arm7_9 = &arm9tdmi->arm7_9_common;

View File

@ -667,7 +667,7 @@ static int arm926ejs_read_phys_memory(struct target_s *target,
} }
int arm926ejs_init_arch_info(target_t *target, arm926ejs_common_t *arm926ejs, int arm926ejs_init_arch_info(target_t *target, arm926ejs_common_t *arm926ejs,
jtag_tap_t *tap) struct jtag_tap *tap)
{ {
arm9tdmi_common_t *arm9tdmi = &arm926ejs->arm9tdmi_common; arm9tdmi_common_t *arm9tdmi = &arm926ejs->arm9tdmi_common;
arm7_9_common_t *arm7_9 = &arm9tdmi->arm7_9_common; arm7_9_common_t *arm7_9 = &arm9tdmi->arm7_9_common;

View File

@ -47,7 +47,7 @@ target_to_arm926(struct target_s *target)
int arm926ejs_init_arch_info(target_t *target, int arm926ejs_init_arch_info(target_t *target,
arm926ejs_common_t *arm926ejs, jtag_tap_t *tap); arm926ejs_common_t *arm926ejs, struct jtag_tap *tap);
int arm926ejs_register_commands(struct command_context_s *cmd_ctx); int arm926ejs_register_commands(struct command_context_s *cmd_ctx);
int arm926ejs_arch_state(struct target_s *target); int arm926ejs_arch_state(struct target_s *target);
int arm926ejs_write_memory(struct target_s *target, int arm926ejs_write_memory(struct target_s *target,

View File

@ -32,7 +32,7 @@
#define _DEBUG_INSTRUCTION_EXECUTION_ #define _DEBUG_INSTRUCTION_EXECUTION_
#endif #endif
int arm966e_init_arch_info(target_t *target, arm966e_common_t *arm966e, jtag_tap_t *tap) int arm966e_init_arch_info(target_t *target, arm966e_common_t *arm966e, struct jtag_tap *tap)
{ {
arm9tdmi_common_t *arm9tdmi = &arm966e->arm9tdmi_common; arm9tdmi_common_t *arm9tdmi = &arm966e->arm9tdmi_common;
arm7_9_common_t *arm7_9 = &arm9tdmi->arm7_9_common; arm7_9_common_t *arm7_9 = &arm9tdmi->arm7_9_common;

View File

@ -42,7 +42,7 @@ target_to_arm966(struct target_s *target)
} }
int arm966e_init_arch_info(target_t *target, int arm966e_init_arch_info(target_t *target,
arm966e_common_t *arm966e, jtag_tap_t *tap); arm966e_common_t *arm966e, struct jtag_tap *tap);
int arm966e_register_commands(struct command_context_s *cmd_ctx); int arm966e_register_commands(struct command_context_s *cmd_ctx);
int arm966e_write_cp15(target_t *target, int reg_addr, uint32_t value); int arm966e_write_cp15(target_t *target, int reg_addr, uint32_t value);

View File

@ -786,7 +786,7 @@ int arm9tdmi_init_target(struct command_context_s *cmd_ctx,
return ERROR_OK; return ERROR_OK;
} }
int arm9tdmi_init_arch_info(target_t *target, arm9tdmi_common_t *arm9tdmi, jtag_tap_t *tap) int arm9tdmi_init_arch_info(target_t *target, arm9tdmi_common_t *arm9tdmi, struct jtag_tap *tap)
{ {
armv4_5_common_t *armv4_5; armv4_5_common_t *armv4_5;
arm7_9_common_t *arm7_9; arm7_9_common_t *arm7_9;

View File

@ -55,7 +55,7 @@ int arm9tdmi_init_target(struct command_context_s *cmd_ctx,
struct target_s *target); struct target_s *target);
int arm9tdmi_examine(struct target_s *target); int arm9tdmi_examine(struct target_s *target);
int arm9tdmi_init_arch_info(target_t *target, int arm9tdmi_init_arch_info(target_t *target,
arm9tdmi_common_t *arm9tdmi, jtag_tap_t *tap); arm9tdmi_common_t *arm9tdmi, struct jtag_tap *tap);
int arm9tdmi_register_commands(struct command_context_s *cmd_ctx); int arm9tdmi_register_commands(struct command_context_s *cmd_ctx);
int arm9tdmi_clock_out(arm_jtag_t *jtag_info, int arm9tdmi_clock_out(arm_jtag_t *jtag_info,

View File

@ -33,7 +33,7 @@
int arm_jtag_set_instr(arm_jtag_t *jtag_info, uint32_t new_instr, void *no_verify_capture) int arm_jtag_set_instr(arm_jtag_t *jtag_info, uint32_t new_instr, void *no_verify_capture)
{ {
jtag_tap_t *tap; struct jtag_tap *tap;
tap = jtag_info->tap; tap = jtag_info->tap;
if (tap == NULL) if (tap == NULL)
return ERROR_FAIL; return ERROR_FAIL;

View File

@ -27,7 +27,7 @@
typedef struct arm_jtag_s typedef struct arm_jtag_s
{ {
jtag_tap_t *tap; struct jtag_tap *tap;
uint32_t scann_size; uint32_t scann_size;
uint32_t scann_instr; uint32_t scann_instr;

View File

@ -46,17 +46,17 @@ int avr_deassert_reset(target_t *target);
int avr_soft_reset_halt(struct target_s *target); int avr_soft_reset_halt(struct target_s *target);
/* IR and DR functions */ /* IR and DR functions */
int avr_jtag_sendinstr(jtag_tap_t *tap, uint8_t *ir_in, uint8_t ir_out); int avr_jtag_sendinstr(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out);
int avr_jtag_senddat(jtag_tap_t *tap, uint32_t *dr_in, uint32_t dr_out, int len); int avr_jtag_senddat(struct jtag_tap *tap, uint32_t *dr_in, uint32_t dr_out, int len);
int mcu_write_ir(jtag_tap_t *tap, uint8_t *ir_in, uint8_t *ir_out, int ir_len, int rti); int mcu_write_ir(struct jtag_tap *tap, uint8_t *ir_in, uint8_t *ir_out, int ir_len, int rti);
int mcu_write_dr(jtag_tap_t *tap, uint8_t *dr_in, uint8_t *dr_out, int dr_len, int rti); int mcu_write_dr(struct jtag_tap *tap, uint8_t *dr_in, uint8_t *dr_out, int dr_len, int rti);
int mcu_write_ir_u8(jtag_tap_t *tap, uint8_t *ir_in, uint8_t ir_out, int ir_len, int rti); int mcu_write_ir_u8(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out, int ir_len, int rti);
int mcu_write_dr_u8(jtag_tap_t *tap, uint8_t *ir_in, uint8_t ir_out, int dr_len, int rti); int mcu_write_dr_u8(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out, int dr_len, int rti);
int mcu_write_ir_u16(jtag_tap_t *tap, uint16_t *ir_in, uint16_t ir_out, int ir_len, int rti); int mcu_write_ir_u16(struct jtag_tap *tap, uint16_t *ir_in, uint16_t ir_out, int ir_len, int rti);
int mcu_write_dr_u16(jtag_tap_t *tap, uint16_t *ir_in, uint16_t ir_out, int dr_len, int rti); int mcu_write_dr_u16(struct jtag_tap *tap, uint16_t *ir_in, uint16_t ir_out, int dr_len, int rti);
int mcu_write_ir_u32(jtag_tap_t *tap, uint32_t *ir_in, uint32_t ir_out, int ir_len, int rti); int mcu_write_ir_u32(struct jtag_tap *tap, uint32_t *ir_in, uint32_t ir_out, int ir_len, int rti);
int mcu_write_dr_u32(jtag_tap_t *tap, uint32_t *ir_in, uint32_t ir_out, int dr_len, int rti); int mcu_write_dr_u32(struct jtag_tap *tap, uint32_t *ir_in, uint32_t ir_out, int dr_len, int rti);
int mcu_execute_queue(void); int mcu_execute_queue(void);
target_type_t avr_target = target_type_t avr_target =
@ -175,18 +175,18 @@ int avr_soft_reset_halt(struct target_s *target)
return ERROR_OK; return ERROR_OK;
} }
int avr_jtag_senddat(jtag_tap_t *tap, uint32_t* dr_in, uint32_t dr_out, int len) int avr_jtag_senddat(struct jtag_tap *tap, uint32_t* dr_in, uint32_t dr_out, int len)
{ {
return mcu_write_dr_u32(tap, dr_in, dr_out, len, 1); return mcu_write_dr_u32(tap, dr_in, dr_out, len, 1);
} }
int avr_jtag_sendinstr(jtag_tap_t *tap, uint8_t *ir_in, uint8_t ir_out) int avr_jtag_sendinstr(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out)
{ {
return mcu_write_ir_u8(tap, ir_in, ir_out, AVR_JTAG_INS_LEN, 1); return mcu_write_ir_u8(tap, ir_in, ir_out, AVR_JTAG_INS_LEN, 1);
} }
/* IR and DR functions */ /* IR and DR functions */
int mcu_write_ir(jtag_tap_t *tap, uint8_t *ir_in, uint8_t *ir_out, int ir_len, int rti) int mcu_write_ir(struct jtag_tap *tap, uint8_t *ir_in, uint8_t *ir_out, int ir_len, int rti)
{ {
if (NULL == tap) if (NULL == tap)
{ {
@ -212,7 +212,7 @@ int mcu_write_ir(jtag_tap_t *tap, uint8_t *ir_in, uint8_t *ir_out, int ir_len, i
return ERROR_OK; return ERROR_OK;
} }
int mcu_write_dr(jtag_tap_t *tap, uint8_t *dr_in, uint8_t *dr_out, int dr_len, int rti) int mcu_write_dr(struct jtag_tap *tap, uint8_t *dr_in, uint8_t *dr_out, int dr_len, int rti)
{ {
if (NULL == tap) if (NULL == tap)
{ {
@ -233,7 +233,7 @@ int mcu_write_dr(jtag_tap_t *tap, uint8_t *dr_in, uint8_t *dr_out, int dr_len, i
return ERROR_OK; return ERROR_OK;
} }
int mcu_write_ir_u8(jtag_tap_t *tap, uint8_t *ir_in, uint8_t ir_out, int ir_len, int rti) int mcu_write_ir_u8(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out, int ir_len, int rti)
{ {
if (ir_len > 8) if (ir_len > 8)
{ {
@ -246,7 +246,7 @@ int mcu_write_ir_u8(jtag_tap_t *tap, uint8_t *ir_in, uint8_t ir_out, int ir_len,
return ERROR_OK; return ERROR_OK;
} }
int mcu_write_dr_u8(jtag_tap_t *tap, uint8_t *dr_in, uint8_t dr_out, int dr_len, int rti) int mcu_write_dr_u8(struct jtag_tap *tap, uint8_t *dr_in, uint8_t dr_out, int dr_len, int rti)
{ {
if (dr_len > 8) if (dr_len > 8)
{ {
@ -259,7 +259,7 @@ int mcu_write_dr_u8(jtag_tap_t *tap, uint8_t *dr_in, uint8_t dr_out, int dr_len,
return ERROR_OK; return ERROR_OK;
} }
int mcu_write_ir_u16(jtag_tap_t *tap, uint16_t *ir_in, uint16_t ir_out, int ir_len, int rti) int mcu_write_ir_u16(struct jtag_tap *tap, uint16_t *ir_in, uint16_t ir_out, int ir_len, int rti)
{ {
if (ir_len > 16) if (ir_len > 16)
{ {
@ -272,7 +272,7 @@ int mcu_write_ir_u16(jtag_tap_t *tap, uint16_t *ir_in, uint16_t ir_out, int ir_l
return ERROR_OK; return ERROR_OK;
} }
int mcu_write_dr_u16(jtag_tap_t *tap, uint16_t *dr_in, uint16_t dr_out, int dr_len, int rti) int mcu_write_dr_u16(struct jtag_tap *tap, uint16_t *dr_in, uint16_t dr_out, int dr_len, int rti)
{ {
if (dr_len > 16) if (dr_len > 16)
{ {
@ -285,7 +285,7 @@ int mcu_write_dr_u16(jtag_tap_t *tap, uint16_t *dr_in, uint16_t dr_out, int dr_l
return ERROR_OK; return ERROR_OK;
} }
int mcu_write_ir_u32(jtag_tap_t *tap, uint32_t *ir_in, uint32_t ir_out, int ir_len, int rti) int mcu_write_ir_u32(struct jtag_tap *tap, uint32_t *ir_in, uint32_t ir_out, int ir_len, int rti)
{ {
if (ir_len > 32) if (ir_len > 32)
{ {
@ -298,7 +298,7 @@ int mcu_write_ir_u32(jtag_tap_t *tap, uint32_t *ir_in, uint32_t ir_out, int ir_l
return ERROR_OK; return ERROR_OK;
} }
int mcu_write_dr_u32(jtag_tap_t *tap, uint32_t *dr_in, uint32_t dr_out, int dr_len, int rti) int mcu_write_dr_u32(struct jtag_tap *tap, uint32_t *dr_in, uint32_t dr_out, int dr_len, int rti)
{ {
if (dr_len > 32) if (dr_len > 32)
{ {

View File

@ -24,7 +24,7 @@
typedef struct mcu_jtag_s typedef struct mcu_jtag_s
{ {
jtag_tap_t *tap; struct jtag_tap *tap;
} mcu_jtag_t; } mcu_jtag_t;
typedef struct avr_common_s typedef struct avr_common_s

View File

@ -1451,7 +1451,7 @@ static int cortex_a8_init_target(struct command_context_s *cmd_ctx,
} }
int cortex_a8_init_arch_info(target_t *target, int cortex_a8_init_arch_info(target_t *target,
cortex_a8_common_t *cortex_a8, jtag_tap_t *tap) cortex_a8_common_t *cortex_a8, struct jtag_tap *tap)
{ {
armv4_5_common_t *armv4_5; armv4_5_common_t *armv4_5;
armv7a_common_t *armv7a; armv7a_common_t *armv7a;

View File

@ -144,6 +144,6 @@ target_to_cortex_a8(struct target_s *target)
} }
int cortex_a8_init_arch_info(target_t *target, int cortex_a8_init_arch_info(target_t *target,
cortex_a8_common_t *cortex_a8, jtag_tap_t *tap); cortex_a8_common_t *cortex_a8, struct jtag_tap *tap);
#endif /* CORTEX_A8_H */ #endif /* CORTEX_A8_H */

View File

@ -1708,7 +1708,7 @@ static int cortex_m3_handle_target_request(void *priv)
} }
static int cortex_m3_init_arch_info(target_t *target, static int cortex_m3_init_arch_info(target_t *target,
cortex_m3_common_t *cortex_m3, jtag_tap_t *tap) cortex_m3_common_t *cortex_m3, struct jtag_tap *tap)
{ {
int retval; int retval;
struct armv7m_common_s *armv7m = &cortex_m3->armv7m; struct armv7m_common_s *armv7m = &cortex_m3->armv7m;

View File

@ -622,7 +622,7 @@ int embeddedice_handshake(arm_jtag_t *jtag_info, int hsbit, uint32_t timeout)
/** /**
* This is an inner loop of the open loop DCC write of data to target * This is an inner loop of the open loop DCC write of data to target
*/ */
void embeddedice_write_dcc(jtag_tap_t *tap, void embeddedice_write_dcc(struct jtag_tap *tap,
int reg_addr, uint8_t *buffer, int little, int count) int reg_addr, uint8_t *buffer, int little, int count)
{ {
int i; int i;

View File

@ -116,7 +116,7 @@ int embeddedice_handshake(arm_jtag_t *jtag_info, int hsbit, uint32_t timeout);
/* If many embeddedice_write_reg() follow eachother, then the >1 invocations can be this faster version of /* If many embeddedice_write_reg() follow eachother, then the >1 invocations can be this faster version of
* embeddedice_write_reg * embeddedice_write_reg
*/ */
static __inline__ void embeddedice_write_reg_inner(jtag_tap_t *tap, int reg_addr, uint32_t value) static __inline__ void embeddedice_write_reg_inner(struct jtag_tap *tap, int reg_addr, uint32_t value)
{ {
static const int embeddedice_num_bits[]={32,5,1}; static const int embeddedice_num_bits[]={32,5,1};
uint32_t values[3]; uint32_t values[3];
@ -132,6 +132,6 @@ static __inline__ void embeddedice_write_reg_inner(jtag_tap_t *tap, int reg_addr
jtag_get_end_state()); jtag_get_end_state());
} }
void embeddedice_write_dcc(jtag_tap_t *tap, int reg_addr, uint8_t *buffer, int little, int count); void embeddedice_write_dcc(struct jtag_tap *tap, int reg_addr, uint8_t *buffer, int little, int count);
#endif /* EMBEDDED_ICE_H */ #endif /* EMBEDDED_ICE_H */

View File

@ -44,7 +44,7 @@ static int etb_get_reg(reg_t *reg);
static int etb_set_instr(etb_t *etb, uint32_t new_instr) static int etb_set_instr(etb_t *etb, uint32_t new_instr)
{ {
jtag_tap_t *tap; struct jtag_tap *tap;
tap = etb->tap; tap = etb->tap;
if (tap == NULL) if (tap == NULL)
@ -352,7 +352,7 @@ static int etb_write_reg(reg_t *reg, uint32_t value)
COMMAND_HANDLER(handle_etb_config_command) COMMAND_HANDLER(handle_etb_config_command)
{ {
target_t *target; target_t *target;
jtag_tap_t *tap; struct jtag_tap *tap;
struct arm *arm; struct arm *arm;
if (argc != 2) if (argc != 2)

View File

@ -37,7 +37,7 @@ enum
typedef struct etb_s typedef struct etb_s
{ {
etm_context_t *etm_ctx; etm_context_t *etm_ctx;
jtag_tap_t *tap; struct jtag_tap *tap;
uint32_t cur_scan_chain; uint32_t cur_scan_chain;
reg_cache_t *reg_cache; reg_cache_t *reg_cache;

View File

@ -256,7 +256,7 @@ static void fa526_branch_resume_thumb(target_t *target)
} }
static int fa526_init_arch_info_2(target_t *target, static int fa526_init_arch_info_2(target_t *target,
arm9tdmi_common_t *arm9tdmi, jtag_tap_t *tap) arm9tdmi_common_t *arm9tdmi, struct jtag_tap *tap)
{ {
arm7_9_common_t *arm7_9; arm7_9_common_t *arm7_9;
@ -315,7 +315,7 @@ static int fa526_init_arch_info_2(target_t *target,
} }
static int fa526_init_arch_info(target_t *target, static int fa526_init_arch_info(target_t *target,
arm920t_common_t *arm920t, jtag_tap_t *tap) arm920t_common_t *arm920t, struct jtag_tap *tap)
{ {
arm9tdmi_common_t *arm9tdmi = &arm920t->arm9tdmi_common; arm9tdmi_common_t *arm9tdmi = &arm920t->arm9tdmi_common;
arm7_9_common_t *arm7_9 = &arm9tdmi->arm7_9_common; arm7_9_common_t *arm7_9 = &arm9tdmi->arm7_9_common;

View File

@ -315,7 +315,7 @@ reg_cache_t *mips32_build_reg_cache(target_t *target)
return cache; return cache;
} }
int mips32_init_arch_info(target_t *target, mips32_common_t *mips32, jtag_tap_t *tap) int mips32_init_arch_info(target_t *target, mips32_common_t *mips32, struct jtag_tap *tap)
{ {
target->arch_info = mips32; target->arch_info = mips32;
mips32->common_magic = MIPS32_COMMON_MAGIC; mips32->common_magic = MIPS32_COMMON_MAGIC;

View File

@ -127,7 +127,7 @@ typedef struct mips32_core_reg_s
int mips32_arch_state(struct target_s *target); int mips32_arch_state(struct target_s *target);
int mips32_init_arch_info(target_t *target, int mips32_init_arch_info(target_t *target,
mips32_common_t *mips32, jtag_tap_t *tap); mips32_common_t *mips32, struct jtag_tap *tap);
int mips32_restore_context(target_t *target); int mips32_restore_context(target_t *target);
int mips32_save_context(target_t *target); int mips32_save_context(target_t *target);

View File

@ -29,7 +29,7 @@
int mips_ejtag_set_instr(mips_ejtag_t *ejtag_info, int new_instr, void *delete_me_and_submit_patch) int mips_ejtag_set_instr(mips_ejtag_t *ejtag_info, int new_instr, void *delete_me_and_submit_patch)
{ {
jtag_tap_t *tap; struct jtag_tap *tap;
tap = ejtag_info->tap; tap = ejtag_info->tap;
if (tap == NULL) if (tap == NULL)
@ -100,7 +100,7 @@ int mips_ejtag_get_impcode(mips_ejtag_t *ejtag_info, uint32_t *impcode)
int mips_ejtag_drscan_32(mips_ejtag_t *ejtag_info, uint32_t *data) int mips_ejtag_drscan_32(mips_ejtag_t *ejtag_info, uint32_t *data)
{ {
jtag_tap_t *tap; struct jtag_tap *tap;
tap = ejtag_info->tap; tap = ejtag_info->tap;
if (tap == NULL) if (tap == NULL)

View File

@ -104,7 +104,7 @@
typedef struct mips_ejtag_s typedef struct mips_ejtag_s
{ {
jtag_tap_t *tap; struct jtag_tap *tap;
uint32_t impcode; uint32_t impcode;
uint32_t idcode; uint32_t idcode;
/*int use_dma;*/ /*int use_dma;*/

View File

@ -917,7 +917,7 @@ int mips_m4k_init_target(struct command_context_s *cmd_ctx, struct target_s *tar
return ERROR_OK; return ERROR_OK;
} }
int mips_m4k_init_arch_info(target_t *target, mips_m4k_common_t *mips_m4k, jtag_tap_t *tap) int mips_m4k_init_arch_info(target_t *target, mips_m4k_common_t *mips_m4k, struct jtag_tap *tap)
{ {
mips32_common_t *mips32 = &mips_m4k->mips32_common; mips32_common_t *mips32 = &mips_m4k->mips32_common;

View File

@ -3785,7 +3785,7 @@ static int target_configure(Jim_GetOptInfo *goi, target_t *target)
case TCFG_CHAIN_POSITION: case TCFG_CHAIN_POSITION:
if (goi->isconfigure) { if (goi->isconfigure) {
Jim_Obj *o; Jim_Obj *o;
jtag_tap_t *tap; struct jtag_tap *tap;
target_free_all_working_areas(target); target_free_all_working_areas(target);
e = Jim_GetOpt_Obj(goi, &o); e = Jim_GetOpt_Obj(goi, &o);
if (e != JIM_OK) { if (e != JIM_OK) {

View File

@ -136,7 +136,7 @@ typedef struct target_s
target_type_t *type; /* target type definition (name, access functions) */ target_type_t *type; /* target type definition (name, access functions) */
const char *cmd_name; /* tcl Name of target */ const char *cmd_name; /* tcl Name of target */
int target_number; /* DO NOT USE! field to be removed in 2010 */ int target_number; /* DO NOT USE! field to be removed in 2010 */
jtag_tap_t *tap; /* where on the jtag chain is this */ struct jtag_tap *tap; /* where on the jtag chain is this */
const char *variant; /* what varient of this chip is it? */ const char *variant; /* what varient of this chip is it? */
target_event_action_t *event_action; target_event_action_t *event_action;

View File

@ -156,7 +156,7 @@ static int xscale_verify_pointer(struct command_context_s *cmd_ctx,
return ERROR_OK; return ERROR_OK;
} }
static int xscale_jtag_set_instr(jtag_tap_t *tap, uint32_t new_instr) static int xscale_jtag_set_instr(struct jtag_tap *tap, uint32_t new_instr)
{ {
if (tap == NULL) if (tap == NULL)
return ERROR_FAIL; return ERROR_FAIL;
@ -2868,7 +2868,7 @@ static int xscale_init_target(struct command_context_s *cmd_ctx,
} }
static int xscale_init_arch_info(target_t *target, static int xscale_init_arch_info(target_t *target,
xscale_common_t *xscale, jtag_tap_t *tap, const char *variant) xscale_common_t *xscale, struct jtag_tap *tap, const char *variant)
{ {
armv4_5_common_t *armv4_5; armv4_5_common_t *armv4_5;
uint32_t high_reset_branch, low_reset_branch; uint32_t high_reset_branch, low_reset_branch;

View File

@ -217,7 +217,7 @@ COMMAND_HANDLER(handle_xsvf_command)
additional devices in the scan chain, otherwise the device additional devices in the scan chain, otherwise the device
that should be affected that should be affected
*/ */
jtag_tap_t *tap = NULL; struct jtag_tap *tap = NULL;
if (argc < 2) if (argc < 2)
{ {