static int svf_check_tdo(void);
static int svf_add_check_para(uint8_t enabled, int buffer_offset, int bit_len);
static int svf_run_command(struct command_context_s *cmd_ctx, char *cmd_str);
-static int handle_svf_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
static int svf_fd = 0;
static char *svf_command_buffer = NULL;
static int svf_command_buffer_size = 0;
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)
static uint8_t *svf_tdi_buffer = NULL, *svf_tdo_buffer = NULL, *svf_mask_buffer = NULL;
static int svf_quiet = 0;
-int svf_register_commands(struct command_context_s *cmd_ctx)
-{
- register_command(cmd_ctx, NULL, "svf", handle_svf_command,
- COMMAND_EXEC, "run svf <file>");
-
- return ERROR_OK;
-}
-
static void svf_free_xxd_para(svf_xxr_para_t *para)
{
if (NULL != para)
return ERROR_FAIL;
}
-static int handle_svf_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_svf_command)
{
#define SVF_NUM_OF_OPTIONS 1
- int command_num = 0, i;
+ int command_num = 0;
int ret = ERROR_OK;
long long time_ago;
// parse variant
svf_quiet = 0;
- for (i = 1; i < argc; i++)
+ for (unsigned i = 1; i < argc; i++)
{
if (!strcmp(args[i], "quiet"))
{
str_len--;
// check valid
- if (str_len > 0 || (ch & ~((1 << (4 - (bit_len % 4))) - 1)) != 0)
+ if (str_len > 0 || (ch & ~((2 << ((bit_len - 1) % 4)) - 1)) != 0)
{
- LOG_ERROR("value execede length");
+ LOG_ERROR("value execeeds length");
return ERROR_FAIL;
}
// for XXR
svf_xxr_para_t *xxr_para_tmp;
uint8_t **pbuffer_tmp;
- scan_field_t field;
+ struct scan_field field;
// for STATE
tap_state_t *path = NULL, state;
return ERROR_OK;
}
+
+int svf_register_commands(struct command_context_s *cmd_ctx)
+{
+ register_command(cmd_ctx, NULL, "svf",
+ &handle_svf_command, COMMAND_EXEC,
+ "run svf <file>");
+
+ return ERROR_OK;
+}