mirror of
https://github.com/linux-msm/openocd.git
synced 2026-02-25 13:15:07 -08:00
Transform 'u8' to 'uint8_t'
- Replace '\([^_]\)u8' with '\1uint8_t'. - Replace '^u8' with 'uint8_t'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2276 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
@@ -48,7 +48,7 @@ const unsigned char bit_reverse_table256[] =
|
||||
};
|
||||
|
||||
|
||||
u8* buf_cpy(const u8 *from, u8 *to, int size)
|
||||
uint8_t* buf_cpy(const uint8_t *from, uint8_t *to, int size)
|
||||
{
|
||||
unsigned int num_bytes = CEIL(size, 8);
|
||||
unsigned int i;
|
||||
@@ -68,7 +68,7 @@ u8* buf_cpy(const u8 *from, u8 *to, int size)
|
||||
return to;
|
||||
}
|
||||
|
||||
int buf_cmp(const u8 *buf1, const u8 *buf2, int size)
|
||||
int buf_cmp(const uint8_t *buf1, const uint8_t *buf2, int size)
|
||||
{
|
||||
int num_bytes = CEIL(size, 8);
|
||||
int i;
|
||||
@@ -95,7 +95,7 @@ int buf_cmp(const u8 *buf1, const u8 *buf2, int size)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int buf_cmp_mask(const u8 *buf1, const u8 *buf2, const u8 *mask, int size)
|
||||
int buf_cmp_mask(const uint8_t *buf1, const uint8_t *buf2, const uint8_t *mask, int size)
|
||||
{
|
||||
int num_bytes = CEIL(size, 8);
|
||||
int i;
|
||||
@@ -120,7 +120,7 @@ int buf_cmp_mask(const u8 *buf1, const u8 *buf2, const u8 *mask, int size)
|
||||
return 0;
|
||||
}
|
||||
|
||||
u8* buf_set_ones(u8 *buf, int count)
|
||||
uint8_t* buf_set_ones(uint8_t *buf, int count)
|
||||
{
|
||||
int num_bytes = CEIL(count, 8);
|
||||
int i;
|
||||
@@ -138,7 +138,7 @@ u8* buf_set_ones(u8 *buf, int count)
|
||||
return buf;
|
||||
}
|
||||
|
||||
u8* buf_set_buf(const u8 *src, int src_start, u8 *dst, int dst_start, int len)
|
||||
uint8_t* buf_set_buf(const uint8_t *src, int src_start, uint8_t *dst, int dst_start, int len)
|
||||
{
|
||||
int src_idx = src_start, dst_idx = dst_start;
|
||||
int i;
|
||||
@@ -186,7 +186,7 @@ int ceil_f_to_u32(float x)
|
||||
return y;
|
||||
}
|
||||
|
||||
char* buf_to_str(const u8 *buf, int buf_len, int radix)
|
||||
char* buf_to_str(const uint8_t *buf, int buf_len, int radix)
|
||||
{
|
||||
const char *DIGITS = "0123456789ABCDEF";
|
||||
float factor;
|
||||
@@ -225,7 +225,7 @@ char* buf_to_str(const u8 *buf, int buf_len, int radix)
|
||||
for (j = str_len; j > 0; j--)
|
||||
{
|
||||
tmp += (u32)str[j-1] * 256;
|
||||
str[j-1] = (u8)(tmp % radix);
|
||||
str[j-1] = (uint8_t)(tmp % radix);
|
||||
tmp /= radix;
|
||||
}
|
||||
}
|
||||
@@ -236,12 +236,12 @@ char* buf_to_str(const u8 *buf, int buf_len, int radix)
|
||||
return str;
|
||||
}
|
||||
|
||||
int str_to_buf(const char *str, int str_len, u8 *buf, int buf_len, int radix)
|
||||
int str_to_buf(const char *str, int str_len, uint8_t *buf, int buf_len, int radix)
|
||||
{
|
||||
char *charbuf;
|
||||
u32 tmp;
|
||||
float factor;
|
||||
u8 *b256_buf;
|
||||
uint8_t *b256_buf;
|
||||
int b256_len;
|
||||
|
||||
int j; /* base-256 digits */
|
||||
@@ -304,7 +304,7 @@ int str_to_buf(const char *str, int str_len, u8 *buf, int buf_len, int radix)
|
||||
for (j = 0; j < b256_len; j++)
|
||||
{
|
||||
tmp += (u32)b256_buf[j] * radix;
|
||||
b256_buf[j] = (u8)(tmp & 0xFF);
|
||||
b256_buf[j] = (uint8_t)(tmp & 0xFF);
|
||||
tmp >>= 8;
|
||||
}
|
||||
|
||||
@@ -328,7 +328,7 @@ int str_to_buf(const char *str, int str_len, u8 *buf, int buf_len, int radix)
|
||||
return i;
|
||||
}
|
||||
|
||||
int buf_to_u32_handler(u8 *in_buf, void *priv, struct scan_field_s *field)
|
||||
int buf_to_u32_handler(uint8_t *in_buf, void *priv, struct scan_field_s *field)
|
||||
{
|
||||
u32 *dest = priv;
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
/* inlining this will help show what fn that is taking time during profiling. */
|
||||
static inline void buf_set_u32(u8* buffer, unsigned int first, unsigned int num, u32 value)
|
||||
static inline void buf_set_u32(uint8_t* buffer, unsigned int first, unsigned int num, u32 value)
|
||||
{
|
||||
if ((num==32)&&(first==0))
|
||||
{
|
||||
@@ -51,7 +51,7 @@ static inline void buf_set_u32(u8* buffer, unsigned int first, unsigned int num,
|
||||
}
|
||||
}
|
||||
}
|
||||
static inline u32 buf_get_u32(const u8* buffer, unsigned int first, unsigned int num)
|
||||
static inline u32 buf_get_u32(const uint8_t* buffer, unsigned int first, unsigned int num)
|
||||
{
|
||||
if ((num==32)&&(first==0))
|
||||
{
|
||||
@@ -73,23 +73,23 @@ static inline u32 buf_get_u32(const u8* buffer, unsigned int first, unsigned int
|
||||
|
||||
extern u32 flip_u32(u32 value, unsigned int num);
|
||||
|
||||
extern int buf_cmp(const u8 *buf1, const u8 *buf2, int size);
|
||||
extern int buf_cmp_mask(const u8 *buf1, const u8 *buf2, const u8 *mask, int size);
|
||||
extern u8* buf_cpy(const u8 *from, u8 *to, int size);
|
||||
extern int buf_cmp(const uint8_t *buf1, const uint8_t *buf2, int size);
|
||||
extern int buf_cmp_mask(const uint8_t *buf1, const uint8_t *buf2, const uint8_t *mask, int size);
|
||||
extern uint8_t* buf_cpy(const uint8_t *from, uint8_t *to, int size);
|
||||
|
||||
extern u8* buf_set_ones(u8 *buf, int count);
|
||||
extern u8* buf_set_buf(const u8 *src, int src_start, u8 *dst, int dst_start, int len);
|
||||
extern uint8_t* buf_set_ones(uint8_t *buf, int count);
|
||||
extern uint8_t* buf_set_buf(const uint8_t *src, int src_start, uint8_t *dst, int dst_start, int len);
|
||||
|
||||
extern int str_to_buf(const char *str, int len, u8 *bin_buf, int buf_size, int radix);
|
||||
extern char* buf_to_str(const u8 *buf, int size, int radix);
|
||||
extern int str_to_buf(const char *str, int len, uint8_t *bin_buf, int buf_size, int radix);
|
||||
extern char* buf_to_str(const uint8_t *buf, int size, int radix);
|
||||
|
||||
struct scan_field_s;
|
||||
extern int buf_to_u32_handler(u8 *in_buf, void *priv, struct scan_field_s *field);
|
||||
extern int buf_to_u32_handler(uint8_t *in_buf, void *priv, struct scan_field_s *field);
|
||||
|
||||
#define CEIL(m, n) ((m + n - 1) / n)
|
||||
|
||||
/* read a u32 from a buffer in target memory endianness */
|
||||
static inline u32 fast_target_buffer_get_u32(const u8 *buffer, int little)
|
||||
static inline u32 fast_target_buffer_get_u32(const uint8_t *buffer, int little)
|
||||
{
|
||||
if (little)
|
||||
return le_to_h_u32(buffer);
|
||||
|
||||
@@ -155,21 +155,21 @@ int fileio_seek(fileio_t *fileio, u32 position)
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static inline int fileio_local_read(fileio_t *fileio, u32 size, u8 *buffer, u32 *size_read)
|
||||
static inline int fileio_local_read(fileio_t *fileio, u32 size, uint8_t *buffer, u32 *size_read)
|
||||
{
|
||||
*size_read = fread(buffer, 1, size, fileio->file);
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int fileio_read(fileio_t *fileio, u32 size, u8 *buffer, u32 *size_read)
|
||||
int fileio_read(fileio_t *fileio, u32 size, uint8_t *buffer, u32 *size_read)
|
||||
{
|
||||
return fileio_local_read(fileio, size, buffer, size_read);
|
||||
}
|
||||
|
||||
int fileio_read_u32(fileio_t *fileio, u32 *data)
|
||||
{
|
||||
u8 buf[4];
|
||||
uint8_t buf[4];
|
||||
u32 size_read;
|
||||
int retval;
|
||||
|
||||
@@ -193,14 +193,14 @@ int fileio_fgets(fileio_t *fileio, u32 size, char *buffer)
|
||||
return fileio_local_fgets(fileio, size, buffer);
|
||||
}
|
||||
|
||||
static inline int fileio_local_write(fileio_t *fileio, u32 size, const u8 *buffer, u32 *size_written)
|
||||
static inline int fileio_local_write(fileio_t *fileio, u32 size, const uint8_t *buffer, u32 *size_written)
|
||||
{
|
||||
*size_written = fwrite(buffer, 1, size, fileio->file);
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int fileio_write(fileio_t *fileio, u32 size, const u8 *buffer, u32 *size_written)
|
||||
int fileio_write(fileio_t *fileio, u32 size, const uint8_t *buffer, u32 *size_written)
|
||||
{
|
||||
int retval;
|
||||
|
||||
@@ -214,7 +214,7 @@ int fileio_write(fileio_t *fileio, u32 size, const u8 *buffer, u32 *size_written
|
||||
|
||||
int fileio_write_u32(fileio_t *fileio, u32 data)
|
||||
{
|
||||
u8 buf[4];
|
||||
uint8_t buf[4];
|
||||
u32 size_written;
|
||||
int retval;
|
||||
|
||||
|
||||
@@ -54,8 +54,8 @@ typedef struct fileio_s
|
||||
FILE *file;
|
||||
} fileio_t;
|
||||
|
||||
extern int fileio_write(fileio_t *fileio, u32 size, const u8 *buffer, u32 *size_written);
|
||||
extern int fileio_read(fileio_t *fileio, u32 size, u8 *buffer, u32 *size_read);
|
||||
extern int fileio_write(fileio_t *fileio, u32 size, const uint8_t *buffer, u32 *size_written);
|
||||
extern int fileio_read(fileio_t *fileio, u32 size, uint8_t *buffer, u32 *size_read);
|
||||
extern int fileio_fgets(fileio_t *fileio, u32 size, char *buffer);
|
||||
extern int fileio_seek(fileio_t *fileio, u32 position);
|
||||
extern int fileio_close(fileio_t *fileio);
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#ifndef u8
|
||||
typedef unsigned char u8;
|
||||
#ifndef uint8_t
|
||||
typedef unsigned char uint8_t;
|
||||
#endif
|
||||
|
||||
#ifndef u16
|
||||
@@ -88,52 +88,52 @@ typedef bool _Bool;
|
||||
*/
|
||||
|
||||
|
||||
static inline u32 le_to_h_u32(const u8* buf)
|
||||
static inline u32 le_to_h_u32(const uint8_t* buf)
|
||||
{
|
||||
return (u32)(buf[0] | buf[1] << 8 | buf[2] << 16 | buf[3] << 24);
|
||||
}
|
||||
|
||||
static inline u16 le_to_h_u16(const u8* buf)
|
||||
static inline u16 le_to_h_u16(const uint8_t* buf)
|
||||
{
|
||||
return (u16)(buf[0] | buf[1] << 8);
|
||||
}
|
||||
|
||||
static inline u32 be_to_h_u32(const u8* buf)
|
||||
static inline u32 be_to_h_u32(const uint8_t* buf)
|
||||
{
|
||||
return (u32)(buf[3] | buf[2] << 8 | buf[1] << 16 | buf[0] << 24);
|
||||
}
|
||||
|
||||
static inline u16 be_to_h_u16(const u8* buf)
|
||||
static inline u16 be_to_h_u16(const uint8_t* buf)
|
||||
{
|
||||
return (u16)(buf[1] | buf[0] << 8);
|
||||
}
|
||||
|
||||
static inline void h_u32_to_le(u8* buf, int val)
|
||||
static inline void h_u32_to_le(uint8_t* buf, int val)
|
||||
{
|
||||
buf[3] = (u8) (val >> 24);
|
||||
buf[2] = (u8) (val >> 16);
|
||||
buf[1] = (u8) (val >> 8);
|
||||
buf[0] = (u8) (val >> 0);
|
||||
buf[3] = (uint8_t) (val >> 24);
|
||||
buf[2] = (uint8_t) (val >> 16);
|
||||
buf[1] = (uint8_t) (val >> 8);
|
||||
buf[0] = (uint8_t) (val >> 0);
|
||||
}
|
||||
|
||||
static inline void h_u32_to_be(u8* buf, int val)
|
||||
static inline void h_u32_to_be(uint8_t* buf, int val)
|
||||
{
|
||||
buf[0] = (u8) (val >> 24);
|
||||
buf[1] = (u8) (val >> 16);
|
||||
buf[2] = (u8) (val >> 8);
|
||||
buf[3] = (u8) (val >> 0);
|
||||
buf[0] = (uint8_t) (val >> 24);
|
||||
buf[1] = (uint8_t) (val >> 16);
|
||||
buf[2] = (uint8_t) (val >> 8);
|
||||
buf[3] = (uint8_t) (val >> 0);
|
||||
}
|
||||
|
||||
static inline void h_u16_to_le(u8* buf, int val)
|
||||
static inline void h_u16_to_le(uint8_t* buf, int val)
|
||||
{
|
||||
buf[1] = (u8) (val >> 8);
|
||||
buf[0] = (u8) (val >> 0);
|
||||
buf[1] = (uint8_t) (val >> 8);
|
||||
buf[0] = (uint8_t) (val >> 0);
|
||||
}
|
||||
|
||||
static inline void h_u16_to_be(u8* buf, int val)
|
||||
static inline void h_u16_to_be(uint8_t* buf, int val)
|
||||
{
|
||||
buf[0] = (u8) (val >> 8);
|
||||
buf[1] = (u8) (val >> 0);
|
||||
buf[0] = (uint8_t) (val >> 8);
|
||||
buf[1] = (uint8_t) (val >> 0);
|
||||
}
|
||||
|
||||
#ifdef __ECOS
|
||||
|
||||
@@ -46,9 +46,9 @@ static u16 amt_jtagaccel_port;
|
||||
|
||||
/* interface variables
|
||||
*/
|
||||
static u8 aw_control_rst = 0x00;
|
||||
static u8 aw_control_fsm = 0x10;
|
||||
static u8 aw_control_baudrate = 0x20;
|
||||
static uint8_t aw_control_rst = 0x00;
|
||||
static uint8_t aw_control_fsm = 0x10;
|
||||
static uint8_t aw_control_baudrate = 0x20;
|
||||
|
||||
static int rtck_enabled = 0;
|
||||
|
||||
@@ -89,7 +89,7 @@ static int amt_jtagaccel_handle_rtck_command(struct command_context_s *cmd_ctx,
|
||||
* 4: Shift-IR
|
||||
* 5: Pause-IR
|
||||
*/
|
||||
static u8 amt_jtagaccel_tap_move[6][6][2] =
|
||||
static uint8_t amt_jtagaccel_tap_move[6][6][2] =
|
||||
{
|
||||
/* RESET IDLE DRSHIFT DRPAUSE IRSHIFT IRPAUSE */
|
||||
{{0x1f, 0x00}, {0x0f, 0x00}, {0x8a, 0x04}, {0x0a, 0x00}, {0x06, 0x00}, {0x96, 0x00}}, /* RESET */
|
||||
@@ -161,7 +161,7 @@ static void amt_jtagaccel_end_state(tap_state_t state)
|
||||
static void amt_wait_scan_busy(void)
|
||||
{
|
||||
int timeout = 4096;
|
||||
u8 ar_status;
|
||||
uint8_t ar_status;
|
||||
|
||||
AMT_AR(ar_status);
|
||||
while (((ar_status) & 0x80) && (timeout-- > 0))
|
||||
@@ -176,8 +176,8 @@ static void amt_wait_scan_busy(void)
|
||||
|
||||
static void amt_jtagaccel_state_move(void)
|
||||
{
|
||||
u8 aw_scan_tms_5;
|
||||
u8 tms_scan[2];
|
||||
uint8_t aw_scan_tms_5;
|
||||
uint8_t tms_scan[2];
|
||||
|
||||
tap_state_t cur_state = tap_get_state();
|
||||
tap_state_t end_state = tap_get_end_state();
|
||||
@@ -205,8 +205,8 @@ static void amt_jtagaccel_state_move(void)
|
||||
static void amt_jtagaccel_runtest(int num_cycles)
|
||||
{
|
||||
int i = 0;
|
||||
u8 aw_scan_tms_5;
|
||||
u8 aw_scan_tms_1to4;
|
||||
uint8_t aw_scan_tms_5;
|
||||
uint8_t aw_scan_tms_1to4;
|
||||
|
||||
tap_state_t saved_end_state = tap_get_end_state();
|
||||
|
||||
@@ -235,16 +235,16 @@ static void amt_jtagaccel_runtest(int num_cycles)
|
||||
amt_jtagaccel_state_move();
|
||||
}
|
||||
|
||||
static void amt_jtagaccel_scan(bool ir_scan, enum scan_type type, u8 *buffer, int scan_size)
|
||||
static void amt_jtagaccel_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int scan_size)
|
||||
{
|
||||
int bits_left = scan_size;
|
||||
int bit_count = 0;
|
||||
tap_state_t saved_end_state = tap_get_end_state();
|
||||
u8 aw_tdi_option;
|
||||
u8 dw_tdi_scan;
|
||||
u8 dr_tdo;
|
||||
u8 aw_tms_scan;
|
||||
u8 tms_scan[2];
|
||||
uint8_t aw_tdi_option;
|
||||
uint8_t dw_tdi_scan;
|
||||
uint8_t dr_tdo;
|
||||
uint8_t aw_tms_scan;
|
||||
uint8_t tms_scan[2];
|
||||
int jtag_speed = jtag_get_speed();
|
||||
|
||||
if (ir_scan)
|
||||
@@ -323,7 +323,7 @@ static int amt_jtagaccel_execute_queue(void)
|
||||
jtag_command_t *cmd = jtag_command_queue; /* currently processed command */
|
||||
int scan_size;
|
||||
enum scan_type type;
|
||||
u8 *buffer;
|
||||
uint8_t *buffer;
|
||||
int retval;
|
||||
|
||||
/* return ERROR_OK, unless a jtag_read_buffer returns a failed check
|
||||
@@ -419,11 +419,11 @@ static int amt_jtagaccel_init(void)
|
||||
#if PARPORT_USE_PPDEV == 1
|
||||
char buffer[256];
|
||||
int i = 0;
|
||||
u8 control_port;
|
||||
uint8_t control_port;
|
||||
#else
|
||||
u8 status_port;
|
||||
uint8_t status_port;
|
||||
#endif
|
||||
u8 ar_status;
|
||||
uint8_t ar_status;
|
||||
|
||||
#if PARPORT_USE_PPDEV == 1
|
||||
if (device_handle > 0)
|
||||
|
||||
@@ -54,8 +54,8 @@
|
||||
#define CMD_TGPWR_SETUP 0x22
|
||||
|
||||
/* Global USB buffers */
|
||||
static u8 usb_in_buffer[ARMJTAGEW_IN_BUFFER_SIZE];
|
||||
static u8 usb_out_buffer[ARMJTAGEW_OUT_BUFFER_SIZE];
|
||||
static uint8_t usb_in_buffer[ARMJTAGEW_IN_BUFFER_SIZE];
|
||||
static uint8_t usb_out_buffer[ARMJTAGEW_OUT_BUFFER_SIZE];
|
||||
|
||||
/* External interface functions */
|
||||
static int armjtagew_execute_queue(void);
|
||||
@@ -73,9 +73,9 @@ static void armjtagew_end_state(tap_state_t state);
|
||||
static void armjtagew_state_move(void);
|
||||
static void armjtagew_path_move(int num_states, tap_state_t *path);
|
||||
static void armjtagew_runtest(int num_cycles);
|
||||
static void armjtagew_scan(bool ir_scan, enum scan_type type, u8 *buffer, int scan_size, scan_command_t *command);
|
||||
static void armjtagew_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int scan_size, scan_command_t *command);
|
||||
static void armjtagew_reset(int trst, int srst);
|
||||
//static void armjtagew_simple_command(u8 command);
|
||||
//static void armjtagew_simple_command(uint8_t command);
|
||||
static int armjtagew_get_status(void);
|
||||
|
||||
/* tap buffer functions */
|
||||
@@ -83,7 +83,7 @@ static void armjtagew_tap_init(void);
|
||||
static int armjtagew_tap_execute(void);
|
||||
static void armjtagew_tap_ensure_space(int scans, int bits);
|
||||
static void armjtagew_tap_append_step(int tms, int tdi);
|
||||
static void armjtagew_tap_append_scan(int length, u8 *buffer, scan_command_t *command);
|
||||
static void armjtagew_tap_append_scan(int length, uint8_t *buffer, scan_command_t *command);
|
||||
|
||||
/* ARM-JTAG-EW lowlevel functions */
|
||||
typedef struct armjtagew_jtag
|
||||
@@ -101,7 +101,7 @@ static int armjtagew_usb_read(armjtagew_jtag_t *armjtagew_jtag, int exp_in_lengt
|
||||
static int armjtagew_get_version_info(void);
|
||||
|
||||
#ifdef _DEBUG_USB_COMMS_
|
||||
static void armjtagew_debug_buffer(u8 *buffer, int length);
|
||||
static void armjtagew_debug_buffer(uint8_t *buffer, int length);
|
||||
#endif
|
||||
|
||||
static armjtagew_jtag_t* armjtagew_jtag_handle;
|
||||
@@ -128,7 +128,7 @@ static int armjtagew_execute_queue(void)
|
||||
jtag_command_t *cmd = jtag_command_queue;
|
||||
int scan_size;
|
||||
enum scan_type type;
|
||||
u8 *buffer;
|
||||
uint8_t *buffer;
|
||||
|
||||
while (cmd != NULL)
|
||||
{
|
||||
@@ -315,7 +315,7 @@ static void armjtagew_state_move(void)
|
||||
{
|
||||
int i;
|
||||
int tms = 0;
|
||||
u8 tms_scan = tap_get_tms_path(tap_get_state(), tap_get_end_state());
|
||||
uint8_t tms_scan = tap_get_tms_path(tap_get_state(), tap_get_end_state());
|
||||
int tms_count = tap_get_tms_path_len(tap_get_state(), tap_get_end_state());
|
||||
|
||||
for (i = 0; i < tms_count; i++)
|
||||
@@ -385,7 +385,7 @@ static void armjtagew_runtest(int num_cycles)
|
||||
}
|
||||
}
|
||||
|
||||
static void armjtagew_scan(bool ir_scan, enum scan_type type, u8 *buffer, int scan_size, scan_command_t *command)
|
||||
static void armjtagew_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int scan_size, scan_command_t *command)
|
||||
{
|
||||
tap_state_t saved_end_state;
|
||||
|
||||
@@ -415,11 +415,11 @@ static void armjtagew_scan(bool ir_scan, enum scan_type type, u8 *buffer, int sc
|
||||
|
||||
static void armjtagew_reset(int trst, int srst)
|
||||
{
|
||||
const u8 trst_mask = (1u<<5);
|
||||
const u8 srst_mask = (1u<<6);
|
||||
u8 val = 0;
|
||||
u8 outp_en = 0;
|
||||
u8 change_mask = 0;
|
||||
const uint8_t trst_mask = (1u<<5);
|
||||
const uint8_t srst_mask = (1u<<6);
|
||||
uint8_t val = 0;
|
||||
uint8_t outp_en = 0;
|
||||
uint8_t change_mask = 0;
|
||||
int result;
|
||||
|
||||
LOG_DEBUG("trst: %i, srst: %i", trst, srst);
|
||||
@@ -541,16 +541,16 @@ static int armjtagew_handle_armjtagew_info_command(struct command_context_s *cmd
|
||||
#define ARMJTAGEW_TAP_BUFFER_SIZE 2048
|
||||
|
||||
static int tap_length;
|
||||
static u8 tms_buffer[ARMJTAGEW_TAP_BUFFER_SIZE];
|
||||
static u8 tdi_buffer[ARMJTAGEW_TAP_BUFFER_SIZE];
|
||||
static u8 tdo_buffer[ARMJTAGEW_TAP_BUFFER_SIZE];
|
||||
static uint8_t tms_buffer[ARMJTAGEW_TAP_BUFFER_SIZE];
|
||||
static uint8_t tdi_buffer[ARMJTAGEW_TAP_BUFFER_SIZE];
|
||||
static uint8_t tdo_buffer[ARMJTAGEW_TAP_BUFFER_SIZE];
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int first; /* First bit position in tdo_buffer to read */
|
||||
int length; /* Number of bits to read */
|
||||
scan_command_t *command; /* Corresponding scan command */
|
||||
u8 *buffer;
|
||||
uint8_t *buffer;
|
||||
} pending_scan_result_t;
|
||||
|
||||
#define MAX_PENDING_SCAN_RESULTS 256
|
||||
@@ -585,7 +585,7 @@ static void armjtagew_tap_append_step(int tms, int tdi)
|
||||
if (index < ARMJTAGEW_TAP_BUFFER_SIZE)
|
||||
{
|
||||
int bit_index = tap_length % 8;
|
||||
u8 bit = 1 << bit_index;
|
||||
uint8_t bit = 1 << bit_index;
|
||||
|
||||
if (tms)
|
||||
{
|
||||
@@ -613,7 +613,7 @@ static void armjtagew_tap_append_step(int tms, int tdi)
|
||||
}
|
||||
}
|
||||
|
||||
void armjtagew_tap_append_scan(int length, u8 *buffer, scan_command_t *command)
|
||||
void armjtagew_tap_append_scan(int length, uint8_t *buffer, scan_command_t *command)
|
||||
{
|
||||
pending_scan_result_t *pending_scan_result = &pending_scan_results_buffer[pending_scan_results_length];
|
||||
int i;
|
||||
@@ -687,7 +687,7 @@ static int armjtagew_tap_execute(void)
|
||||
for (i = 0; i < pending_scan_results_length; i++)
|
||||
{
|
||||
pending_scan_result_t *pending_scan_result = &pending_scan_results_buffer[i];
|
||||
u8 *buffer = pending_scan_result->buffer;
|
||||
uint8_t *buffer = pending_scan_result->buffer;
|
||||
int length = pending_scan_result->length;
|
||||
int first = pending_scan_result->first;
|
||||
scan_command_t *command = pending_scan_result->command;
|
||||
@@ -845,7 +845,7 @@ static int armjtagew_usb_read(armjtagew_jtag_t *armjtagew_jtag, int exp_in_lengt
|
||||
#ifdef _DEBUG_USB_COMMS_
|
||||
#define BYTES_PER_LINE 16
|
||||
|
||||
static void armjtagew_debug_buffer(u8 *buffer, int length)
|
||||
static void armjtagew_debug_buffer(uint8_t *buffer, int length)
|
||||
{
|
||||
char line[81];
|
||||
char s[4];
|
||||
|
||||
@@ -77,7 +77,7 @@ static void bitbang_end_state(tap_state_t state)
|
||||
static void bitbang_state_move(int skip)
|
||||
{
|
||||
int i=0, tms=0;
|
||||
u8 tms_scan = tap_get_tms_path(tap_get_state(), tap_get_end_state());
|
||||
uint8_t tms_scan = tap_get_tms_path(tap_get_state(), tap_get_end_state());
|
||||
int tms_count = tap_get_tms_path_len(tap_get_state(), tap_get_end_state());
|
||||
|
||||
for (i = skip; i < tms_count; i++)
|
||||
@@ -170,7 +170,7 @@ static void bitbang_stableclocks(int num_cycles)
|
||||
|
||||
|
||||
|
||||
static void bitbang_scan(bool ir_scan, enum scan_type type, u8 *buffer, int scan_size)
|
||||
static void bitbang_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int scan_size)
|
||||
{
|
||||
tap_state_t saved_end_state = tap_get_end_state();
|
||||
int bit_cnt;
|
||||
@@ -233,7 +233,7 @@ int bitbang_execute_queue(void)
|
||||
jtag_command_t *cmd = jtag_command_queue; /* currently processed command */
|
||||
int scan_size;
|
||||
enum scan_type type;
|
||||
u8 *buffer;
|
||||
uint8_t *buffer;
|
||||
int retval;
|
||||
|
||||
if (!bitbang_interface)
|
||||
|
||||
@@ -29,7 +29,7 @@ bitq_interface_t* bitq_interface; /* low level bit queue interface */
|
||||
|
||||
static bitq_state_t bitq_in_state; /* state of input queue */
|
||||
|
||||
static u8* bitq_in_buffer; /* buffer dynamically reallocated as needed */
|
||||
static uint8_t* bitq_in_buffer; /* buffer dynamically reallocated as needed */
|
||||
static int bitq_in_bufsize = 32; /* min. buffer size */
|
||||
|
||||
/*
|
||||
@@ -40,9 +40,9 @@ static int bitq_in_bufsize = 32; /* min. buffer size */
|
||||
void bitq_in_proc(void)
|
||||
{
|
||||
/* static information preserved between calls to increase performance */
|
||||
static u8* in_buff; /* pointer to buffer for scanned data */
|
||||
static uint8_t* in_buff; /* pointer to buffer for scanned data */
|
||||
static int in_idx; /* index of byte being scanned */
|
||||
static u8 in_mask; /* mask of next bit to be scanned */
|
||||
static uint8_t in_mask; /* mask of next bit to be scanned */
|
||||
|
||||
scan_field_t* field;
|
||||
int tdo;
|
||||
@@ -150,7 +150,7 @@ void bitq_end_state(tap_state_t state)
|
||||
void bitq_state_move(tap_state_t new_state)
|
||||
{
|
||||
int i = 0;
|
||||
u8 tms_scan;
|
||||
uint8_t tms_scan;
|
||||
|
||||
if (!tap_is_state_stable(tap_get_state()) || !tap_is_state_stable(new_state))
|
||||
{
|
||||
@@ -218,8 +218,8 @@ void bitq_scan_field(scan_field_t* field, int pause)
|
||||
int bit_cnt;
|
||||
int tdo_req;
|
||||
|
||||
u8* out_ptr;
|
||||
u8 out_mask;
|
||||
uint8_t* out_ptr;
|
||||
uint8_t out_mask;
|
||||
|
||||
if (field->in_value)
|
||||
tdo_req = 1;
|
||||
|
||||
@@ -64,7 +64,7 @@ void* cmd_queue_alloc(size_t size)
|
||||
{
|
||||
cmd_queue_page_t **p_page = &cmd_queue_pages;
|
||||
int offset;
|
||||
u8 *t;
|
||||
uint8_t *t;
|
||||
|
||||
/*
|
||||
* WARNING:
|
||||
@@ -117,7 +117,7 @@ void* cmd_queue_alloc(size_t size)
|
||||
offset = (*p_page)->used;
|
||||
(*p_page)->used += size;
|
||||
|
||||
t=(u8 *)((*p_page)->address);
|
||||
t=(uint8_t *)((*p_page)->address);
|
||||
return t + offset;
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ int jtag_scan_size(const scan_command_t *cmd)
|
||||
return bit_count;
|
||||
}
|
||||
|
||||
int jtag_build_buffer(const scan_command_t *cmd, u8 **buffer)
|
||||
int jtag_build_buffer(const scan_command_t *cmd, uint8_t **buffer)
|
||||
{
|
||||
int bit_count = 0;
|
||||
int i;
|
||||
@@ -218,7 +218,7 @@ int jtag_build_buffer(const scan_command_t *cmd, u8 **buffer)
|
||||
return bit_count;
|
||||
}
|
||||
|
||||
int jtag_read_buffer(u8 *buffer, const scan_command_t *cmd)
|
||||
int jtag_read_buffer(uint8_t *buffer, const scan_command_t *cmd)
|
||||
{
|
||||
int i;
|
||||
int bit_count = 0;
|
||||
@@ -235,7 +235,7 @@ int jtag_read_buffer(u8 *buffer, const scan_command_t *cmd)
|
||||
if (cmd->fields[i].in_value)
|
||||
{
|
||||
int num_bits = cmd->fields[i].num_bits;
|
||||
u8 *captured = buf_set_buf(buffer, bit_count, malloc(CEIL(num_bits, 8)), 0, num_bits);
|
||||
uint8_t *captured = buf_set_buf(buffer, bit_count, malloc(CEIL(num_bits, 8)), 0, num_bits);
|
||||
|
||||
#ifdef _DEBUG_JTAG_IO_
|
||||
char *char_buf = buf_to_str(captured, (num_bits > DEBUG_JTAG_IOZ) ? DEBUG_JTAG_IOZ : num_bits, 16);
|
||||
|
||||
@@ -156,7 +156,7 @@ void jtag_command_queue_reset(void);
|
||||
|
||||
enum scan_type jtag_scan_type(const scan_command_t* cmd);
|
||||
int jtag_scan_size(const scan_command_t* cmd);
|
||||
int jtag_read_buffer(u8* buffer, const scan_command_t* cmd);
|
||||
int jtag_build_buffer(const scan_command_t* cmd, u8** buffer);
|
||||
int jtag_read_buffer(uint8_t* buffer, const scan_command_t* cmd);
|
||||
int jtag_build_buffer(const scan_command_t* cmd, uint8_t** buffer);
|
||||
|
||||
#endif // JTAG_COMMANDS_H
|
||||
|
||||
@@ -353,23 +353,23 @@ void jtag_add_plain_ir_scan(int in_num_fields, const scan_field_t *in_fields,
|
||||
jtag_set_error(retval);
|
||||
}
|
||||
|
||||
void jtag_add_callback(jtag_callback1_t f, u8 *in)
|
||||
void jtag_add_callback(jtag_callback1_t f, uint8_t *in)
|
||||
{
|
||||
interface_jtag_add_callback(f, in);
|
||||
}
|
||||
|
||||
void jtag_add_callback4(jtag_callback_t f, u8 *in,
|
||||
void jtag_add_callback4(jtag_callback_t f, uint8_t *in,
|
||||
jtag_callback_data_t data1, jtag_callback_data_t data2,
|
||||
jtag_callback_data_t data3)
|
||||
{
|
||||
interface_jtag_add_callback4(f, in, data1, data2, data3);
|
||||
}
|
||||
|
||||
int jtag_check_value_inner(u8 *captured, u8 *in_check_value, u8 *in_check_mask, int num_bits);
|
||||
int jtag_check_value_inner(uint8_t *captured, uint8_t *in_check_value, uint8_t *in_check_mask, int num_bits);
|
||||
|
||||
static int jtag_check_value_mask_callback(u8 *in, jtag_callback_data_t data1, jtag_callback_data_t data2, jtag_callback_data_t data3)
|
||||
static int jtag_check_value_mask_callback(uint8_t *in, jtag_callback_data_t data1, jtag_callback_data_t data2, jtag_callback_data_t data3)
|
||||
{
|
||||
return jtag_check_value_inner(in, (u8 *)data1, (u8 *)data2, (int)data3);
|
||||
return jtag_check_value_inner(in, (uint8_t *)data1, (uint8_t *)data2, (int)data3);
|
||||
}
|
||||
|
||||
static void jtag_add_scan_check(void (*jtag_add_scan)(int in_num_fields, const scan_field_t *in_fields, tap_state_t state),
|
||||
@@ -693,7 +693,7 @@ void jtag_add_sleep(u32 us)
|
||||
jtag_set_error(interface_jtag_add_sleep(us));
|
||||
}
|
||||
|
||||
int jtag_check_value_inner(u8 *captured, u8 *in_check_value, u8 *in_check_mask, int num_bits)
|
||||
int jtag_check_value_inner(uint8_t *captured, uint8_t *in_check_value, uint8_t *in_check_mask, int num_bits)
|
||||
{
|
||||
int retval = ERROR_OK;
|
||||
|
||||
@@ -742,7 +742,7 @@ int jtag_check_value_inner(u8 *captured, u8 *in_check_value, u8 *in_check_mask,
|
||||
return retval;
|
||||
}
|
||||
|
||||
void jtag_check_value_mask(scan_field_t *field, u8 *value, u8 *mask)
|
||||
void jtag_check_value_mask(scan_field_t *field, uint8_t *value, uint8_t *mask)
|
||||
{
|
||||
assert(field->in_value != NULL);
|
||||
|
||||
@@ -819,7 +819,7 @@ void jtag_sleep(u32 us)
|
||||
#define EXTRACT_PART(X) (((X) & 0xffff000) >> 12)
|
||||
#define EXTRACT_VER(X) (((X) & 0xf0000000) >> 28)
|
||||
|
||||
static int jtag_examine_chain_execute(u8 *idcode_buffer, unsigned num_idcode)
|
||||
static int jtag_examine_chain_execute(uint8_t *idcode_buffer, unsigned num_idcode)
|
||||
{
|
||||
scan_field_t field = {
|
||||
.tap = NULL,
|
||||
@@ -836,10 +836,10 @@ static int jtag_examine_chain_execute(u8 *idcode_buffer, unsigned num_idcode)
|
||||
return jtag_execute_queue();
|
||||
}
|
||||
|
||||
static bool jtag_examine_chain_check(u8 *idcodes, unsigned count)
|
||||
static bool jtag_examine_chain_check(uint8_t *idcodes, unsigned count)
|
||||
{
|
||||
u8 zero_check = 0x0;
|
||||
u8 one_check = 0xff;
|
||||
uint8_t zero_check = 0x0;
|
||||
uint8_t one_check = 0xff;
|
||||
|
||||
for (unsigned i = 0; i < count * 4; i++)
|
||||
{
|
||||
@@ -879,7 +879,7 @@ static bool jtag_idcode_is_final(u32 idcode)
|
||||
* read back correctly. This can help identify and diagnose problems
|
||||
* with the JTAG chain earlier, gives more helpful/explicit error messages.
|
||||
*/
|
||||
static void jtag_examine_chain_end(u8 *idcodes, unsigned count, unsigned max)
|
||||
static void jtag_examine_chain_end(uint8_t *idcodes, unsigned count, unsigned max)
|
||||
{
|
||||
bool triggered = false;
|
||||
for ( ; count < max - 31; count += 32)
|
||||
@@ -907,7 +907,7 @@ static bool jtag_examine_chain_match_tap(const struct jtag_tap_s *tap)
|
||||
}
|
||||
|
||||
/* Loop over the expected identification codes and test for a match */
|
||||
u8 ii;
|
||||
uint8_t ii;
|
||||
for (ii = 0; ii < tap->expected_ids_cnt; ii++)
|
||||
{
|
||||
if (tap->idcode == tap->expected_ids[ii])
|
||||
@@ -937,7 +937,7 @@ static bool jtag_examine_chain_match_tap(const struct jtag_tap_s *tap)
|
||||
*/
|
||||
int jtag_examine_chain(void)
|
||||
{
|
||||
u8 idcode_buffer[JTAG_MAX_CHAIN_SIZE * 4];
|
||||
uint8_t idcode_buffer[JTAG_MAX_CHAIN_SIZE * 4];
|
||||
unsigned device_count = 0;
|
||||
|
||||
jtag_examine_chain_execute(idcode_buffer, JTAG_MAX_CHAIN_SIZE);
|
||||
@@ -1015,7 +1015,7 @@ int jtag_validate_chain(void)
|
||||
{
|
||||
jtag_tap_t *tap;
|
||||
int total_ir_length = 0;
|
||||
u8 *ir_test = NULL;
|
||||
uint8_t *ir_test = NULL;
|
||||
scan_field_t field;
|
||||
int chain_pos = 0;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ struct jtag_callback_entry
|
||||
struct jtag_callback_entry *next;
|
||||
|
||||
jtag_callback_t callback;
|
||||
u8 *in;
|
||||
uint8_t *in;
|
||||
jtag_callback_data_t data1;
|
||||
jtag_callback_data_t data2;
|
||||
jtag_callback_data_t data3;
|
||||
@@ -311,7 +311,7 @@ void interface_jtag_add_dr_out(jtag_tap_t *target_tap,
|
||||
|
||||
for (int j = 0; j < in_num_fields; j++)
|
||||
{
|
||||
u8 out_value[4];
|
||||
uint8_t out_value[4];
|
||||
size_t scan_size = num_bits[j];
|
||||
buf_set_u32(out_value, 0, scan_size, value[j]);
|
||||
|
||||
@@ -465,7 +465,7 @@ int interface_jtag_add_sleep(u32 us)
|
||||
}
|
||||
|
||||
/* add callback to end of queue */
|
||||
void interface_jtag_add_callback4(jtag_callback_t callback, u8 *in, jtag_callback_data_t data1, jtag_callback_data_t data2, jtag_callback_data_t data3)
|
||||
void interface_jtag_add_callback4(jtag_callback_t callback, uint8_t *in, jtag_callback_data_t data1, jtag_callback_data_t data2, jtag_callback_data_t data3)
|
||||
{
|
||||
struct jtag_callback_entry *entry=cmd_queue_alloc(sizeof(struct jtag_callback_entry));
|
||||
|
||||
@@ -507,13 +507,13 @@ int interface_jtag_execute_queue(void)
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int jtag_convert_to_callback4(u8 *in, jtag_callback_data_t data1, jtag_callback_data_t data2, jtag_callback_data_t data3)
|
||||
static int jtag_convert_to_callback4(uint8_t *in, jtag_callback_data_t data1, jtag_callback_data_t data2, jtag_callback_data_t data3)
|
||||
{
|
||||
((jtag_callback1_t)data1)(in);
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
void interface_jtag_add_callback(jtag_callback1_t callback, u8 *in)
|
||||
void interface_jtag_add_callback(jtag_callback1_t callback, uint8_t *in)
|
||||
{
|
||||
jtag_add_callback4(jtag_convert_to_callback4, in, (jtag_callback_data_t)callback, 0, 0);
|
||||
}
|
||||
|
||||
@@ -34,11 +34,11 @@
|
||||
|
||||
#include <sys/mman.h>
|
||||
|
||||
static u8 output_value = 0x0;
|
||||
static uint8_t output_value = 0x0;
|
||||
static int dev_mem_fd;
|
||||
static void *gpio_controller;
|
||||
static volatile u8 *gpio_data_register;
|
||||
static volatile u8 *gpio_data_direction_register;
|
||||
static volatile uint8_t *gpio_data_register;
|
||||
static volatile uint8_t *gpio_data_direction_register;
|
||||
|
||||
/* low level command set
|
||||
*/
|
||||
|
||||
@@ -101,7 +101,7 @@ static char * ft2232_device_desc_A = NULL;
|
||||
static char* ft2232_device_desc = NULL;
|
||||
static char* ft2232_serial = NULL;
|
||||
static char* ft2232_layout = NULL;
|
||||
static u8 ft2232_latency = 2;
|
||||
static uint8_t ft2232_latency = 2;
|
||||
static unsigned ft2232_max_tck = 6000;
|
||||
|
||||
|
||||
@@ -168,13 +168,13 @@ static const ft2232_layout_t ft2232_layouts[] =
|
||||
{ NULL, NULL, NULL, NULL },
|
||||
};
|
||||
|
||||
static u8 nTRST, nTRSTnOE, nSRST, nSRSTnOE;
|
||||
static uint8_t nTRST, nTRSTnOE, nSRST, nSRSTnOE;
|
||||
|
||||
static const ft2232_layout_t *layout;
|
||||
static u8 low_output = 0x0;
|
||||
static u8 low_direction = 0x0;
|
||||
static u8 high_output = 0x0;
|
||||
static u8 high_direction = 0x0;
|
||||
static uint8_t low_output = 0x0;
|
||||
static uint8_t low_direction = 0x0;
|
||||
static uint8_t high_output = 0x0;
|
||||
static uint8_t high_direction = 0x0;
|
||||
|
||||
#if BUILD_FT2232_FTD2XX == 1
|
||||
static FT_HANDLE ftdih = NULL;
|
||||
@@ -203,7 +203,7 @@ static int require_send;
|
||||
|
||||
#define FT2232_BUFFER_SIZE 131072
|
||||
|
||||
static u8* ft2232_buffer = NULL;
|
||||
static uint8_t* ft2232_buffer = NULL;
|
||||
static int ft2232_buffer_size = 0;
|
||||
static int ft2232_read_pointer = 0;
|
||||
static int ft2232_expect_read = 0;
|
||||
@@ -213,7 +213,7 @@ static int ft2232_expect_read = 0;
|
||||
* writes a byte into the byte buffer, "ft2232_buffer", which must be sent later.
|
||||
* @param val is the byte to send.
|
||||
*/
|
||||
static inline void buffer_write(u8 val)
|
||||
static inline void buffer_write(uint8_t val)
|
||||
{
|
||||
assert(ft2232_buffer);
|
||||
assert((unsigned) ft2232_buffer_size < (unsigned) FT2232_BUFFER_SIZE);
|
||||
@@ -224,7 +224,7 @@ static inline void buffer_write(u8 val)
|
||||
* Function buffer_read
|
||||
* returns a byte from the byte buffer.
|
||||
*/
|
||||
static inline u8 buffer_read(void)
|
||||
static inline uint8_t buffer_read(void)
|
||||
{
|
||||
assert(ft2232_buffer);
|
||||
assert(ft2232_read_pointer < ft2232_buffer_size);
|
||||
@@ -249,9 +249,9 @@ static inline u8 buffer_read(void)
|
||||
*
|
||||
* See the MPSSE spec referenced above.
|
||||
*/
|
||||
static void clock_tms(u8 mpsse_cmd, int tms_bits, int tms_count, bool tdi_bit)
|
||||
static void clock_tms(uint8_t mpsse_cmd, int tms_bits, int tms_count, bool tdi_bit)
|
||||
{
|
||||
u8 tms_byte;
|
||||
uint8_t tms_byte;
|
||||
int i;
|
||||
int tms_ndx; /* bit index into tms_byte */
|
||||
|
||||
@@ -338,7 +338,7 @@ jtag_interface_t ft2232_interface =
|
||||
.quit = ft2232_quit,
|
||||
};
|
||||
|
||||
static int ft2232_write(u8* buf, int size, u32* bytes_written)
|
||||
static int ft2232_write(uint8_t* buf, int size, u32* bytes_written)
|
||||
{
|
||||
#if BUILD_FT2232_FTD2XX == 1
|
||||
FT_STATUS status;
|
||||
@@ -371,7 +371,7 @@ static int ft2232_write(u8* buf, int size, u32* bytes_written)
|
||||
}
|
||||
|
||||
|
||||
static int ft2232_read(u8* buf, u32 size, u32* bytes_read)
|
||||
static int ft2232_read(uint8_t* buf, u32 size, u32* bytes_read)
|
||||
{
|
||||
#if BUILD_FT2232_FTD2XX == 1
|
||||
DWORD dw_bytes_read;
|
||||
@@ -438,7 +438,7 @@ static int ft2232_adaptive_clocking(int speed)
|
||||
}
|
||||
}
|
||||
|
||||
u8 buf = use_adaptive_clocking ? 0x96 : 0x97;
|
||||
uint8_t buf = use_adaptive_clocking ? 0x96 : 0x97;
|
||||
LOG_DEBUG("%2.2x", buf);
|
||||
|
||||
u32 bytes_written;
|
||||
@@ -461,7 +461,7 @@ static int ft2232_adaptive_clocking(int speed)
|
||||
|
||||
static int ft2232_speed(int speed)
|
||||
{
|
||||
u8 buf[3];
|
||||
uint8_t buf[3];
|
||||
int retval;
|
||||
u32 bytes_written;
|
||||
|
||||
@@ -569,7 +569,7 @@ static void ft2232_end_state(tap_state_t state)
|
||||
}
|
||||
}
|
||||
|
||||
static void ft2232_read_scan(enum scan_type type, u8* buffer, int scan_size)
|
||||
static void ft2232_read_scan(enum scan_type type, uint8_t* buffer, int scan_size)
|
||||
{
|
||||
int num_bytes = (scan_size + 7) / 8;
|
||||
int bits_left = scan_size;
|
||||
@@ -617,7 +617,7 @@ static void ft2232_debug_dump_buffer(void)
|
||||
static int ft2232_send_and_recv(jtag_command_t* first, jtag_command_t* last)
|
||||
{
|
||||
jtag_command_t* cmd;
|
||||
u8* buffer;
|
||||
uint8_t* buffer;
|
||||
int scan_size;
|
||||
enum scan_type type;
|
||||
int retval;
|
||||
@@ -775,7 +775,7 @@ static void ft2232_add_pathmove(tap_state_t* path, int num_states)
|
||||
}
|
||||
|
||||
|
||||
static void ft2232_add_scan(bool ir_scan, enum scan_type type, u8* buffer, int scan_size)
|
||||
static void ft2232_add_scan(bool ir_scan, enum scan_type type, uint8_t* buffer, int scan_size)
|
||||
{
|
||||
int num_bytes = (scan_size + 7) / 8;
|
||||
int bits_left = scan_size;
|
||||
@@ -823,8 +823,8 @@ static void ft2232_add_scan(bool ir_scan, enum scan_type type, u8* buffer, int s
|
||||
thisrun_bytes = (num_bytes > 65537) ? 65536 : (num_bytes - 1);
|
||||
num_bytes -= thisrun_bytes;
|
||||
|
||||
buffer_write((u8) (thisrun_bytes - 1));
|
||||
buffer_write((u8) ((thisrun_bytes - 1) >> 8));
|
||||
buffer_write((uint8_t) (thisrun_bytes - 1));
|
||||
buffer_write((uint8_t) ((thisrun_bytes - 1) >> 8));
|
||||
|
||||
if (type != SCAN_IN)
|
||||
{
|
||||
@@ -902,7 +902,7 @@ static void ft2232_add_scan(bool ir_scan, enum scan_type type, u8* buffer, int s
|
||||
{
|
||||
int tms_bits;
|
||||
int tms_count;
|
||||
u8 mpsse_cmd;
|
||||
uint8_t mpsse_cmd;
|
||||
|
||||
/* move from Shift-IR/DR to end state */
|
||||
if (type != SCAN_OUT)
|
||||
@@ -934,14 +934,14 @@ static void ft2232_add_scan(bool ir_scan, enum scan_type type, u8* buffer, int s
|
||||
}
|
||||
|
||||
|
||||
static int ft2232_large_scan(scan_command_t* cmd, enum scan_type type, u8* buffer, int scan_size)
|
||||
static int ft2232_large_scan(scan_command_t* cmd, enum scan_type type, uint8_t* buffer, int scan_size)
|
||||
{
|
||||
int num_bytes = (scan_size + 7) / 8;
|
||||
int bits_left = scan_size;
|
||||
int cur_byte = 0;
|
||||
int last_bit;
|
||||
u8* receive_buffer = malloc(CEIL(scan_size, 8));
|
||||
u8* receive_pointer = receive_buffer;
|
||||
uint8_t* receive_buffer = malloc(CEIL(scan_size, 8));
|
||||
uint8_t* receive_pointer = receive_buffer;
|
||||
u32 bytes_written;
|
||||
u32 bytes_read;
|
||||
int retval;
|
||||
@@ -993,8 +993,8 @@ static int ft2232_large_scan(scan_command_t* cmd, enum scan_type type, u8* buffe
|
||||
thisrun_bytes = (num_bytes > 65537) ? 65536 : (num_bytes - 1);
|
||||
thisrun_read = thisrun_bytes;
|
||||
num_bytes -= thisrun_bytes;
|
||||
buffer_write((u8) (thisrun_bytes - 1));
|
||||
buffer_write((u8) ((thisrun_bytes - 1) >> 8));
|
||||
buffer_write((uint8_t) (thisrun_bytes - 1));
|
||||
buffer_write((uint8_t) ((thisrun_bytes - 1) >> 8));
|
||||
|
||||
if (type != SCAN_IN)
|
||||
{
|
||||
@@ -1095,7 +1095,7 @@ static int ft2232_large_scan(scan_command_t* cmd, enum scan_type type, u8* buffe
|
||||
{
|
||||
int tms_bits = tap_get_tms_path(tap_get_state(), tap_get_end_state());
|
||||
int tms_count = tap_get_tms_path_len(tap_get_state(), tap_get_end_state());
|
||||
u8 mpsse_cmd;
|
||||
uint8_t mpsse_cmd;
|
||||
|
||||
/* move from Shift-IR/DR to end state */
|
||||
if (type != SCAN_OUT)
|
||||
@@ -1599,7 +1599,7 @@ static int ft2232_execute_pathmove(jtag_command_t *cmd)
|
||||
|
||||
static int ft2232_execute_scan(jtag_command_t *cmd)
|
||||
{
|
||||
u8* buffer;
|
||||
uint8_t* buffer;
|
||||
int scan_size; /* size of IR or DR scan */
|
||||
int predicted_size = 0;
|
||||
int retval = ERROR_OK;
|
||||
@@ -1788,7 +1788,7 @@ static int ft2232_init_ftd2xx(u16 vid, u16 pid, int more, int* try_more)
|
||||
char Description[64];
|
||||
DWORD openex_flags = 0;
|
||||
char* openex_string = NULL;
|
||||
u8 latency_timer;
|
||||
uint8_t latency_timer;
|
||||
|
||||
LOG_DEBUG("'ft2232' interface using FTD2XX with '%s' layout (%4.4x:%4.4x)", ft2232_layout, vid, pid);
|
||||
|
||||
@@ -1960,7 +1960,7 @@ static int ft2232_purge_ftd2xx(void)
|
||||
#if BUILD_FT2232_LIBFTDI == 1
|
||||
static int ft2232_init_libftdi(u16 vid, u16 pid, int more, int* try_more)
|
||||
{
|
||||
u8 latency_timer;
|
||||
uint8_t latency_timer;
|
||||
|
||||
LOG_DEBUG("'ft2232' interface using libftdi with '%s' layout (%4.4x:%4.4x)",
|
||||
ft2232_layout, vid, pid);
|
||||
@@ -2032,7 +2032,7 @@ static int ft2232_purge_libftdi(void)
|
||||
|
||||
static int ft2232_init(void)
|
||||
{
|
||||
u8 buf[1];
|
||||
uint8_t buf[1];
|
||||
int retval;
|
||||
u32 bytes_written;
|
||||
const ft2232_layout_t* cur_layout = ft2232_layouts;
|
||||
@@ -2123,7 +2123,7 @@ static int ft2232_init(void)
|
||||
|
||||
static int usbjtag_init(void)
|
||||
{
|
||||
u8 buf[3];
|
||||
uint8_t buf[3];
|
||||
u32 bytes_written;
|
||||
|
||||
low_output = 0x08;
|
||||
@@ -2199,7 +2199,7 @@ static int usbjtag_init(void)
|
||||
|
||||
static int axm0432_jtag_init(void)
|
||||
{
|
||||
u8 buf[3];
|
||||
uint8_t buf[3];
|
||||
u32 bytes_written;
|
||||
|
||||
low_output = 0x08;
|
||||
@@ -2270,7 +2270,7 @@ static int axm0432_jtag_init(void)
|
||||
|
||||
static int jtagkey_init(void)
|
||||
{
|
||||
u8 buf[3];
|
||||
uint8_t buf[3];
|
||||
u32 bytes_written;
|
||||
|
||||
low_output = 0x08;
|
||||
@@ -2353,7 +2353,7 @@ static int jtagkey_init(void)
|
||||
|
||||
static int olimex_jtag_init(void)
|
||||
{
|
||||
u8 buf[3];
|
||||
uint8_t buf[3];
|
||||
u32 bytes_written;
|
||||
|
||||
low_output = 0x08;
|
||||
@@ -2421,7 +2421,7 @@ static int olimex_jtag_init(void)
|
||||
|
||||
static int flyswatter_init(void)
|
||||
{
|
||||
u8 buf[3];
|
||||
uint8_t buf[3];
|
||||
u32 bytes_written;
|
||||
|
||||
low_output = 0x18;
|
||||
@@ -2468,7 +2468,7 @@ static int flyswatter_init(void)
|
||||
|
||||
static int turtle_init(void)
|
||||
{
|
||||
u8 buf[3];
|
||||
uint8_t buf[3];
|
||||
u32 bytes_written;
|
||||
|
||||
low_output = 0x08;
|
||||
@@ -2509,7 +2509,7 @@ static int turtle_init(void)
|
||||
|
||||
static int comstick_init(void)
|
||||
{
|
||||
u8 buf[3];
|
||||
uint8_t buf[3];
|
||||
u32 bytes_written;
|
||||
|
||||
low_output = 0x08;
|
||||
@@ -2553,7 +2553,7 @@ static int comstick_init(void)
|
||||
|
||||
static int stm32stick_init(void)
|
||||
{
|
||||
u8 buf[3];
|
||||
uint8_t buf[3];
|
||||
u32 bytes_written;
|
||||
|
||||
low_output = 0x88;
|
||||
@@ -2597,7 +2597,7 @@ static int stm32stick_init(void)
|
||||
|
||||
static int sheevaplug_init(void)
|
||||
{
|
||||
u8 buf[3];
|
||||
uint8_t buf[3];
|
||||
u32 bytes_written;
|
||||
|
||||
low_output = 0x08;
|
||||
@@ -2648,7 +2648,7 @@ static int sheevaplug_init(void)
|
||||
|
||||
static int cortino_jtag_init(void)
|
||||
{
|
||||
u8 buf[3];
|
||||
uint8_t buf[3];
|
||||
u32 bytes_written;
|
||||
|
||||
low_output = 0x08;
|
||||
@@ -2884,7 +2884,7 @@ static int ft2232_stableclocks(int num_cycles, jtag_command_t* cmd)
|
||||
int retval = 0;
|
||||
|
||||
/* 7 bits of either ones or zeros. */
|
||||
u8 tms = (tap_get_state() == TAP_RESET ? 0x7F : 0x00);
|
||||
uint8_t tms = (tap_get_state() == TAP_RESET ? 0x7F : 0x00);
|
||||
|
||||
while (num_cycles > 0)
|
||||
{
|
||||
@@ -2949,7 +2949,7 @@ static int ft2232_stableclocks(int num_cycles, jtag_command_t* cmd)
|
||||
* ADBUS7 - GND
|
||||
*/
|
||||
static int icebear_jtag_init(void) {
|
||||
u8 buf[3];
|
||||
uint8_t buf[3];
|
||||
u32 bytes_written;
|
||||
|
||||
low_direction = 0x0b; /* output: TCK TDI TMS; input: TDO */
|
||||
|
||||
@@ -71,8 +71,8 @@ u16 gw16012_port;
|
||||
|
||||
/* interface variables
|
||||
*/
|
||||
static u8 gw16012_msb = 0x0;
|
||||
static u8 gw16012_control_value = 0x0;
|
||||
static uint8_t gw16012_msb = 0x0;
|
||||
static uint8_t gw16012_control_value = 0x0;
|
||||
|
||||
#if PARPORT_USE_PPDEV == 1
|
||||
static int device_handle;
|
||||
@@ -106,7 +106,7 @@ static int gw16012_register_commands(struct command_context_s *cmd_ctx)
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static void gw16012_data(u8 value)
|
||||
static void gw16012_data(uint8_t value)
|
||||
{
|
||||
value = (value & 0x7f) | gw16012_msb;
|
||||
gw16012_msb ^= 0x80; /* toggle MSB */
|
||||
@@ -126,7 +126,7 @@ static void gw16012_data(u8 value)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void gw16012_control(u8 value)
|
||||
static void gw16012_control(uint8_t value)
|
||||
{
|
||||
if (value != gw16012_control_value)
|
||||
{
|
||||
@@ -148,7 +148,7 @@ static void gw16012_control(u8 value)
|
||||
}
|
||||
}
|
||||
|
||||
static void gw16012_input(u8 *value)
|
||||
static void gw16012_input(uint8_t *value)
|
||||
{
|
||||
#if PARPORT_USE_PPDEV == 1
|
||||
ioctl(device_handle, PPRSTATUS, value);
|
||||
@@ -197,7 +197,7 @@ static void gw16012_end_state(tap_state_t state)
|
||||
static void gw16012_state_move(void)
|
||||
{
|
||||
int i=0, tms=0;
|
||||
u8 tms_scan = tap_get_tms_path(tap_get_state(), tap_get_end_state());
|
||||
uint8_t tms_scan = tap_get_tms_path(tap_get_state(), tap_get_end_state());
|
||||
int tms_count = tap_get_tms_path_len(tap_get_state(), tap_get_end_state());
|
||||
|
||||
gw16012_control(0x0); /* single-bit mode */
|
||||
@@ -265,12 +265,12 @@ static void gw16012_runtest(int num_cycles)
|
||||
gw16012_state_move();
|
||||
}
|
||||
|
||||
static void gw16012_scan(bool ir_scan, enum scan_type type, u8 *buffer, int scan_size)
|
||||
static void gw16012_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int scan_size)
|
||||
{
|
||||
int bits_left = scan_size;
|
||||
int bit_count = 0;
|
||||
tap_state_t saved_end_state = tap_get_end_state();
|
||||
u8 scan_out, scan_in;
|
||||
uint8_t scan_out, scan_in;
|
||||
|
||||
/* only if we're not already in the correct Shift state */
|
||||
if (!((!ir_scan && (tap_get_state() == TAP_DRSHIFT)) || (ir_scan && (tap_get_state() == TAP_IRSHIFT))))
|
||||
@@ -296,7 +296,7 @@ static void gw16012_scan(bool ir_scan, enum scan_type type, u8 *buffer, int scan
|
||||
gw16012_control(0x0); /* single-bit mode */
|
||||
while (bits_left-- > 0)
|
||||
{
|
||||
u8 tms = 0;
|
||||
uint8_t tms = 0;
|
||||
|
||||
scan_out = buf_get_u32(buffer, bit_count, 1);
|
||||
|
||||
@@ -343,7 +343,7 @@ static int gw16012_execute_queue(void)
|
||||
jtag_command_t *cmd = jtag_command_queue; /* currently processed command */
|
||||
int scan_size;
|
||||
enum scan_type type;
|
||||
u8 *buffer;
|
||||
uint8_t *buffer;
|
||||
int retval;
|
||||
|
||||
/* return ERROR_OK, unless a jtag_read_buffer returns a failed check
|
||||
@@ -549,7 +549,7 @@ static int gw16012_init_device(void)
|
||||
|
||||
static int gw16012_init(void)
|
||||
{
|
||||
u8 status_port;
|
||||
uint8_t status_port;
|
||||
|
||||
if (gw16012_init_device() != ERROR_OK)
|
||||
return ERROR_JTAG_INIT_FAILED;
|
||||
|
||||
@@ -106,8 +106,8 @@ int tap_move_ndx( tap_state_t astate )
|
||||
*/
|
||||
struct tms_sequences
|
||||
{
|
||||
u8 bits;
|
||||
u8 bit_count;
|
||||
uint8_t bits;
|
||||
uint8_t bit_count;
|
||||
|
||||
};
|
||||
|
||||
@@ -127,7 +127,7 @@ struct tms_sequences
|
||||
+(((x) & 0x0F000000LU)?(1<<6):0) \
|
||||
+(((x) & 0xF0000000LU)?(1<<7):0)
|
||||
|
||||
#define B8(bits,count) { ((u8)B8__(HEX__(bits))), (count) }
|
||||
#define B8(bits,count) { ((uint8_t)B8__(HEX__(bits))), (count) }
|
||||
|
||||
static const struct tms_sequences old_tms_seqs[6][6] = /* [from_state_ndx][to_state_ndx] */
|
||||
{
|
||||
@@ -380,8 +380,8 @@ tap_state_t tap_state_by_name(const char *name)
|
||||
tap_state_t jtag_debug_state_machine(const void *tms_buf, const void *tdi_buf,
|
||||
unsigned tap_bits, tap_state_t next_state)
|
||||
{
|
||||
const u8 *tms_buffer;
|
||||
const u8 *tdi_buffer;
|
||||
const uint8_t *tms_buffer;
|
||||
const uint8_t *tdi_buffer;
|
||||
unsigned tap_bytes;
|
||||
unsigned cur_byte;
|
||||
unsigned cur_bit;
|
||||
@@ -396,8 +396,8 @@ tap_state_t jtag_debug_state_machine(const void *tms_buf, const void *tdi_buf,
|
||||
last_state = next_state;
|
||||
DEBUG_JTAG_IO("TAP/SM: START state: %s", tap_state_name(next_state));
|
||||
|
||||
tms_buffer = (const u8 *)tms_buf;
|
||||
tdi_buffer = (const u8 *)tdi_buf;
|
||||
tms_buffer = (const uint8_t *)tms_buf;
|
||||
tdi_buffer = (const uint8_t *)tdi_buf;
|
||||
|
||||
tap_bytes = TAP_SCAN_BYTES(tap_bits);
|
||||
DEBUG_JTAG_IO("TAP/SM: TMS bits: %u (bytes: %u)", tap_bits, tap_bytes);
|
||||
|
||||
@@ -54,9 +54,9 @@ static unsigned int jlink_hw_jtag_version = 2;
|
||||
#define JLINK_EMU_RESULT_BUFFER_SIZE 64
|
||||
|
||||
/* Global USB buffers */
|
||||
static u8 usb_in_buffer[JLINK_IN_BUFFER_SIZE];
|
||||
static u8 usb_out_buffer[JLINK_OUT_BUFFER_SIZE];
|
||||
static u8 usb_emu_result_buffer[JLINK_EMU_RESULT_BUFFER_SIZE];
|
||||
static uint8_t usb_in_buffer[JLINK_IN_BUFFER_SIZE];
|
||||
static uint8_t usb_out_buffer[JLINK_OUT_BUFFER_SIZE];
|
||||
static uint8_t usb_emu_result_buffer[JLINK_EMU_RESULT_BUFFER_SIZE];
|
||||
|
||||
/* Constants for JLink command */
|
||||
#define EMU_CMD_VERSION 0x01
|
||||
@@ -100,9 +100,9 @@ static void jlink_end_state(tap_state_t state);
|
||||
static void jlink_state_move(void);
|
||||
static void jlink_path_move(int num_states, tap_state_t *path);
|
||||
static void jlink_runtest(int num_cycles);
|
||||
static void jlink_scan(bool ir_scan, enum scan_type type, u8 *buffer, int scan_size, scan_command_t *command);
|
||||
static void jlink_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int scan_size, scan_command_t *command);
|
||||
static void jlink_reset(int trst, int srst);
|
||||
static void jlink_simple_command(u8 command);
|
||||
static void jlink_simple_command(uint8_t command);
|
||||
static int jlink_get_status(void);
|
||||
|
||||
/* J-Link tap buffer functions */
|
||||
@@ -110,7 +110,7 @@ static void jlink_tap_init(void);
|
||||
static int jlink_tap_execute(void);
|
||||
static void jlink_tap_ensure_space(int scans, int bits);
|
||||
static void jlink_tap_append_step(int tms, int tdi);
|
||||
static void jlink_tap_append_scan(int length, u8 *buffer, scan_command_t *command);
|
||||
static void jlink_tap_append_scan(int length, uint8_t *buffer, scan_command_t *command);
|
||||
|
||||
/* Jlink lowlevel functions */
|
||||
typedef struct jlink_jtag
|
||||
@@ -129,7 +129,7 @@ static int jlink_usb_read_emu_result(jlink_jtag_t *jlink_jtag);
|
||||
static int jlink_get_version_info(void);
|
||||
|
||||
#ifdef _DEBUG_USB_COMMS_
|
||||
static void jlink_debug_buffer(u8 *buffer, int length);
|
||||
static void jlink_debug_buffer(uint8_t *buffer, int length);
|
||||
#endif
|
||||
|
||||
static enum tap_state jlink_last_state = TAP_RESET;
|
||||
@@ -184,7 +184,7 @@ static void jlink_execute_scan(jtag_command_t *cmd)
|
||||
{
|
||||
int scan_size;
|
||||
enum scan_type type;
|
||||
u8 *buffer;
|
||||
uint8_t *buffer;
|
||||
|
||||
DEBUG_JTAG_IO("scan end in %s", tap_state_name(cmd->cmd.scan->end_state));
|
||||
|
||||
@@ -379,8 +379,8 @@ static void jlink_state_move(void)
|
||||
{
|
||||
int i;
|
||||
int tms = 0;
|
||||
u8 tms_scan = tap_get_tms_path(tap_get_state(), tap_get_end_state());
|
||||
u8 tms_scan_bits = tap_get_tms_path_len(tap_get_state(), tap_get_end_state());
|
||||
uint8_t tms_scan = tap_get_tms_path(tap_get_state(), tap_get_end_state());
|
||||
uint8_t tms_scan_bits = tap_get_tms_path_len(tap_get_state(), tap_get_end_state());
|
||||
|
||||
for (i = 0; i < tms_scan_bits; i++)
|
||||
{
|
||||
@@ -447,7 +447,7 @@ static void jlink_runtest(int num_cycles)
|
||||
}
|
||||
}
|
||||
|
||||
static void jlink_scan(bool ir_scan, enum scan_type type, u8 *buffer, int scan_size, scan_command_t *command)
|
||||
static void jlink_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int scan_size, scan_command_t *command)
|
||||
{
|
||||
tap_state_t saved_end_state;
|
||||
|
||||
@@ -505,7 +505,7 @@ static void jlink_reset(int trst, int srst)
|
||||
}
|
||||
}
|
||||
|
||||
static void jlink_simple_command(u8 command)
|
||||
static void jlink_simple_command(uint8_t command)
|
||||
{
|
||||
int result;
|
||||
|
||||
@@ -670,16 +670,16 @@ static int jlink_handle_jlink_hw_jtag_command(struct command_context_s *cmd_ctx,
|
||||
|
||||
|
||||
static unsigned tap_length=0;
|
||||
static u8 tms_buffer[JLINK_TAP_BUFFER_SIZE];
|
||||
static u8 tdi_buffer[JLINK_TAP_BUFFER_SIZE];
|
||||
static u8 tdo_buffer[JLINK_TAP_BUFFER_SIZE];
|
||||
static uint8_t tms_buffer[JLINK_TAP_BUFFER_SIZE];
|
||||
static uint8_t tdi_buffer[JLINK_TAP_BUFFER_SIZE];
|
||||
static uint8_t tdo_buffer[JLINK_TAP_BUFFER_SIZE];
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int first; /* First bit position in tdo_buffer to read */
|
||||
int length; /* Number of bits to read */
|
||||
scan_command_t *command; /* Corresponding scan command */
|
||||
u8 *buffer;
|
||||
uint8_t *buffer;
|
||||
} pending_scan_result_t;
|
||||
|
||||
#define MAX_PENDING_SCAN_RESULTS 256
|
||||
@@ -716,7 +716,7 @@ static void jlink_tap_append_step(int tms, int tdi)
|
||||
}
|
||||
|
||||
int bit_index = tap_length % 8;
|
||||
u8 bit = 1 << bit_index;
|
||||
uint8_t bit = 1 << bit_index;
|
||||
|
||||
// we do not pad TMS, so be sure to initialize all bits
|
||||
if (0 == bit_index)
|
||||
@@ -737,7 +737,7 @@ static void jlink_tap_append_step(int tms, int tdi)
|
||||
tap_length++;
|
||||
}
|
||||
|
||||
static void jlink_tap_append_scan(int length, u8 *buffer, scan_command_t *command)
|
||||
static void jlink_tap_append_scan(int length, uint8_t *buffer, scan_command_t *command)
|
||||
{
|
||||
pending_scan_result_t *pending_scan_result =
|
||||
&pending_scan_results_buffer[pending_scan_results_length];
|
||||
@@ -802,7 +802,7 @@ static int jlink_tap_execute(void)
|
||||
for (i = 0; i < pending_scan_results_length; i++)
|
||||
{
|
||||
pending_scan_result_t *pending_scan_result = &pending_scan_results_buffer[i];
|
||||
u8 *buffer = pending_scan_result->buffer;
|
||||
uint8_t *buffer = pending_scan_result->buffer;
|
||||
int length = pending_scan_result->length;
|
||||
int first = pending_scan_result->first;
|
||||
scan_command_t *command = pending_scan_result->command;
|
||||
@@ -876,7 +876,7 @@ static jlink_jtag_t* jlink_usb_open()
|
||||
struct usb_interface_descriptor *desc = iface->altsetting;
|
||||
for (int i = 0; i < desc->bNumEndpoints; i++)
|
||||
{
|
||||
u8 epnum = desc->endpoint[i].bEndpointAddress;
|
||||
uint8_t epnum = desc->endpoint[i].bEndpointAddress;
|
||||
bool is_input = epnum & 0x80;
|
||||
LOG_DEBUG("usb ep %s %02x", is_input ? "in" : "out", epnum);
|
||||
if (is_input)
|
||||
@@ -1054,7 +1054,7 @@ static int jlink_usb_read_emu_result(jlink_jtag_t *jlink_jtag)
|
||||
#ifdef _DEBUG_USB_COMMS_
|
||||
#define BYTES_PER_LINE 16
|
||||
|
||||
static void jlink_debug_buffer(u8 *buffer, int length)
|
||||
static void jlink_debug_buffer(uint8_t *buffer, int length)
|
||||
{
|
||||
char line[81];
|
||||
char s[4];
|
||||
|
||||
@@ -123,21 +123,21 @@ typedef struct scan_field_s
|
||||
/// The number of bits this field specifies (up to 32)
|
||||
int num_bits;
|
||||
/// A pointer to value to be scanned into the device
|
||||
u8* out_value;
|
||||
uint8_t* out_value;
|
||||
/// A pointer to a 32-bit memory location for data scanned out
|
||||
u8* in_value;
|
||||
uint8_t* in_value;
|
||||
|
||||
/// The value used to check the data scanned out.
|
||||
u8* check_value;
|
||||
uint8_t* check_value;
|
||||
/// The mask to go with check_value
|
||||
u8* check_mask;
|
||||
uint8_t* check_mask;
|
||||
|
||||
/// in_value has been allocated for the queue
|
||||
int allocated;
|
||||
/// Indicates we modified the in_value.
|
||||
int modified;
|
||||
/// temporary storage for performing value checks synchronously
|
||||
u8 intmp[4];
|
||||
uint8_t intmp[4];
|
||||
} scan_field_t;
|
||||
|
||||
typedef struct jtag_tap_event_action_s jtag_tap_event_action_t;
|
||||
@@ -157,19 +157,19 @@ struct jtag_tap_s
|
||||
bool enabled;
|
||||
int ir_length; /**< size of instruction register */
|
||||
u32 ir_capture_value;
|
||||
u8* expected; /**< Capture-IR expected value */
|
||||
uint8_t* expected; /**< Capture-IR expected value */
|
||||
u32 ir_capture_mask;
|
||||
u8* expected_mask; /**< Capture-IR expected mask */
|
||||
uint8_t* expected_mask; /**< Capture-IR expected mask */
|
||||
u32 idcode;
|
||||
/**< device identification code */
|
||||
|
||||
/// Array of expected identification codes */
|
||||
u32* expected_ids;
|
||||
/// Number of expected identification codes
|
||||
u8 expected_ids_cnt;
|
||||
uint8_t expected_ids_cnt;
|
||||
|
||||
/// current instruction
|
||||
u8* cur_instr;
|
||||
uint8_t* cur_instr;
|
||||
/// Bypass register selected
|
||||
int bypass;
|
||||
|
||||
@@ -393,10 +393,10 @@ extern void jtag_add_plain_dr_scan(int num_fields, const scan_field_t* fields, t
|
||||
* For conversion types or checks that can fail, use the more complete
|
||||
* variant: jtag_callback_t.
|
||||
*/
|
||||
typedef void (*jtag_callback1_t)(u8 *in);
|
||||
typedef void (*jtag_callback1_t)(uint8_t *in);
|
||||
|
||||
/// A simpler version of jtag_add_callback4().
|
||||
extern void jtag_add_callback(jtag_callback1_t, u8 *in);
|
||||
extern void jtag_add_callback(jtag_callback1_t, uint8_t *in);
|
||||
|
||||
|
||||
/**
|
||||
@@ -414,7 +414,7 @@ typedef intptr_t jtag_callback_data_t;
|
||||
* @param data3 An integer big enough to use as an @c int or a pointer.
|
||||
* @returns an error code
|
||||
*/
|
||||
typedef int (*jtag_callback_t)(u8 *in, jtag_callback_data_t data1, jtag_callback_data_t data2, jtag_callback_data_t data3);
|
||||
typedef int (*jtag_callback_t)(uint8_t *in, jtag_callback_data_t data1, jtag_callback_data_t data2, jtag_callback_data_t data3);
|
||||
|
||||
|
||||
/**
|
||||
@@ -445,7 +445,7 @@ typedef int (*jtag_callback_t)(u8 *in, jtag_callback_data_t data1, jtag_callback
|
||||
* @param data3 An integer big enough to use as an @c int or a pointer.
|
||||
*
|
||||
*/
|
||||
extern void jtag_add_callback4(jtag_callback_t f, u8 *in,
|
||||
extern void jtag_add_callback4(jtag_callback_t f, uint8_t *in,
|
||||
jtag_callback_data_t data1, jtag_callback_data_t data2,
|
||||
jtag_callback_data_t data3);
|
||||
|
||||
@@ -646,7 +646,7 @@ extern int jtag_srst_asserted(int* srst_asserted);
|
||||
* @param mask Pointer to scan mask; may be NULL.
|
||||
* @returns Nothing, but calls jtag_set_error() on any error.
|
||||
*/
|
||||
extern void jtag_check_value_mask(scan_field_t *field, u8 *value, u8 *mask);
|
||||
extern void jtag_check_value_mask(scan_field_t *field, uint8_t *value, uint8_t *mask);
|
||||
|
||||
extern void jtag_sleep(u32 us);
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ static inline void interface_jtag_add_scan_check_alloc(scan_field_t *field)
|
||||
if (field->num_bits > 32)
|
||||
{
|
||||
unsigned num_bytes = TAP_SCAN_BYTES(field->num_bits);
|
||||
field->in_value = (u8 *)malloc(num_bytes);
|
||||
field->in_value = (uint8_t *)malloc(num_bytes);
|
||||
field->allocated = 1;
|
||||
}
|
||||
else
|
||||
@@ -72,22 +72,22 @@ static inline void interface_jtag_add_scan_check_alloc(scan_field_t *field)
|
||||
|
||||
static inline void interface_jtag_alloc_in_value32(scan_field_t *field)
|
||||
{
|
||||
field->in_value = (u8 *)cmd_queue_alloc(4);
|
||||
field->in_value = (uint8_t *)cmd_queue_alloc(4);
|
||||
}
|
||||
|
||||
static inline void interface_jtag_add_scan_check_alloc(scan_field_t *field)
|
||||
{
|
||||
unsigned num_bytes = TAP_SCAN_BYTES(field->num_bits);
|
||||
field->in_value = (u8 *)cmd_queue_alloc(num_bytes);
|
||||
field->in_value = (uint8_t *)cmd_queue_alloc(num_bytes);
|
||||
}
|
||||
|
||||
extern void interface_jtag_add_dr_out(jtag_tap_t* tap,
|
||||
int num_fields, const int* num_bits, const u32* value,
|
||||
tap_state_t end_state);
|
||||
|
||||
extern void interface_jtag_add_callback(jtag_callback1_t f, u8 *in);
|
||||
extern void interface_jtag_add_callback(jtag_callback1_t f, uint8_t *in);
|
||||
|
||||
extern void interface_jtag_add_callback4(jtag_callback_t f, u8 *in,
|
||||
extern void interface_jtag_add_callback4(jtag_callback_t f, uint8_t *in,
|
||||
jtag_callback_data_t data1, jtag_callback_data_t data2,
|
||||
jtag_callback_data_t data3);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user