forked from auracaster/openocd
jtag: drop useless typedef tap_state_t
No need to use a typedef for an enum. Drop it. Change-Id: I9eb2dc4f926671c5bb44e61453d92880e3036848 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8709 Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de>
This commit is contained in:
@@ -66,7 +66,7 @@ static void arc_jtag_enque_write_ir(struct arc_jtag *jtag_info, uint32_t
|
||||
* @param end_state End state after reading.
|
||||
*/
|
||||
static void arc_jtag_enque_read_dr(struct arc_jtag *jtag_info, uint8_t *data,
|
||||
tap_state_t end_state)
|
||||
enum tap_state end_state)
|
||||
{
|
||||
|
||||
assert(jtag_info);
|
||||
@@ -88,7 +88,7 @@ static void arc_jtag_enque_read_dr(struct arc_jtag *jtag_info, uint8_t *data,
|
||||
* @param end_state End state after writing.
|
||||
*/
|
||||
static void arc_jtag_enque_write_dr(struct arc_jtag *jtag_info, uint32_t data,
|
||||
tap_state_t end_state)
|
||||
enum tap_state end_state)
|
||||
{
|
||||
uint8_t out_value[sizeof(uint32_t)] = {0};
|
||||
|
||||
@@ -116,7 +116,7 @@ static void arc_jtag_enque_write_dr(struct arc_jtag *jtag_info, uint32_t data,
|
||||
* @param end_state End state after writing.
|
||||
*/
|
||||
static void arc_jtag_enque_set_transaction(struct arc_jtag *jtag_info,
|
||||
uint32_t new_trans, tap_state_t end_state)
|
||||
uint32_t new_trans, enum tap_state end_state)
|
||||
{
|
||||
uint8_t out_value[sizeof(uint32_t)] = {0};
|
||||
|
||||
|
||||
@@ -31,13 +31,13 @@ behavior of the FTDI driver IIRC was to go via RTI.
|
||||
Conversely there may be other places in this code where the ARM11 code relies
|
||||
on the driver to hit through RTI when coming from Update-?R.
|
||||
*/
|
||||
static const tap_state_t arm11_move_pi_to_si_via_ci[] = {
|
||||
static const enum tap_state arm11_move_pi_to_si_via_ci[] = {
|
||||
TAP_IREXIT2, TAP_IRUPDATE, TAP_DRSELECT, TAP_IRSELECT, TAP_IRCAPTURE, TAP_IRSHIFT
|
||||
};
|
||||
|
||||
/* REVISIT no error handling here! */
|
||||
static void arm11_add_ir_scan_vc(struct jtag_tap *tap, struct scan_field *fields,
|
||||
tap_state_t state)
|
||||
enum tap_state state)
|
||||
{
|
||||
if (cmd_queue_cur_state == TAP_IRPAUSE)
|
||||
jtag_add_pathmove(ARRAY_SIZE(arm11_move_pi_to_si_via_ci),
|
||||
@@ -46,13 +46,13 @@ static void arm11_add_ir_scan_vc(struct jtag_tap *tap, struct scan_field *fields
|
||||
jtag_add_ir_scan(tap, fields, state);
|
||||
}
|
||||
|
||||
static const tap_state_t arm11_move_pd_to_sd_via_cd[] = {
|
||||
static const enum tap_state arm11_move_pd_to_sd_via_cd[] = {
|
||||
TAP_DREXIT2, TAP_DRUPDATE, TAP_DRSELECT, TAP_DRCAPTURE, TAP_DRSHIFT
|
||||
};
|
||||
|
||||
/* REVISIT no error handling here! */
|
||||
void arm11_add_dr_scan_vc(struct jtag_tap *tap, int num_fields, struct scan_field *fields,
|
||||
tap_state_t state)
|
||||
enum tap_state state)
|
||||
{
|
||||
if (cmd_queue_cur_state == TAP_DRPAUSE)
|
||||
jtag_add_pathmove(ARRAY_SIZE(arm11_move_pd_to_sd_via_cd),
|
||||
@@ -121,7 +121,7 @@ static const char *arm11_ir_to_string(uint8_t ir)
|
||||
*
|
||||
* \remarks This adds to the JTAG command queue but does \em not execute it.
|
||||
*/
|
||||
void arm11_add_ir(struct arm11_common *arm11, uint8_t instr, tap_state_t state)
|
||||
void arm11_add_ir(struct arm11_common *arm11, uint8_t instr, enum tap_state state)
|
||||
{
|
||||
struct jtag_tap *tap = arm11->arm.target->tap;
|
||||
|
||||
@@ -181,7 +181,7 @@ static void arm11_in_handler_scan_n(uint8_t *in_value)
|
||||
*/
|
||||
|
||||
int arm11_add_debug_scan_n(struct arm11_common *arm11,
|
||||
uint8_t chain, tap_state_t state)
|
||||
uint8_t chain, enum tap_state state)
|
||||
{
|
||||
/* Don't needlessly switch the scan chain.
|
||||
* NOTE: the ITRSEL instruction fakes SCREG changing;
|
||||
@@ -240,7 +240,7 @@ int arm11_add_debug_scan_n(struct arm11_common *arm11,
|
||||
* to ensure that the rDTR is ready before that Run-Test/Idle state.
|
||||
*/
|
||||
static void arm11_add_debug_inst(struct arm11_common *arm11,
|
||||
uint32_t inst, uint8_t *flag, tap_state_t state)
|
||||
uint32_t inst, uint8_t *flag, enum tap_state state)
|
||||
{
|
||||
JTAG_DEBUG("INST <= 0x%08" PRIx32, inst);
|
||||
|
||||
@@ -542,7 +542,7 @@ int arm11_run_instr_data_to_core(struct arm11_common *arm11,
|
||||
* https://lists.berlios.de/pipermail/openocd-development/2009-July/009698.html
|
||||
* https://lists.berlios.de/pipermail/openocd-development/2009-August/009865.html
|
||||
*/
|
||||
static const tap_state_t arm11_move_drpause_idle_drpause_with_delay[] = {
|
||||
static const enum tap_state arm11_move_drpause_idle_drpause_with_delay[] = {
|
||||
TAP_DREXIT2, TAP_DRUPDATE, TAP_IDLE, TAP_IDLE, TAP_IDLE, TAP_DRSELECT, TAP_DRCAPTURE,
|
||||
TAP_DRSHIFT
|
||||
};
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
void arm11_setup_field(struct arm11_common *arm11, int num_bits,
|
||||
void *in_data, void *out_data, struct scan_field *field);
|
||||
void arm11_add_ir(struct arm11_common *arm11,
|
||||
uint8_t instr, tap_state_t state);
|
||||
uint8_t instr, enum tap_state state);
|
||||
int arm11_add_debug_scan_n(struct arm11_common *arm11,
|
||||
uint8_t chain, tap_state_t state);
|
||||
uint8_t chain, enum tap_state state);
|
||||
int arm11_read_dscr(struct arm11_common *arm11);
|
||||
int arm11_write_dscr(struct arm11_common *arm11, uint32_t dscr);
|
||||
|
||||
@@ -40,7 +40,7 @@ int arm11_run_instr_data_to_core_via_r0(struct arm11_common *arm11,
|
||||
uint32_t opcode, uint32_t data);
|
||||
|
||||
void arm11_add_dr_scan_vc(struct jtag_tap *tap, int num_fields, struct scan_field *fields,
|
||||
tap_state_t state);
|
||||
enum tap_state state);
|
||||
|
||||
/**
|
||||
* Used with arm11_sc7_run to make a list of read/write commands for
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#endif
|
||||
|
||||
int arm_jtag_set_instr_inner(struct jtag_tap *tap,
|
||||
uint32_t new_instr, void *no_verify_capture, tap_state_t end_state)
|
||||
uint32_t new_instr, void *no_verify_capture, enum tap_state end_state)
|
||||
{
|
||||
struct scan_field field;
|
||||
uint8_t t[4] = { 0 };
|
||||
@@ -41,7 +41,7 @@ int arm_jtag_set_instr_inner(struct jtag_tap *tap,
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int arm_jtag_scann_inner(struct arm_jtag *jtag_info, uint32_t new_scan_chain, tap_state_t end_state)
|
||||
int arm_jtag_scann_inner(struct arm_jtag *jtag_info, uint32_t new_scan_chain, enum tap_state end_state)
|
||||
{
|
||||
int retval = ERROR_OK;
|
||||
|
||||
|
||||
@@ -26,10 +26,10 @@ struct arm_jtag {
|
||||
|
||||
int arm_jtag_set_instr_inner(struct jtag_tap *tap, uint32_t new_instr,
|
||||
void *no_verify_capture,
|
||||
tap_state_t end_state);
|
||||
enum tap_state end_state);
|
||||
|
||||
static inline int arm_jtag_set_instr(struct jtag_tap *tap,
|
||||
uint32_t new_instr, void *no_verify_capture, tap_state_t end_state)
|
||||
uint32_t new_instr, void *no_verify_capture, enum tap_state end_state)
|
||||
{
|
||||
/* inline most common code path */
|
||||
if (buf_get_u32(tap->cur_instr, 0, tap->ir_length) != (new_instr & (BIT(tap->ir_length) - 1)))
|
||||
@@ -39,8 +39,8 @@ static inline int arm_jtag_set_instr(struct jtag_tap *tap,
|
||||
|
||||
}
|
||||
|
||||
int arm_jtag_scann_inner(struct arm_jtag *jtag_info, uint32_t new_scan_chain, tap_state_t end_state);
|
||||
static inline int arm_jtag_scann(struct arm_jtag *jtag_info, uint32_t new_scan_chain, tap_state_t end_state)
|
||||
int arm_jtag_scann_inner(struct arm_jtag *jtag_info, uint32_t new_scan_chain, enum tap_state end_state);
|
||||
static inline int arm_jtag_scann(struct arm_jtag *jtag_info, uint32_t new_scan_chain, enum tap_state end_state)
|
||||
{
|
||||
/* inline most common code path */
|
||||
int retval = ERROR_OK;
|
||||
|
||||
@@ -44,7 +44,7 @@ static int reset_jtag(void)
|
||||
{
|
||||
int retval;
|
||||
|
||||
tap_state_t states[2];
|
||||
enum tap_state states[2];
|
||||
|
||||
const char *cp = "RESET";
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ static int xscale_verify_pointer(struct command_invocation *cmd,
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int xscale_jtag_set_instr(struct jtag_tap *tap, uint32_t new_instr, tap_state_t end_state)
|
||||
static int xscale_jtag_set_instr(struct jtag_tap *tap, uint32_t new_instr, enum tap_state end_state)
|
||||
{
|
||||
assert(tap);
|
||||
|
||||
@@ -232,7 +232,7 @@ static int xscale_receive(struct target *target, uint32_t *buffer, int num_words
|
||||
|
||||
struct xscale_common *xscale = target_to_xscale(target);
|
||||
int retval = ERROR_OK;
|
||||
tap_state_t path[3];
|
||||
enum tap_state path[3];
|
||||
struct scan_field fields[3];
|
||||
uint8_t *field0 = malloc(num_words * 1);
|
||||
uint8_t field0_check_value = 0x2;
|
||||
@@ -330,8 +330,8 @@ static int xscale_receive(struct target *target, uint32_t *buffer, int num_words
|
||||
static int xscale_read_tx(struct target *target, int consume)
|
||||
{
|
||||
struct xscale_common *xscale = target_to_xscale(target);
|
||||
tap_state_t path[3];
|
||||
tap_state_t noconsume_path[6];
|
||||
enum tap_state path[3];
|
||||
enum tap_state noconsume_path[6];
|
||||
int retval;
|
||||
struct timeval timeout, now;
|
||||
struct scan_field fields[3];
|
||||
|
||||
@@ -60,7 +60,7 @@ static void xtensa_dm_add_dr_scan(struct xtensa_debug_module *dm,
|
||||
int len,
|
||||
const uint8_t *src,
|
||||
uint8_t *dest,
|
||||
tap_state_t endstate)
|
||||
enum tap_state endstate)
|
||||
{
|
||||
struct scan_field field;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user