Conform to C99 integer types format specifiers
Review and modify to conform to C99 integer types format specifiers. Use arm-none-eabi toolchain to build successfully. Change-Id: If855072a8f88886809309155ac6d031dcfcbc4b2 Signed-off-by: Hsiangkai Wang <hsiangkai@gmail.com> Signed-off-by: Hsiangkai <hsiangkai@gmail.com> Reviewed-on: http://openocd.zylin.com/1794 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
This commit is contained in:
parent
ee019bf5f8
commit
94d64ccaeb
|
@ -98,7 +98,7 @@ int aice_init_targets(void)
|
||||||
|
|
||||||
if (found == 0) {
|
if (found == 0) {
|
||||||
LOG_ERROR
|
LOG_ERROR
|
||||||
("aice_init_targets: target not found: idcode: %x ",
|
("aice_init_targets: target not found: idcode: %" PRIx32,
|
||||||
target->tap->idcode);
|
target->tap->idcode);
|
||||||
return ERROR_FAIL;
|
return ERROR_FAIL;
|
||||||
}
|
}
|
||||||
|
@ -152,7 +152,7 @@ static int aice_execute_reset(struct jtag_command *cmd)
|
||||||
static int last_trst;
|
static int last_trst;
|
||||||
int retval = ERROR_OK;
|
int retval = ERROR_OK;
|
||||||
|
|
||||||
DEBUG_JTAG_IO("reset trst: %i", cmd->cmd.reset->trst);
|
DEBUG_JTAG_IO("reset trst: %d", cmd->cmd.reset->trst);
|
||||||
|
|
||||||
if (cmd->cmd.reset->trst != last_trst) {
|
if (cmd->cmd.reset->trst != last_trst) {
|
||||||
if (cmd->cmd.reset->trst)
|
if (cmd->cmd.reset->trst)
|
||||||
|
|
|
@ -47,7 +47,7 @@ static int aice_pipe_write(const void *buffer, int count)
|
||||||
|
|
||||||
success = WriteFile(aice_pipe_output[1], buffer, count, &written, NULL);
|
success = WriteFile(aice_pipe_output[1], buffer, count, &written, NULL);
|
||||||
if (!success) {
|
if (!success) {
|
||||||
LOG_ERROR("(WIN32) write to pipe failed, error code: 0x%08lx", GetLastError());
|
LOG_ERROR("(WIN32) write to pipe failed, error code: 0x%08l" PRIx32, GetLastError());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ static int aice_pipe_read(void *buffer, int count)
|
||||||
|
|
||||||
success = ReadFile(aice_pipe_input[0], buffer, count, &has_read, NULL);
|
success = ReadFile(aice_pipe_input[0], buffer, count, &has_read, NULL);
|
||||||
if (!success || (has_read == 0)) {
|
if (!success || (has_read == 0)) {
|
||||||
LOG_ERROR("(WIN32) read from pipe failed, error code: 0x%08lx", GetLastError());
|
LOG_ERROR("(WIN32) read from pipe failed, error code: 0x%08l" PRIx32, GetLastError());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -35,66 +35,6 @@
|
||||||
#define AICE_IN_PACK_COMMAND_SIZE 2048
|
#define AICE_IN_PACK_COMMAND_SIZE 2048
|
||||||
#define AICE_OUT_PACK_COMMAND_SIZE 2048
|
#define AICE_OUT_PACK_COMMAND_SIZE 2048
|
||||||
|
|
||||||
/* Constants for AICE command */
|
|
||||||
#define AICE_CMD_SCAN_CHAIN 0x00
|
|
||||||
#define AICE_CMD_SELECT_TARGET 0x01
|
|
||||||
#define AICE_CMD_READ_DIM 0x02
|
|
||||||
#define AICE_CMD_READ_EDMSR 0x03
|
|
||||||
#define AICE_CMD_READ_DTR 0x04
|
|
||||||
#define AICE_CMD_READ_MEM 0x05
|
|
||||||
#define AICE_CMD_READ_MISC 0x06
|
|
||||||
#define AICE_CMD_FASTREAD_MEM 0x07
|
|
||||||
#define AICE_CMD_WRITE_DIM 0x08
|
|
||||||
#define AICE_CMD_WRITE_EDMSR 0x09
|
|
||||||
#define AICE_CMD_WRITE_DTR 0x0A
|
|
||||||
#define AICE_CMD_WRITE_MEM 0x0B
|
|
||||||
#define AICE_CMD_WRITE_MISC 0x0C
|
|
||||||
#define AICE_CMD_FASTWRITE_MEM 0x0D
|
|
||||||
#define AICE_CMD_EXECUTE 0x0E
|
|
||||||
#define AICE_CMD_READ_MEM_B 0x14
|
|
||||||
#define AICE_CMD_READ_MEM_H 0x15
|
|
||||||
#define AICE_CMD_T_READ_MISC 0x20
|
|
||||||
#define AICE_CMD_T_READ_EDMSR 0x21
|
|
||||||
#define AICE_CMD_T_READ_DTR 0x22
|
|
||||||
#define AICE_CMD_T_READ_DIM 0x23
|
|
||||||
#define AICE_CMD_T_READ_MEM_B 0x24
|
|
||||||
#define AICE_CMD_T_READ_MEM_H 0x25
|
|
||||||
#define AICE_CMD_T_READ_MEM 0x26
|
|
||||||
#define AICE_CMD_T_FASTREAD_MEM 0x27
|
|
||||||
#define AICE_CMD_T_WRITE_MISC 0x28
|
|
||||||
#define AICE_CMD_T_WRITE_EDMSR 0x29
|
|
||||||
#define AICE_CMD_T_WRITE_DTR 0x2A
|
|
||||||
#define AICE_CMD_T_WRITE_DIM 0x2B
|
|
||||||
#define AICE_CMD_T_WRITE_MEM_B 0x2C
|
|
||||||
#define AICE_CMD_T_WRITE_MEM_H 0x2D
|
|
||||||
#define AICE_CMD_T_WRITE_MEM 0x2E
|
|
||||||
#define AICE_CMD_T_FASTWRITE_MEM 0x2F
|
|
||||||
#define AICE_CMD_T_GET_TRACE_STATUS 0x36
|
|
||||||
#define AICE_CMD_T_EXECUTE 0x3E
|
|
||||||
#define AICE_CMD_AICE_PROGRAM_READ 0x40
|
|
||||||
#define AICE_CMD_AICE_PROGRAM_WRITE 0x41
|
|
||||||
#define AICE_CMD_AICE_PROGRAM_CONTROL 0x42
|
|
||||||
#define AICE_CMD_READ_CTRL 0x50
|
|
||||||
#define AICE_CMD_WRITE_CTRL 0x51
|
|
||||||
#define AICE_CMD_BATCH_BUFFER_READ 0x60
|
|
||||||
#define AICE_CMD_READ_DTR_TO_BUFFER 0x61
|
|
||||||
#define AICE_CMD_BATCH_BUFFER_WRITE 0x68
|
|
||||||
#define AICE_CMD_WRITE_DTR_FROM_BUFFER 0x69
|
|
||||||
|
|
||||||
/* Constants for AICE command format length */
|
|
||||||
#define AICE_FORMAT_HTDA 3
|
|
||||||
#define AICE_FORMAT_HTDB 6
|
|
||||||
#define AICE_FORMAT_HTDC 7
|
|
||||||
#define AICE_FORMAT_HTDD 10
|
|
||||||
#define AICE_FORMAT_HTDMA 4
|
|
||||||
#define AICE_FORMAT_HTDMB 8
|
|
||||||
#define AICE_FORMAT_HTDMC 8
|
|
||||||
#define AICE_FORMAT_HTDMD 12
|
|
||||||
#define AICE_FORMAT_DTHA 6
|
|
||||||
#define AICE_FORMAT_DTHB 2
|
|
||||||
#define AICE_FORMAT_DTHMA 8
|
|
||||||
#define AICE_FORMAT_DTHMB 4
|
|
||||||
|
|
||||||
/* Constants for AICE command READ_CTRL */
|
/* Constants for AICE command READ_CTRL */
|
||||||
#define AICE_READ_CTRL_GET_ICE_STATE 0x00
|
#define AICE_READ_CTRL_GET_ICE_STATE 0x00
|
||||||
#define AICE_READ_CTRL_GET_HARDWARE_VERSION 0x01
|
#define AICE_READ_CTRL_GET_HARDWARE_VERSION 0x01
|
||||||
|
|
|
@ -464,7 +464,7 @@ static int jlink_select_interface(int iface)
|
||||||
uint32_t iface_mask = buf_get_u32(usb_in_buffer, 0, 32);
|
uint32_t iface_mask = buf_get_u32(usb_in_buffer, 0, 32);
|
||||||
|
|
||||||
if (!(iface_mask & (1<<iface))) {
|
if (!(iface_mask & (1<<iface))) {
|
||||||
LOG_ERROR("J-Link requesting to select unsupported interface (%x)", iface_mask);
|
LOG_ERROR("J-Link requesting to select unsupported interface (%" PRIx32 ")", iface_mask);
|
||||||
return ERROR_JTAG_DEVICE_ERROR;
|
return ERROR_JTAG_DEVICE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -746,7 +746,7 @@ static void jlink_config_kickstart_dump(struct command_context *ctx, struct jlin
|
||||||
if (!cfg)
|
if (!cfg)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
jlink_dump_printf(ctx, "Kickstart power on JTAG-pin 19: 0x%x",
|
jlink_dump_printf(ctx, "Kickstart power on JTAG-pin 19: 0x%" PRIx32,
|
||||||
cfg->kickstart_power_on_jtag_pin_19);
|
cfg->kickstart_power_on_jtag_pin_19);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -920,7 +920,7 @@ static int jlink_get_version_info(void)
|
||||||
LOG_INFO("J-Link hw version %i", (int)jlink_hw_version);
|
LOG_INFO("J-Link hw version %i", (int)jlink_hw_version);
|
||||||
|
|
||||||
if (jlink_hw_type >= JLINK_HW_TYPE_MAX)
|
if (jlink_hw_type >= JLINK_HW_TYPE_MAX)
|
||||||
LOG_INFO("J-Link hw type uknown 0x%x", jlink_hw_type);
|
LOG_INFO("J-Link hw type uknown 0x%" PRIx32, jlink_hw_type);
|
||||||
else
|
else
|
||||||
LOG_INFO("J-Link hw type %s", jlink_hw_type_str[jlink_hw_type]);
|
LOG_INFO("J-Link hw type %s", jlink_hw_type_str[jlink_hw_type]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -307,7 +307,7 @@ static int opendous_execute_queue(void)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case JTAG_SLEEP:
|
case JTAG_SLEEP:
|
||||||
DEBUG_JTAG_IO("sleep %i", cmd->cmd.sleep->us);
|
DEBUG_JTAG_IO("sleep %" PRIi32, cmd->cmd.sleep->us);
|
||||||
opendous_tap_execute();
|
opendous_tap_execute();
|
||||||
jtag_sleep(cmd->cmd.sleep->us);
|
jtag_sleep(cmd->cmd.sleep->us);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -431,7 +431,7 @@ static int osbdm_add_statemove(
|
||||||
int skip_first)
|
int skip_first)
|
||||||
{
|
{
|
||||||
int len = 0;
|
int len = 0;
|
||||||
int tms;
|
int tms = 0;
|
||||||
|
|
||||||
tap_set_end_state(new_state);
|
tap_set_end_state(new_state);
|
||||||
if (tap_get_end_state() == TAP_RESET) {
|
if (tap_get_end_state() == TAP_RESET) {
|
||||||
|
|
|
@ -738,7 +738,7 @@ static int stlink_usb_idcode(void *handle, uint32_t *idcode)
|
||||||
|
|
||||||
*idcode = le_to_h_u32(h->databuf);
|
*idcode = le_to_h_u32(h->databuf);
|
||||||
|
|
||||||
LOG_DEBUG("IDCODE: 0x%08X", *idcode);
|
LOG_DEBUG("IDCODE: 0x%08" PRIX32, *idcode);
|
||||||
|
|
||||||
return ERROR_OK;
|
return ERROR_OK;
|
||||||
}
|
}
|
||||||
|
@ -1043,7 +1043,7 @@ static int stlink_usb_trace_enable(void *handle)
|
||||||
|
|
||||||
if (res == ERROR_OK) {
|
if (res == ERROR_OK) {
|
||||||
h->trace.enabled = true;
|
h->trace.enabled = true;
|
||||||
LOG_DEBUG("Tracing: recording at %uHz\n", trace_hz);
|
LOG_DEBUG("Tracing: recording at %" PRIu32 "Hz\n", trace_hz);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOG_ERROR("Tracing is not supported by this version.");
|
LOG_ERROR("Tracing is not supported by this version.");
|
||||||
|
|
|
@ -368,12 +368,12 @@ static int icdi_usb_query(void *handle)
|
||||||
char *separator;
|
char *separator;
|
||||||
int max_packet;
|
int max_packet;
|
||||||
|
|
||||||
max_packet = strtoul(offset + 11, &separator, 16);
|
max_packet = strtol(offset + 11, &separator, 16);
|
||||||
if (!max_packet)
|
if (!max_packet)
|
||||||
LOG_ERROR("invalid max packet, using defaults");
|
LOG_ERROR("invalid max packet, using defaults");
|
||||||
else
|
else
|
||||||
h->max_packet = max_packet;
|
h->max_packet = max_packet;
|
||||||
LOG_DEBUG("max packet supported : %" PRIu32 " bytes", h->max_packet);
|
LOG_DEBUG("max packet supported : %i bytes", h->max_packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -536,7 +536,7 @@ static int icdi_usb_read_mem_int(void *handle, uint32_t addr, uint32_t len, uint
|
||||||
struct icdi_usb_handle_s *h = handle;
|
struct icdi_usb_handle_s *h = handle;
|
||||||
char cmd[20];
|
char cmd[20];
|
||||||
|
|
||||||
snprintf(cmd, sizeof(cmd), "x%x,%x", addr, len);
|
snprintf(cmd, sizeof(cmd), "x%" PRIx32 ",%" PRIx32, addr, len);
|
||||||
result = icdi_send_cmd(handle, cmd);
|
result = icdi_send_cmd(handle, cmd);
|
||||||
if (result != ERROR_OK)
|
if (result != ERROR_OK)
|
||||||
return result;
|
return result;
|
||||||
|
@ -551,7 +551,7 @@ static int icdi_usb_read_mem_int(void *handle, uint32_t addr, uint32_t len, uint
|
||||||
/* unescape input */
|
/* unescape input */
|
||||||
int read_len = remote_unescape_input(h->read_buffer + 5, h->read_count - 8, (char *)buffer, len);
|
int read_len = remote_unescape_input(h->read_buffer + 5, h->read_count - 8, (char *)buffer, len);
|
||||||
if (read_len != (int)len) {
|
if (read_len != (int)len) {
|
||||||
LOG_ERROR("read more bytes than expected: actual 0x%" PRIx32 " expected 0x%" PRIx32, read_len, len);
|
LOG_ERROR("read more bytes than expected: actual 0x%x expected 0x%" PRIx32, read_len, len);
|
||||||
return ERROR_FAIL;
|
return ERROR_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -563,7 +563,7 @@ static int icdi_usb_write_mem_int(void *handle, uint32_t addr, uint32_t len, con
|
||||||
int result;
|
int result;
|
||||||
struct icdi_usb_handle_s *h = handle;
|
struct icdi_usb_handle_s *h = handle;
|
||||||
|
|
||||||
size_t cmd_len = snprintf(h->write_buffer, h->max_packet, PACKET_START "X%x,%x:", addr, len);
|
size_t cmd_len = snprintf(h->write_buffer, h->max_packet, PACKET_START "X%" PRIx32 ",%" PRIx32 ":", addr, len);
|
||||||
|
|
||||||
int out_len;
|
int out_len;
|
||||||
cmd_len += remote_escape_output((const char *)buffer, len, h->write_buffer + cmd_len,
|
cmd_len += remote_escape_output((const char *)buffer, len, h->write_buffer + cmd_len,
|
||||||
|
@ -571,7 +571,7 @@ static int icdi_usb_write_mem_int(void *handle, uint32_t addr, uint32_t len, con
|
||||||
|
|
||||||
if (out_len < (int)len) {
|
if (out_len < (int)len) {
|
||||||
/* for now issue a error as we have no way of allocating a larger buffer */
|
/* for now issue a error as we have no way of allocating a larger buffer */
|
||||||
LOG_ERROR("memory buffer too small: requires 0x%" PRIx32 " actual 0x%" PRIx32, out_len, len);
|
LOG_ERROR("memory buffer too small: requires 0x%x actual 0x%" PRIx32, out_len, len);
|
||||||
return ERROR_FAIL;
|
return ERROR_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ int hl_interface_init_target(struct target *t)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (found == 0) {
|
if (found == 0) {
|
||||||
LOG_ERROR("hl_interface_init_target: target not found: idcode: 0x%08x",
|
LOG_ERROR("hl_interface_init_target: target not found: idcode: 0x%08" PRIx32,
|
||||||
t->tap->idcode);
|
t->tap->idcode);
|
||||||
return ERROR_FAIL;
|
return ERROR_FAIL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,7 +160,7 @@ int fill_buffer(struct target *target, uint32_t addr, uint8_t *buffer)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ((addr & 0xfffffffc) != addr)
|
if ((addr & 0xfffffffc) != addr)
|
||||||
LOG_INFO("unaligned address %x!!", addr);
|
LOG_INFO("unaligned address %" PRIx32 "!!", addr);
|
||||||
|
|
||||||
int retval = linux_read_memory(target, addr, 4, 1, buffer);
|
int retval = linux_read_memory(target, addr, 4, 1, buffer);
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -217,7 +217,7 @@ static int linux_os_thread_reg_list(struct rtos *rtos,
|
||||||
if (found == 0) {
|
if (found == 0) {
|
||||||
LOG_ERROR
|
LOG_ERROR
|
||||||
(
|
(
|
||||||
"current thread %" PRIx64 ": no target to perform access of core id %x",
|
"current thread %" PRIx64 ": no target to perform access of core id %" PRIx32,
|
||||||
thread_id,
|
thread_id,
|
||||||
next->core_id);
|
next->core_id);
|
||||||
return ERROR_FAIL;
|
return ERROR_FAIL;
|
||||||
|
@ -1571,14 +1571,14 @@ static char *linux_ps_command(struct target *target)
|
||||||
if (temp->context)
|
if (temp->context)
|
||||||
tmp +=
|
tmp +=
|
||||||
sprintf(tmp,
|
sprintf(tmp,
|
||||||
"%d\t\t%d\t\t%x\t\t%s\n",
|
"%" PRId32 "\t\t%" PRId32 "\t\t%" PRIx32 "\t\t%s\n",
|
||||||
(int)temp->pid, temp->oncpu,
|
temp->pid, temp->oncpu,
|
||||||
temp->asid, temp->name);
|
temp->asid, temp->name);
|
||||||
else
|
else
|
||||||
tmp +=
|
tmp +=
|
||||||
sprintf(tmp,
|
sprintf(tmp,
|
||||||
"%d\t\t%d\t\t%x\t\t%s\n",
|
"%" PRId32 "\t\t%" PRId32 "\t\t%" PRIx32 "\t\t%s\n",
|
||||||
(int)temp->pid, temp->oncpu,
|
temp->pid, temp->oncpu,
|
||||||
temp->asid, temp->name);
|
temp->asid, temp->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -728,15 +728,15 @@ static void gdb_signal_reply(struct target *target, struct connection *connectio
|
||||||
switch (hit_wp_type) {
|
switch (hit_wp_type) {
|
||||||
case WPT_WRITE:
|
case WPT_WRITE:
|
||||||
snprintf(stop_reason, sizeof(stop_reason),
|
snprintf(stop_reason, sizeof(stop_reason),
|
||||||
"watch:%08x;", hit_wp_address);
|
"watch:%08" PRIx32 ";", hit_wp_address);
|
||||||
break;
|
break;
|
||||||
case WPT_READ:
|
case WPT_READ:
|
||||||
snprintf(stop_reason, sizeof(stop_reason),
|
snprintf(stop_reason, sizeof(stop_reason),
|
||||||
"rwatch:%08x;", hit_wp_address);
|
"rwatch:%08" PRIx32 ";", hit_wp_address);
|
||||||
break;
|
break;
|
||||||
case WPT_ACCESS:
|
case WPT_ACCESS:
|
||||||
snprintf(stop_reason, sizeof(stop_reason),
|
snprintf(stop_reason, sizeof(stop_reason),
|
||||||
"awatch:%08x;", hit_wp_address);
|
"awatch:%08" PRIx32 ";", hit_wp_address);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -761,64 +761,64 @@ static void gdb_fileio_reply(struct target *target, struct connection *connectio
|
||||||
bool program_exited = false;
|
bool program_exited = false;
|
||||||
|
|
||||||
if (strcmp(target->fileio_info->identifier, "open") == 0)
|
if (strcmp(target->fileio_info->identifier, "open") == 0)
|
||||||
sprintf(fileio_command, "F%s,%x/%x,%x,%x", target->fileio_info->identifier,
|
sprintf(fileio_command, "F%s,%" PRIx32 "/%" PRIx32 ",%" PRIx32 ",%" PRIx32, target->fileio_info->identifier,
|
||||||
target->fileio_info->param_1,
|
target->fileio_info->param_1,
|
||||||
target->fileio_info->param_2,
|
target->fileio_info->param_2,
|
||||||
target->fileio_info->param_3,
|
target->fileio_info->param_3,
|
||||||
target->fileio_info->param_4);
|
target->fileio_info->param_4);
|
||||||
else if (strcmp(target->fileio_info->identifier, "close") == 0)
|
else if (strcmp(target->fileio_info->identifier, "close") == 0)
|
||||||
sprintf(fileio_command, "F%s,%x", target->fileio_info->identifier,
|
sprintf(fileio_command, "F%s,%" PRIx32, target->fileio_info->identifier,
|
||||||
target->fileio_info->param_1);
|
target->fileio_info->param_1);
|
||||||
else if (strcmp(target->fileio_info->identifier, "read") == 0)
|
else if (strcmp(target->fileio_info->identifier, "read") == 0)
|
||||||
sprintf(fileio_command, "F%s,%x,%x,%x", target->fileio_info->identifier,
|
sprintf(fileio_command, "F%s,%" PRIx32 ",%" PRIx32 ",%" PRIx32, target->fileio_info->identifier,
|
||||||
target->fileio_info->param_1,
|
target->fileio_info->param_1,
|
||||||
target->fileio_info->param_2,
|
target->fileio_info->param_2,
|
||||||
target->fileio_info->param_3);
|
target->fileio_info->param_3);
|
||||||
else if (strcmp(target->fileio_info->identifier, "write") == 0)
|
else if (strcmp(target->fileio_info->identifier, "write") == 0)
|
||||||
sprintf(fileio_command, "F%s,%x,%x,%x", target->fileio_info->identifier,
|
sprintf(fileio_command, "F%s,%" PRIx32 ",%" PRIx32 ",%" PRIx32, target->fileio_info->identifier,
|
||||||
target->fileio_info->param_1,
|
target->fileio_info->param_1,
|
||||||
target->fileio_info->param_2,
|
target->fileio_info->param_2,
|
||||||
target->fileio_info->param_3);
|
target->fileio_info->param_3);
|
||||||
else if (strcmp(target->fileio_info->identifier, "lseek") == 0)
|
else if (strcmp(target->fileio_info->identifier, "lseek") == 0)
|
||||||
sprintf(fileio_command, "F%s,%x,%x,%x", target->fileio_info->identifier,
|
sprintf(fileio_command, "F%s,%" PRIx32 ",%" PRIx32 ",%" PRIx32, target->fileio_info->identifier,
|
||||||
target->fileio_info->param_1,
|
target->fileio_info->param_1,
|
||||||
target->fileio_info->param_2,
|
target->fileio_info->param_2,
|
||||||
target->fileio_info->param_3);
|
target->fileio_info->param_3);
|
||||||
else if (strcmp(target->fileio_info->identifier, "rename") == 0)
|
else if (strcmp(target->fileio_info->identifier, "rename") == 0)
|
||||||
sprintf(fileio_command, "F%s,%x/%x,%x/%x", target->fileio_info->identifier,
|
sprintf(fileio_command, "F%s,%" PRIx32 "/%" PRIx32 ",%" PRIx32 "/%" PRIx32, target->fileio_info->identifier,
|
||||||
target->fileio_info->param_1,
|
target->fileio_info->param_1,
|
||||||
target->fileio_info->param_2,
|
target->fileio_info->param_2,
|
||||||
target->fileio_info->param_3,
|
target->fileio_info->param_3,
|
||||||
target->fileio_info->param_4);
|
target->fileio_info->param_4);
|
||||||
else if (strcmp(target->fileio_info->identifier, "unlink") == 0)
|
else if (strcmp(target->fileio_info->identifier, "unlink") == 0)
|
||||||
sprintf(fileio_command, "F%s,%x/%x", target->fileio_info->identifier,
|
sprintf(fileio_command, "F%s,%" PRIx32 "/%" PRIx32, target->fileio_info->identifier,
|
||||||
target->fileio_info->param_1,
|
target->fileio_info->param_1,
|
||||||
target->fileio_info->param_2);
|
target->fileio_info->param_2);
|
||||||
else if (strcmp(target->fileio_info->identifier, "stat") == 0)
|
else if (strcmp(target->fileio_info->identifier, "stat") == 0)
|
||||||
sprintf(fileio_command, "F%s,%x/%x,%x", target->fileio_info->identifier,
|
sprintf(fileio_command, "F%s,%" PRIx32 "/%" PRIx32 ",%" PRIx32, target->fileio_info->identifier,
|
||||||
target->fileio_info->param_1,
|
target->fileio_info->param_1,
|
||||||
target->fileio_info->param_2,
|
target->fileio_info->param_2,
|
||||||
target->fileio_info->param_3);
|
target->fileio_info->param_3);
|
||||||
else if (strcmp(target->fileio_info->identifier, "fstat") == 0)
|
else if (strcmp(target->fileio_info->identifier, "fstat") == 0)
|
||||||
sprintf(fileio_command, "F%s,%x,%x", target->fileio_info->identifier,
|
sprintf(fileio_command, "F%s,%" PRIx32 ",%" PRIx32, target->fileio_info->identifier,
|
||||||
target->fileio_info->param_1,
|
target->fileio_info->param_1,
|
||||||
target->fileio_info->param_2);
|
target->fileio_info->param_2);
|
||||||
else if (strcmp(target->fileio_info->identifier, "gettimeofday") == 0)
|
else if (strcmp(target->fileio_info->identifier, "gettimeofday") == 0)
|
||||||
sprintf(fileio_command, "F%s,%x,%x", target->fileio_info->identifier,
|
sprintf(fileio_command, "F%s,%" PRIx32 ",%" PRIx32, target->fileio_info->identifier,
|
||||||
target->fileio_info->param_1,
|
target->fileio_info->param_1,
|
||||||
target->fileio_info->param_2);
|
target->fileio_info->param_2);
|
||||||
else if (strcmp(target->fileio_info->identifier, "isatty") == 0)
|
else if (strcmp(target->fileio_info->identifier, "isatty") == 0)
|
||||||
sprintf(fileio_command, "F%s,%x", target->fileio_info->identifier,
|
sprintf(fileio_command, "F%s,%" PRIx32, target->fileio_info->identifier,
|
||||||
target->fileio_info->param_1);
|
target->fileio_info->param_1);
|
||||||
else if (strcmp(target->fileio_info->identifier, "system") == 0)
|
else if (strcmp(target->fileio_info->identifier, "system") == 0)
|
||||||
sprintf(fileio_command, "F%s,%x/%x", target->fileio_info->identifier,
|
sprintf(fileio_command, "F%s,%" PRIx32 "/%" PRIx32, target->fileio_info->identifier,
|
||||||
target->fileio_info->param_1,
|
target->fileio_info->param_1,
|
||||||
target->fileio_info->param_2);
|
target->fileio_info->param_2);
|
||||||
else if (strcmp(target->fileio_info->identifier, "exit") == 0) {
|
else if (strcmp(target->fileio_info->identifier, "exit") == 0) {
|
||||||
/* If target hits exit syscall, report to GDB the program is terminated.
|
/* If target hits exit syscall, report to GDB the program is terminated.
|
||||||
* In addition, let target run its own exit syscall handler. */
|
* In addition, let target run its own exit syscall handler. */
|
||||||
program_exited = true;
|
program_exited = true;
|
||||||
sprintf(fileio_command, "W%02x", target->fileio_info->param_1);
|
sprintf(fileio_command, "W%02" PRIx32, target->fileio_info->param_1);
|
||||||
} else {
|
} else {
|
||||||
LOG_DEBUG("Unknown syscall: %s", target->fileio_info->identifier);
|
LOG_DEBUG("Unknown syscall: %s", target->fileio_info->identifier);
|
||||||
|
|
||||||
|
|
|
@ -1545,8 +1545,8 @@ int nds32_restore_context(struct target *target)
|
||||||
if (reg->valid == true) {
|
if (reg->valid == true) {
|
||||||
|
|
||||||
LOG_DEBUG("examining dirty reg: %s", reg->name);
|
LOG_DEBUG("examining dirty reg: %s", reg->name);
|
||||||
LOG_DEBUG("writing register %i "
|
LOG_DEBUG("writing register %d with value 0x%8.8" PRIx32,
|
||||||
"with value 0x%8.8" PRIx32, i, buf_get_u32(reg->value, 0, 32));
|
i, buf_get_u32(reg->value, 0, 32));
|
||||||
|
|
||||||
reg_arch_info = reg->arch_info;
|
reg_arch_info = reg->arch_info;
|
||||||
if (FD0 <= reg_arch_info->num && reg_arch_info->num <= FD31)
|
if (FD0 <= reg_arch_info->num && reg_arch_info->num <= FD31)
|
||||||
|
@ -2118,7 +2118,9 @@ int nds32_poll(struct target *target)
|
||||||
int nds32_resume(struct target *target, int current,
|
int nds32_resume(struct target *target, int current,
|
||||||
uint32_t address, int handle_breakpoints, int debug_execution)
|
uint32_t address, int handle_breakpoints, int debug_execution)
|
||||||
{
|
{
|
||||||
LOG_DEBUG("current %d address %08" PRIx32 " handle_breakpoints %d debug_execution %d",
|
LOG_DEBUG("current %d address %08" PRIx32
|
||||||
|
" handle_breakpoints %d"
|
||||||
|
" debug_execution %d",
|
||||||
current, address, handle_breakpoints, debug_execution);
|
current, address, handle_breakpoints, debug_execution);
|
||||||
|
|
||||||
struct nds32 *nds32 = target_to_nds32(target);
|
struct nds32 *nds32 = target_to_nds32(target);
|
||||||
|
@ -2465,7 +2467,7 @@ int nds32_get_gdb_fileio_info(struct target *target, struct gdb_fileio_info *fil
|
||||||
|
|
||||||
int nds32_gdb_fileio_end(struct target *target, int retcode, int fileio_errno, bool ctrl_c)
|
int nds32_gdb_fileio_end(struct target *target, int retcode, int fileio_errno, bool ctrl_c)
|
||||||
{
|
{
|
||||||
LOG_DEBUG("syscall return code: 0x%x, errno: 0x%x, ctrl_c: %s",
|
LOG_DEBUG("syscall return code: 0x%x, errno: 0x%x , ctrl_c: %s",
|
||||||
retcode, fileio_errno, ctrl_c ? "true" : "false");
|
retcode, fileio_errno, ctrl_c ? "true" : "false");
|
||||||
|
|
||||||
struct nds32 *nds32 = target_to_nds32(target);
|
struct nds32 *nds32 = target_to_nds32(target);
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -114,7 +114,7 @@ static int nds32_v2_activate_hardware_breakpoint(struct target *target)
|
||||||
/* enable breakpoint (physical address) */
|
/* enable breakpoint (physical address) */
|
||||||
aice_write_debug_reg(aice, NDS_EDM_SR_BPC0 + hbr_index, 0xA);
|
aice_write_debug_reg(aice, NDS_EDM_SR_BPC0 + hbr_index, 0xA);
|
||||||
|
|
||||||
LOG_DEBUG("Add hardware BP %d at %08" PRIx32, hbr_index,
|
LOG_DEBUG("Add hardware BP %" PRId32 " at %08" PRIx32, hbr_index,
|
||||||
bp->address);
|
bp->address);
|
||||||
|
|
||||||
hbr_index++;
|
hbr_index++;
|
||||||
|
@ -141,7 +141,7 @@ static int nds32_v2_deactivate_hardware_breakpoint(struct target *target)
|
||||||
else
|
else
|
||||||
return ERROR_FAIL;
|
return ERROR_FAIL;
|
||||||
|
|
||||||
LOG_DEBUG("Remove hardware BP %d at %08" PRIx32, hbr_index,
|
LOG_DEBUG("Remove hardware BP %" PRId32 " at %08" PRIx32, hbr_index,
|
||||||
bp->address);
|
bp->address);
|
||||||
|
|
||||||
hbr_index++;
|
hbr_index++;
|
||||||
|
@ -186,7 +186,7 @@ static int nds32_v2_activate_hardware_watchpoint(struct target *target)
|
||||||
/* set value */
|
/* set value */
|
||||||
aice_write_debug_reg(aice, NDS_EDM_SR_BPV0 + wp_num, 0);
|
aice_write_debug_reg(aice, NDS_EDM_SR_BPV0 + wp_num, 0);
|
||||||
|
|
||||||
LOG_DEBUG("Add hardware wathcpoint %d at %08" PRIx32 " mask %08" PRIx32, wp_num,
|
LOG_DEBUG("Add hardware wathcpoint %" PRId32 " at %08" PRIx32 " mask %08" PRIx32, wp_num,
|
||||||
wp->address, wp->mask);
|
wp->address, wp->mask);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -206,7 +206,7 @@ static int nds32_v2_deactivate_hardware_watchpoint(struct target *target)
|
||||||
/* disable watchpoint */
|
/* disable watchpoint */
|
||||||
aice_write_debug_reg(aice, NDS_EDM_SR_BPC0 + wp_num, 0x0);
|
aice_write_debug_reg(aice, NDS_EDM_SR_BPC0 + wp_num, 0x0);
|
||||||
|
|
||||||
LOG_DEBUG("Remove hardware wathcpoint %d at %08" PRIx32 " mask %08" PRIx32,
|
LOG_DEBUG("Remove hardware wathcpoint %" PRId32 " at %08" PRIx32 " mask %08" PRIx32,
|
||||||
wp_num, wp->address, wp->mask);
|
wp_num, wp->address, wp->mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,7 +231,7 @@ static int nds32_v2_check_interrupt_stack(struct nds32_v2_common *nds32_v2)
|
||||||
nds32->current_interrupt_level = (val_ir0 >> 1) & 0x3;
|
nds32->current_interrupt_level = (val_ir0 >> 1) & 0x3;
|
||||||
|
|
||||||
if (nds32_reach_max_interrupt_level(nds32)) {
|
if (nds32_reach_max_interrupt_level(nds32)) {
|
||||||
LOG_ERROR("<-- TARGET ERROR! Reaching the max interrupt stack level %d. -->",
|
LOG_ERROR("<-- TARGET ERROR! Reaching the max interrupt stack level %" PRIu32 ". -->",
|
||||||
nds32->current_interrupt_level);
|
nds32->current_interrupt_level);
|
||||||
|
|
||||||
/* decrease interrupt level */
|
/* decrease interrupt level */
|
||||||
|
@ -427,7 +427,7 @@ static int nds32_v2_add_breakpoint(struct target *target,
|
||||||
LOG_WARNING("<-- TARGET WARNING! Insert too many hardware "
|
LOG_WARNING("<-- TARGET WARNING! Insert too many hardware "
|
||||||
"breakpoints/watchpoints! The limit of "
|
"breakpoints/watchpoints! The limit of "
|
||||||
"combined hardware breakpoints/watchpoints "
|
"combined hardware breakpoints/watchpoints "
|
||||||
"is %d. -->", nds32_v2->n_hbr);
|
"is %" PRId32 ". -->", nds32_v2->n_hbr);
|
||||||
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
|
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -486,7 +486,7 @@ static int nds32_v2_add_watchpoint(struct target *target,
|
||||||
if (nds32_v2->n_hbr <= nds32_v2->next_hbr_index) {
|
if (nds32_v2->n_hbr <= nds32_v2->next_hbr_index) {
|
||||||
LOG_WARNING("<-- TARGET WARNING! Insert too many hardware "
|
LOG_WARNING("<-- TARGET WARNING! Insert too many hardware "
|
||||||
"breakpoints/watchpoints! The limit of "
|
"breakpoints/watchpoints! The limit of "
|
||||||
"combined hardware breakpoints/watchpoints is %d. -->", nds32_v2->n_hbr);
|
"combined hardware breakpoints/watchpoints is %" PRId32 ". -->", nds32_v2->n_hbr);
|
||||||
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
|
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -626,7 +626,7 @@ static int nds32_v2_examine(struct target *target)
|
||||||
|
|
||||||
nds32_v2->next_hbr_index = 0;
|
nds32_v2->next_hbr_index = 0;
|
||||||
|
|
||||||
LOG_INFO("%s: total hardware breakpoint %d", target_name(target),
|
LOG_INFO("%s: total hardware breakpoint %" PRId32, target_name(target),
|
||||||
nds32_v2->n_hbr);
|
nds32_v2->n_hbr);
|
||||||
|
|
||||||
nds32->target->state = TARGET_RUNNING;
|
nds32->target->state = TARGET_RUNNING;
|
||||||
|
|
|
@ -55,7 +55,7 @@ static int nds32_v3_activate_hardware_breakpoint(struct target *target)
|
||||||
/* enable breakpoint (physical address) */
|
/* enable breakpoint (physical address) */
|
||||||
aice_write_debug_reg(aice, NDS_EDM_SR_BPC0 + hbr_index, 0xA);
|
aice_write_debug_reg(aice, NDS_EDM_SR_BPC0 + hbr_index, 0xA);
|
||||||
|
|
||||||
LOG_DEBUG("Add hardware BP %d at %08" PRIx32, hbr_index,
|
LOG_DEBUG("Add hardware BP %" PRId32 " at %08" PRIx32, hbr_index,
|
||||||
bp->address);
|
bp->address);
|
||||||
} else {
|
} else {
|
||||||
return ERROR_FAIL;
|
return ERROR_FAIL;
|
||||||
|
@ -83,7 +83,7 @@ static int nds32_v3_deactivate_hardware_breakpoint(struct target *target)
|
||||||
return ERROR_FAIL;
|
return ERROR_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_DEBUG("Remove hardware BP %d at %08" PRIx32, hbr_index,
|
LOG_DEBUG("Remove hardware BP %" PRId32 " at %08" PRIx32, hbr_index,
|
||||||
bp->address);
|
bp->address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ static int nds32_v3_activate_hardware_watchpoint(struct target *target)
|
||||||
/* set value */
|
/* set value */
|
||||||
aice_write_debug_reg(aice, NDS_EDM_SR_BPV0 + wp_num, 0);
|
aice_write_debug_reg(aice, NDS_EDM_SR_BPV0 + wp_num, 0);
|
||||||
|
|
||||||
LOG_DEBUG("Add hardware wathcpoint %d at %08" PRIx32 " mask %08" PRIx32,
|
LOG_DEBUG("Add hardware wathcpoint %" PRId32 " at %08" PRIx32 " mask %08" PRIx32,
|
||||||
wp_num, wp->address, wp->mask);
|
wp_num, wp->address, wp->mask);
|
||||||
|
|
||||||
wp_num++;
|
wp_num++;
|
||||||
|
@ -171,7 +171,7 @@ static int nds32_v3_deactivate_hardware_watchpoint(struct target *target)
|
||||||
/* disable watchpoint */
|
/* disable watchpoint */
|
||||||
aice_write_debug_reg(aice, NDS_EDM_SR_BPC0 + wp_num, 0x0);
|
aice_write_debug_reg(aice, NDS_EDM_SR_BPC0 + wp_num, 0x0);
|
||||||
|
|
||||||
LOG_DEBUG("Remove hardware wathcpoint %d at %08" PRIx32
|
LOG_DEBUG("Remove hardware wathcpoint %" PRId32 " at %08" PRIx32
|
||||||
" mask %08" PRIx32, wp_num,
|
" mask %08" PRIx32, wp_num,
|
||||||
wp->address, wp->mask);
|
wp->address, wp->mask);
|
||||||
wp_num++;
|
wp_num++;
|
||||||
|
@ -200,7 +200,7 @@ static int nds32_v3_check_interrupt_stack(struct nds32 *nds32)
|
||||||
nds32->current_interrupt_level = (val_ir0 >> 1) & 0x3;
|
nds32->current_interrupt_level = (val_ir0 >> 1) & 0x3;
|
||||||
|
|
||||||
if (nds32_reach_max_interrupt_level(nds32))
|
if (nds32_reach_max_interrupt_level(nds32))
|
||||||
LOG_ERROR("<-- TARGET ERROR! Reaching the max interrupt stack level %d. -->",
|
LOG_ERROR("<-- TARGET ERROR! Reaching the max interrupt stack level %" PRIu32 ". -->",
|
||||||
nds32->current_interrupt_level);
|
nds32->current_interrupt_level);
|
||||||
|
|
||||||
/* backup $ir4 & $ir6 to avoid suppressed exception overwrite */
|
/* backup $ir4 & $ir6 to avoid suppressed exception overwrite */
|
||||||
|
@ -295,11 +295,11 @@ static int nds32_v3_add_breakpoint(struct target *target,
|
||||||
LOG_WARNING("<-- TARGET WARNING! Insert too many "
|
LOG_WARNING("<-- TARGET WARNING! Insert too many "
|
||||||
"hardware breakpoints/watchpoints! "
|
"hardware breakpoints/watchpoints! "
|
||||||
"The limit of combined hardware "
|
"The limit of combined hardware "
|
||||||
"breakpoints/watchpoints is %d. -->",
|
"breakpoints/watchpoints is %" PRId32 ". -->",
|
||||||
nds32_v3->n_hbr);
|
nds32_v3->n_hbr);
|
||||||
LOG_WARNING("<-- TARGET STATUS: Inserted number of "
|
LOG_WARNING("<-- TARGET STATUS: Inserted number of "
|
||||||
"hardware breakpoint: %d, hardware "
|
"hardware breakpoint: %" PRId32 ", hardware "
|
||||||
"watchpoints: %d. -->",
|
"watchpoints: %" PRId32 ". -->",
|
||||||
nds32_v3->next_hbr_index - nds32_v3->used_n_wp,
|
nds32_v3->next_hbr_index - nds32_v3->used_n_wp,
|
||||||
nds32_v3->used_n_wp);
|
nds32_v3->used_n_wp);
|
||||||
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
|
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
|
||||||
|
@ -369,11 +369,11 @@ static int nds32_v3_add_watchpoint(struct target *target,
|
||||||
|
|
||||||
LOG_WARNING("<-- TARGET WARNING! Insert too many hardware "
|
LOG_WARNING("<-- TARGET WARNING! Insert too many hardware "
|
||||||
"breakpoints/watchpoints! The limit of combined "
|
"breakpoints/watchpoints! The limit of combined "
|
||||||
"hardware breakpoints/watchpoints is %d. -->",
|
"hardware breakpoints/watchpoints is %" PRId32 ". -->",
|
||||||
nds32_v3->n_hbr);
|
nds32_v3->n_hbr);
|
||||||
LOG_WARNING("<-- TARGET STATUS: Inserted number of "
|
LOG_WARNING("<-- TARGET STATUS: Inserted number of "
|
||||||
"hardware breakpoint: %d, hardware "
|
"hardware breakpoint: %" PRId32 ", hardware "
|
||||||
"watchpoints: %d. -->",
|
"watchpoints: %" PRId32 ". -->",
|
||||||
nds32_v3->next_hbr_index - nds32_v3->used_n_wp,
|
nds32_v3->next_hbr_index - nds32_v3->used_n_wp,
|
||||||
nds32_v3->used_n_wp);
|
nds32_v3->used_n_wp);
|
||||||
|
|
||||||
|
@ -458,7 +458,7 @@ static int nds32_v3_examine(struct target *target)
|
||||||
nds32_v3->next_hbr_index = 0;
|
nds32_v3->next_hbr_index = 0;
|
||||||
nds32_v3->used_n_wp = 0;
|
nds32_v3->used_n_wp = 0;
|
||||||
|
|
||||||
LOG_INFO("%s: total hardware breakpoint %d", target_name(target),
|
LOG_INFO("%s: total hardware breakpoint %" PRId32, target_name(target),
|
||||||
nds32_v3->n_hbr);
|
nds32_v3->n_hbr);
|
||||||
|
|
||||||
nds32->target->state = TARGET_RUNNING;
|
nds32->target->state = TARGET_RUNNING;
|
||||||
|
|
|
@ -281,8 +281,8 @@ static int nds32_v3_get_exception_address(struct nds32 *nds32,
|
||||||
nds32_read_opcode(nds32, val_pc, &opcode);
|
nds32_read_opcode(nds32, val_pc, &opcode);
|
||||||
nds32_evaluate_opcode(nds32, opcode, val_pc, &instruction);
|
nds32_evaluate_opcode(nds32, opcode, val_pc, &instruction);
|
||||||
|
|
||||||
LOG_DEBUG("PC: 0x%08x, access start: 0x%08x, end: 0x%08x", val_pc,
|
LOG_DEBUG("PC: 0x%08" PRIx32 ", access start: 0x%08" PRIx32 ", end: 0x%08" PRIx32,
|
||||||
instruction.access_start, instruction.access_end);
|
val_pc, instruction.access_start, instruction.access_end);
|
||||||
|
|
||||||
/* check if multiple hits in the access range */
|
/* check if multiple hits in the access range */
|
||||||
uint32_t in_range_watch_count = 0;
|
uint32_t in_range_watch_count = 0;
|
||||||
|
|
|
@ -52,7 +52,7 @@ static int nds32_v3m_activate_hardware_breakpoint(struct target *target)
|
||||||
/* enable breakpoint (physical address) */
|
/* enable breakpoint (physical address) */
|
||||||
aice_write_debug_reg(aice, NDS_EDM_SR_BPC0 + brp_num, 0xA);
|
aice_write_debug_reg(aice, NDS_EDM_SR_BPC0 + brp_num, 0xA);
|
||||||
|
|
||||||
LOG_DEBUG("Add hardware BP %d at %08" PRIx32, brp_num,
|
LOG_DEBUG("Add hardware BP %u at %08" PRIx32, brp_num,
|
||||||
bp->address);
|
bp->address);
|
||||||
|
|
||||||
brp_num--;
|
brp_num--;
|
||||||
|
@ -80,7 +80,7 @@ static int nds32_v3m_deactivate_hardware_breakpoint(struct target *target)
|
||||||
else
|
else
|
||||||
return ERROR_FAIL;
|
return ERROR_FAIL;
|
||||||
|
|
||||||
LOG_DEBUG("Remove hardware BP %d at %08" PRIx32, brp_num,
|
LOG_DEBUG("Remove hardware BP %u at %08" PRIx32, brp_num,
|
||||||
bp->address);
|
bp->address);
|
||||||
|
|
||||||
brp_num--;
|
brp_num--;
|
||||||
|
@ -127,9 +127,8 @@ static int nds32_v3m_activate_hardware_watchpoint(struct target *target)
|
||||||
/* enable watchpoint */
|
/* enable watchpoint */
|
||||||
aice_write_debug_reg(aice, NDS_EDM_SR_BPC0 + wp_num, wp_config);
|
aice_write_debug_reg(aice, NDS_EDM_SR_BPC0 + wp_num, wp_config);
|
||||||
|
|
||||||
LOG_DEBUG("Add hardware wathcpoint %d at %08" PRIx32
|
LOG_DEBUG("Add hardware wathcpoint %" PRId32 " at %08" PRIx32
|
||||||
" mask %08" PRIx32, wp_num,
|
" mask %08" PRIx32, wp_num, wp->address, wp->mask);
|
||||||
wp->address, wp->mask);
|
|
||||||
|
|
||||||
wp_num++;
|
wp_num++;
|
||||||
} else if (nds32_v3m->nds32.global_stop) {
|
} else if (nds32_v3m->nds32.global_stop) {
|
||||||
|
@ -169,9 +168,8 @@ static int nds32_v3m_deactivate_hardware_watchpoint(struct target *target)
|
||||||
/* disable watchpoint */
|
/* disable watchpoint */
|
||||||
aice_write_debug_reg(aice, NDS_EDM_SR_BPC0 + wp_num, 0x0);
|
aice_write_debug_reg(aice, NDS_EDM_SR_BPC0 + wp_num, 0x0);
|
||||||
|
|
||||||
LOG_DEBUG("Remove hardware wathcpoint %d at %08" PRIx32
|
LOG_DEBUG("Remove hardware wathcpoint %" PRId32 " at %08" PRIx32
|
||||||
" mask %08" PRIx32, wp_num,
|
" mask %08" PRIx32, wp_num, wp->address, wp->mask);
|
||||||
wp->address, wp->mask);
|
|
||||||
wp_num++;
|
wp_num++;
|
||||||
} else if (nds32_v3m->nds32.global_stop) {
|
} else if (nds32_v3m->nds32.global_stop) {
|
||||||
clean_global_stop = true;
|
clean_global_stop = true;
|
||||||
|
@ -198,7 +196,7 @@ static int nds32_v3m_check_interrupt_stack(struct nds32 *nds32)
|
||||||
nds32->current_interrupt_level = (val_ir0 >> 1) & 0x3;
|
nds32->current_interrupt_level = (val_ir0 >> 1) & 0x3;
|
||||||
|
|
||||||
if (nds32_reach_max_interrupt_level(nds32))
|
if (nds32_reach_max_interrupt_level(nds32))
|
||||||
LOG_ERROR("<-- TARGET ERROR! Reaching the max interrupt stack level %d. -->",
|
LOG_ERROR("<-- TARGET ERROR! Reaching the max interrupt stack level %" PRIu32 ". -->",
|
||||||
nds32->current_interrupt_level);
|
nds32->current_interrupt_level);
|
||||||
|
|
||||||
/* backup $ir6 to avoid suppressed exception overwrite */
|
/* backup $ir6 to avoid suppressed exception overwrite */
|
||||||
|
@ -254,11 +252,11 @@ static int nds32_v3m_add_breakpoint(struct target *target,
|
||||||
LOG_WARNING("<-- TARGET WARNING! Insert too many "
|
LOG_WARNING("<-- TARGET WARNING! Insert too many "
|
||||||
"hardware breakpoints/watchpoints! "
|
"hardware breakpoints/watchpoints! "
|
||||||
"The limit of combined hardware "
|
"The limit of combined hardware "
|
||||||
"breakpoints/watchpoints is %d. -->",
|
"breakpoints/watchpoints is %" PRId32 ". -->",
|
||||||
nds32_v3m->n_hbr);
|
nds32_v3m->n_hbr);
|
||||||
LOG_WARNING("<-- TARGET STATUS: Inserted number of "
|
LOG_WARNING("<-- TARGET STATUS: Inserted number of "
|
||||||
"hardware breakpoint: %d, hardware "
|
"hardware breakpoint: %" PRId32 ", hardware "
|
||||||
"watchpoints: %d. -->",
|
"watchpoints: %" PRId32 ". -->",
|
||||||
nds32_v3m->n_hbr - nds32_v3m->next_hbr_index - 1,
|
nds32_v3m->n_hbr - nds32_v3m->next_hbr_index - 1,
|
||||||
nds32_v3m->used_n_wp);
|
nds32_v3m->used_n_wp);
|
||||||
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
|
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
|
||||||
|
@ -328,9 +326,9 @@ static int nds32_v3m_add_watchpoint(struct target *target,
|
||||||
|
|
||||||
LOG_WARNING("<-- TARGET WARNING! Insert too many hardware "
|
LOG_WARNING("<-- TARGET WARNING! Insert too many hardware "
|
||||||
"watchpoints! The limit of hardware watchpoints "
|
"watchpoints! The limit of hardware watchpoints "
|
||||||
"is %d. -->", nds32_v3m->n_hwp);
|
"is %" PRId32 ". -->", nds32_v3m->n_hwp);
|
||||||
LOG_WARNING("<-- TARGET STATUS: Inserted number of "
|
LOG_WARNING("<-- TARGET STATUS: Inserted number of "
|
||||||
"hardware watchpoint: %d. -->",
|
"hardware watchpoint: %" PRId32 ". -->",
|
||||||
nds32_v3m->used_n_wp);
|
nds32_v3m->used_n_wp);
|
||||||
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
|
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
|
||||||
}
|
}
|
||||||
|
@ -347,11 +345,11 @@ static int nds32_v3m_add_watchpoint(struct target *target,
|
||||||
|
|
||||||
LOG_WARNING("<-- TARGET WARNING! Insert too many hardware "
|
LOG_WARNING("<-- TARGET WARNING! Insert too many hardware "
|
||||||
"breakpoints/watchpoints! The limit of combined "
|
"breakpoints/watchpoints! The limit of combined "
|
||||||
"hardware breakpoints/watchpoints is %d. -->",
|
"hardware breakpoints/watchpoints is %" PRId32 ". -->",
|
||||||
nds32_v3m->n_hbr);
|
nds32_v3m->n_hbr);
|
||||||
LOG_WARNING("<-- TARGET STATUS: Inserted number of "
|
LOG_WARNING("<-- TARGET STATUS: Inserted number of "
|
||||||
"hardware breakpoint: %d, hardware "
|
"hardware breakpoint: %" PRId32 ", hardware "
|
||||||
"watchpoints: %d. -->",
|
"watchpoints: %" PRId32 ". -->",
|
||||||
nds32_v3m->n_hbr - nds32_v3m->next_hbr_index - 1,
|
nds32_v3m->n_hbr - nds32_v3m->next_hbr_index - 1,
|
||||||
nds32_v3m->used_n_wp);
|
nds32_v3m->used_n_wp);
|
||||||
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
|
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
|
||||||
|
@ -446,9 +444,9 @@ static int nds32_v3m_examine(struct target *target)
|
||||||
/* hardware watchpoint is inserted from low index to high index */
|
/* hardware watchpoint is inserted from low index to high index */
|
||||||
nds32_v3m->next_hwp_index = 0;
|
nds32_v3m->next_hwp_index = 0;
|
||||||
|
|
||||||
LOG_INFO("%s: total hardware breakpoint %d (simple breakpoint %d)",
|
LOG_INFO("%s: total hardware breakpoint %" PRId32 " (simple breakpoint %" PRId32 ")",
|
||||||
target_name(target), nds32_v3m->n_hbr, nds32_v3m->n_hbr - nds32_v3m->n_hwp);
|
target_name(target), nds32_v3m->n_hbr, nds32_v3m->n_hbr - nds32_v3m->n_hwp);
|
||||||
LOG_INFO("%s: total hardware watchpoint %d", target_name(target), nds32_v3m->n_hwp);
|
LOG_INFO("%s: total hardware watchpoint %" PRId32, target_name(target), nds32_v3m->n_hwp);
|
||||||
|
|
||||||
nds32->target->state = TARGET_RUNNING;
|
nds32->target->state = TARGET_RUNNING;
|
||||||
nds32->target->debug_reason = DBG_REASON_NOTHALTED;
|
nds32->target->debug_reason = DBG_REASON_NOTHALTED;
|
||||||
|
|
|
@ -424,7 +424,7 @@ static int or1k_read_core_reg(struct target *target, int num)
|
||||||
if ((num >= 0) && (num < OR1KNUMCOREREGS)) {
|
if ((num >= 0) && (num < OR1KNUMCOREREGS)) {
|
||||||
reg_value = or1k->core_regs[num];
|
reg_value = or1k->core_regs[num];
|
||||||
buf_set_u32(or1k->core_cache->reg_list[num].value, 0, 32, reg_value);
|
buf_set_u32(or1k->core_cache->reg_list[num].value, 0, 32, reg_value);
|
||||||
LOG_DEBUG("Read core reg %i value 0x%08x", num , reg_value);
|
LOG_DEBUG("Read core reg %i value 0x%08" PRIx32, num , reg_value);
|
||||||
or1k->core_cache->reg_list[num].valid = 1;
|
or1k->core_cache->reg_list[num].valid = 1;
|
||||||
or1k->core_cache->reg_list[num].dirty = 0;
|
or1k->core_cache->reg_list[num].dirty = 0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -432,11 +432,11 @@ static int or1k_read_core_reg(struct target *target, int num)
|
||||||
int retval = du_core->or1k_jtag_read_cpu(&or1k->jtag,
|
int retval = du_core->or1k_jtag_read_cpu(&or1k->jtag,
|
||||||
or1k->arch_info[num].spr_num, 1, ®_value);
|
or1k->arch_info[num].spr_num, 1, ®_value);
|
||||||
if (retval != ERROR_OK) {
|
if (retval != ERROR_OK) {
|
||||||
LOG_ERROR("Error while reading spr 0x%08x", or1k->arch_info[num].spr_num);
|
LOG_ERROR("Error while reading spr 0x%08" PRIx32, or1k->arch_info[num].spr_num);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
buf_set_u32(or1k->core_cache->reg_list[num].value, 0, 32, reg_value);
|
buf_set_u32(or1k->core_cache->reg_list[num].value, 0, 32, reg_value);
|
||||||
LOG_DEBUG("Read spr reg %i value 0x%08x", num , reg_value);
|
LOG_DEBUG("Read spr reg %i value 0x%08" PRIx32, num , reg_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ERROR_OK;
|
return ERROR_OK;
|
||||||
|
@ -453,7 +453,7 @@ static int or1k_write_core_reg(struct target *target, int num)
|
||||||
|
|
||||||
uint32_t reg_value = buf_get_u32(or1k->core_cache->reg_list[num].value, 0, 32);
|
uint32_t reg_value = buf_get_u32(or1k->core_cache->reg_list[num].value, 0, 32);
|
||||||
or1k->core_regs[num] = reg_value;
|
or1k->core_regs[num] = reg_value;
|
||||||
LOG_DEBUG("Write core reg %i value 0x%08x", num , reg_value);
|
LOG_DEBUG("Write core reg %i value 0x%08" PRIx32, num , reg_value);
|
||||||
or1k->core_cache->reg_list[num].valid = 1;
|
or1k->core_cache->reg_list[num].valid = 1;
|
||||||
or1k->core_cache->reg_list[num].dirty = 0;
|
or1k->core_cache->reg_list[num].dirty = 0;
|
||||||
|
|
||||||
|
@ -495,7 +495,7 @@ static int or1k_set_core_reg(struct reg *reg, uint8_t *buf)
|
||||||
int retval = du_core->or1k_jtag_write_cpu(&or1k->jtag,
|
int retval = du_core->or1k_jtag_write_cpu(&or1k->jtag,
|
||||||
or1k_reg->spr_num, 1, &value);
|
or1k_reg->spr_num, 1, &value);
|
||||||
if (retval != ERROR_OK) {
|
if (retval != ERROR_OK) {
|
||||||
LOG_ERROR("Error while writing spr 0x%08x", or1k_reg->spr_num);
|
LOG_ERROR("Error while writing spr 0x%08" PRIx32, or1k_reg->spr_num);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -797,7 +797,7 @@ static int or1k_resume_or_step(struct target *target, int current,
|
||||||
uint32_t resume_pc;
|
uint32_t resume_pc;
|
||||||
uint32_t debug_reg_list[OR1K_DEBUG_REG_NUM];
|
uint32_t debug_reg_list[OR1K_DEBUG_REG_NUM];
|
||||||
|
|
||||||
LOG_DEBUG("Addr: 0x%x, stepping: %s, handle breakpoints %s\n",
|
LOG_DEBUG("Addr: 0x%" PRIx32 ", stepping: %s, handle breakpoints %s\n",
|
||||||
address, step ? "yes" : "no", handle_breakpoints ? "yes" : "no");
|
address, step ? "yes" : "no", handle_breakpoints ? "yes" : "no");
|
||||||
|
|
||||||
if (target->state != TARGET_HALTED) {
|
if (target->state != TARGET_HALTED) {
|
||||||
|
@ -862,7 +862,7 @@ static int or1k_resume_or_step(struct target *target, int current,
|
||||||
/* Single step past breakpoint at current address */
|
/* Single step past breakpoint at current address */
|
||||||
breakpoint = breakpoint_find(target, resume_pc);
|
breakpoint = breakpoint_find(target, resume_pc);
|
||||||
if (breakpoint) {
|
if (breakpoint) {
|
||||||
LOG_DEBUG("Unset breakpoint at 0x%08x", breakpoint->address);
|
LOG_DEBUG("Unset breakpoint at 0x%08" PRIx32, breakpoint->address);
|
||||||
retval = or1k_remove_breakpoint(target, breakpoint);
|
retval = or1k_remove_breakpoint(target, breakpoint);
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -887,11 +887,11 @@ static int or1k_resume_or_step(struct target *target, int current,
|
||||||
if (!debug_execution) {
|
if (!debug_execution) {
|
||||||
target->state = TARGET_RUNNING;
|
target->state = TARGET_RUNNING;
|
||||||
target_call_event_callbacks(target, TARGET_EVENT_RESUMED);
|
target_call_event_callbacks(target, TARGET_EVENT_RESUMED);
|
||||||
LOG_DEBUG("Target resumed at 0x%08x", resume_pc);
|
LOG_DEBUG("Target resumed at 0x%08" PRIx32, resume_pc);
|
||||||
} else {
|
} else {
|
||||||
target->state = TARGET_DEBUG_RUNNING;
|
target->state = TARGET_DEBUG_RUNNING;
|
||||||
target_call_event_callbacks(target, TARGET_EVENT_DEBUG_RESUMED);
|
target_call_event_callbacks(target, TARGET_EVENT_DEBUG_RESUMED);
|
||||||
LOG_DEBUG("Target debug resumed at 0x%08x", resume_pc);
|
LOG_DEBUG("Target debug resumed at 0x%08" PRIx32, resume_pc);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ERROR_OK;
|
return ERROR_OK;
|
||||||
|
@ -923,7 +923,7 @@ static int or1k_add_breakpoint(struct target *target,
|
||||||
struct or1k_du *du_core = or1k_to_du(or1k);
|
struct or1k_du *du_core = or1k_to_du(or1k);
|
||||||
uint8_t data;
|
uint8_t data;
|
||||||
|
|
||||||
LOG_DEBUG("Adding breakpoint: addr 0x%08x, len %d, type %d, set: %d, id: %d",
|
LOG_DEBUG("Adding breakpoint: addr 0x%08" PRIx32 ", len %d, type %d, set: %d, id: %" PRId32,
|
||||||
breakpoint->address, breakpoint->length, breakpoint->type,
|
breakpoint->address, breakpoint->length, breakpoint->type,
|
||||||
breakpoint->set, breakpoint->unique_id);
|
breakpoint->set, breakpoint->unique_id);
|
||||||
|
|
||||||
|
@ -938,7 +938,7 @@ static int or1k_add_breakpoint(struct target *target,
|
||||||
1,
|
1,
|
||||||
&data);
|
&data);
|
||||||
if (retval != ERROR_OK) {
|
if (retval != ERROR_OK) {
|
||||||
LOG_ERROR("Error while reading the instruction at 0x%08x",
|
LOG_ERROR("Error while reading the instruction at 0x%08" PRIx32,
|
||||||
breakpoint->address);
|
breakpoint->address);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
@ -958,7 +958,7 @@ static int or1k_add_breakpoint(struct target *target,
|
||||||
(uint8_t *)&or1k_trap_insn);
|
(uint8_t *)&or1k_trap_insn);
|
||||||
|
|
||||||
if (retval != ERROR_OK) {
|
if (retval != ERROR_OK) {
|
||||||
LOG_ERROR("Error while writing OR1K_TRAP_INSTR at 0x%08x",
|
LOG_ERROR("Error while writing OR1K_TRAP_INSTR at 0x%08" PRIx32,
|
||||||
breakpoint->address);
|
breakpoint->address);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
@ -980,7 +980,7 @@ static int or1k_remove_breakpoint(struct target *target,
|
||||||
struct or1k_common *or1k = target_to_or1k(target);
|
struct or1k_common *or1k = target_to_or1k(target);
|
||||||
struct or1k_du *du_core = or1k_to_du(or1k);
|
struct or1k_du *du_core = or1k_to_du(or1k);
|
||||||
|
|
||||||
LOG_DEBUG("Removing breakpoint: addr 0x%08x, len %d, type %d, set: %d, id: %d",
|
LOG_DEBUG("Removing breakpoint: addr 0x%08" PRIx32 ", len %d, type %d, set: %d, id: %" PRId32,
|
||||||
breakpoint->address, breakpoint->length, breakpoint->type,
|
breakpoint->address, breakpoint->length, breakpoint->type,
|
||||||
breakpoint->set, breakpoint->unique_id);
|
breakpoint->set, breakpoint->unique_id);
|
||||||
|
|
||||||
|
@ -996,7 +996,7 @@ static int or1k_remove_breakpoint(struct target *target,
|
||||||
breakpoint->orig_instr);
|
breakpoint->orig_instr);
|
||||||
|
|
||||||
if (retval != ERROR_OK) {
|
if (retval != ERROR_OK) {
|
||||||
LOG_ERROR("Error while writing back the instruction at 0x%08x",
|
LOG_ERROR("Error while writing back the instruction at 0x%08" PRIx32,
|
||||||
breakpoint->address);
|
breakpoint->address);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
@ -1032,7 +1032,7 @@ static int or1k_read_memory(struct target *target, uint32_t address,
|
||||||
struct or1k_common *or1k = target_to_or1k(target);
|
struct or1k_common *or1k = target_to_or1k(target);
|
||||||
struct or1k_du *du_core = or1k_to_du(or1k);
|
struct or1k_du *du_core = or1k_to_du(or1k);
|
||||||
|
|
||||||
LOG_DEBUG("Read memory at 0x%08x, size: %d, count: 0x%08x", address, size, count);
|
LOG_DEBUG("Read memory at 0x%08" PRIx32 ", size: %" PRIu32 ", count: 0x%08" PRIx32, address, size, count);
|
||||||
|
|
||||||
if (target->state != TARGET_HALTED) {
|
if (target->state != TARGET_HALTED) {
|
||||||
LOG_ERROR("Target not halted");
|
LOG_ERROR("Target not halted");
|
||||||
|
@ -1090,7 +1090,7 @@ static int or1k_write_memory(struct target *target, uint32_t address,
|
||||||
struct or1k_common *or1k = target_to_or1k(target);
|
struct or1k_common *or1k = target_to_or1k(target);
|
||||||
struct or1k_du *du_core = or1k_to_du(or1k);
|
struct or1k_du *du_core = or1k_to_du(or1k);
|
||||||
|
|
||||||
LOG_DEBUG("Write memory at 0x%08x, size: %d, count: 0x%08x", address, size, count);
|
LOG_DEBUG("Write memory at 0x%08" PRIx32 ", size: %" PRIu32 ", count: 0x%08" PRIx32, address, size, count);
|
||||||
|
|
||||||
if (target->state != TARGET_HALTED) {
|
if (target->state != TARGET_HALTED) {
|
||||||
LOG_WARNING("Target not halted");
|
LOG_WARNING("Target not halted");
|
||||||
|
@ -1377,7 +1377,7 @@ COMMAND_HANDLER(or1k_addreg_command_handler)
|
||||||
|
|
||||||
or1k_add_reg(target, &new_reg);
|
or1k_add_reg(target, &new_reg);
|
||||||
|
|
||||||
LOG_DEBUG("Add reg \"%s\" @ 0x%08x, group \"%s\", feature \"%s\"",
|
LOG_DEBUG("Add reg \"%s\" @ 0x%08" PRIx32 ", group \"%s\", feature \"%s\"",
|
||||||
new_reg.name, addr, new_reg.group, new_reg.feature);
|
new_reg.name, addr, new_reg.group, new_reg.feature);
|
||||||
|
|
||||||
return ERROR_OK;
|
return ERROR_OK;
|
||||||
|
|
|
@ -283,7 +283,7 @@ static int adbg_ctrl_write(struct or1k_jtag *jtag_info, uint8_t regidx,
|
||||||
uint32_t opcode;
|
uint32_t opcode;
|
||||||
uint32_t opcode_len;
|
uint32_t opcode_len;
|
||||||
|
|
||||||
LOG_DEBUG("Write control register %d: 0x%08x", regidx, cmd_data[0]);
|
LOG_DEBUG("Write control register %" PRId8 ": 0x%08" PRIx32, regidx, cmd_data[0]);
|
||||||
|
|
||||||
int retval = adbg_select_ctrl_reg(jtag_info, regidx);
|
int retval = adbg_select_ctrl_reg(jtag_info, regidx);
|
||||||
if (retval != ERROR_OK) {
|
if (retval != ERROR_OK) {
|
||||||
|
@ -419,7 +419,7 @@ static int adbg_wb_burst_read(struct or1k_jtag *jtag_info, int size,
|
||||||
int retval;
|
int retval;
|
||||||
uint8_t opcode;
|
uint8_t opcode;
|
||||||
|
|
||||||
LOG_DEBUG("Doing burst read, word size %d, word count %d, start address 0x%08x",
|
LOG_DEBUG("Doing burst read, word size %d, word count %d, start address 0x%08" PRIx32,
|
||||||
size, count, start_address);
|
size, count, start_address);
|
||||||
|
|
||||||
/* Select the appropriate opcode */
|
/* Select the appropriate opcode */
|
||||||
|
@ -508,7 +508,7 @@ retry_read_full:
|
||||||
crc_calc = adbg_compute_crc(crc_calc, data[i], 8);
|
crc_calc = adbg_compute_crc(crc_calc, data[i], 8);
|
||||||
|
|
||||||
if (crc_calc != crc_read) {
|
if (crc_calc != crc_read) {
|
||||||
LOG_WARNING("CRC ERROR! Computed 0x%08x, read CRC 0x%08x", crc_calc, crc_read);
|
LOG_WARNING("CRC ERROR! Computed 0x%08" PRIx32 ", read CRC 0x%08" PRIx32, crc_calc, crc_read);
|
||||||
if (retry_full_crc++ < MAX_READ_CRC_RETRY)
|
if (retry_full_crc++ < MAX_READ_CRC_RETRY)
|
||||||
goto retry_read_full;
|
goto retry_read_full;
|
||||||
else {
|
else {
|
||||||
|
@ -540,7 +540,7 @@ retry_read_full:
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
addr = (err_data[0] >> 1) | (err_data[1] << 31);
|
addr = (err_data[0] >> 1) | (err_data[1] << 31);
|
||||||
LOG_WARNING("WB bus error during burst read, address 0x%08x, retrying!", addr);
|
LOG_WARNING("WB bus error during burst read, address 0x%08" PRIx32 ", retrying!", addr);
|
||||||
|
|
||||||
bus_error_retries++;
|
bus_error_retries++;
|
||||||
if (bus_error_retries > MAX_BUS_ERRORS) {
|
if (bus_error_retries > MAX_BUS_ERRORS) {
|
||||||
|
@ -656,7 +656,7 @@ retry_full_write:
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
if (!value) {
|
if (!value) {
|
||||||
LOG_WARNING("CRC ERROR! match bit after write is %i (computed CRC 0x%08x)", value, crc_calc);
|
LOG_WARNING("CRC ERROR! match bit after write is %" PRIi8 " (computed CRC 0x%08" PRIx32 ")", value, crc_calc);
|
||||||
if (retry_full_crc++ < MAX_WRITE_CRC_RETRY)
|
if (retry_full_crc++ < MAX_WRITE_CRC_RETRY)
|
||||||
goto retry_full_write;
|
goto retry_full_write;
|
||||||
else
|
else
|
||||||
|
@ -684,7 +684,7 @@ retry_full_write:
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
addr = (err_data[0] >> 1) | (err_data[1] << 31);
|
addr = (err_data[0] >> 1) | (err_data[1] << 31);
|
||||||
LOG_WARNING("WB bus error during burst write, address 0x%08x, retrying!", addr);
|
LOG_WARNING("WB bus error during burst write, address 0x%08" PRIx32 ", retrying!", addr);
|
||||||
|
|
||||||
bus_error_retries++;
|
bus_error_retries++;
|
||||||
if (bus_error_retries > MAX_BUS_ERRORS) {
|
if (bus_error_retries > MAX_BUS_ERRORS) {
|
||||||
|
@ -831,7 +831,7 @@ static int or1k_adv_cpu_reset(struct or1k_jtag *jtag_info, int action)
|
||||||
static int or1k_adv_jtag_read_memory(struct or1k_jtag *jtag_info,
|
static int or1k_adv_jtag_read_memory(struct or1k_jtag *jtag_info,
|
||||||
uint32_t addr, uint32_t size, int count, uint8_t *buffer)
|
uint32_t addr, uint32_t size, int count, uint8_t *buffer)
|
||||||
{
|
{
|
||||||
LOG_DEBUG("Reading WB%d at 0x%08x", size * 8, addr);
|
LOG_DEBUG("Reading WB%" PRId32 " at 0x%08" PRIx32, size * 8, addr);
|
||||||
|
|
||||||
int retval;
|
int retval;
|
||||||
if (!jtag_info->or1k_jtag_inited) {
|
if (!jtag_info->or1k_jtag_inited) {
|
||||||
|
@ -869,7 +869,7 @@ static int or1k_adv_jtag_read_memory(struct or1k_jtag *jtag_info,
|
||||||
static int or1k_adv_jtag_write_memory(struct or1k_jtag *jtag_info,
|
static int or1k_adv_jtag_write_memory(struct or1k_jtag *jtag_info,
|
||||||
uint32_t addr, uint32_t size, int count, const uint8_t *buffer)
|
uint32_t addr, uint32_t size, int count, const uint8_t *buffer)
|
||||||
{
|
{
|
||||||
LOG_DEBUG("Writing WB%d at 0x%08x", size * 8, addr);
|
LOG_DEBUG("Writing WB%" PRId32 " at 0x%08" PRIx32, size * 8, addr);
|
||||||
|
|
||||||
int retval;
|
int retval;
|
||||||
if (!jtag_info->or1k_jtag_inited) {
|
if (!jtag_info->or1k_jtag_inited) {
|
||||||
|
|
|
@ -218,9 +218,9 @@ static int or1k_tap_vjtag_init(struct or1k_jtag *jtag_info)
|
||||||
LOG_DEBUG("SLD HUB Configuration register");
|
LOG_DEBUG("SLD HUB Configuration register");
|
||||||
LOG_DEBUG("------------------------------");
|
LOG_DEBUG("------------------------------");
|
||||||
LOG_DEBUG("m_width = %d", m_width);
|
LOG_DEBUG("m_width = %d", m_width);
|
||||||
LOG_DEBUG("manufacturer_id = 0x%02x", MANUF(hub_info));
|
LOG_DEBUG("manufacturer_id = 0x%02" PRIx32, MANUF(hub_info));
|
||||||
LOG_DEBUG("nb_of_node = %d", nb_nodes);
|
LOG_DEBUG("nb_of_node = %d", nb_nodes);
|
||||||
LOG_DEBUG("version = %d", VER(hub_info));
|
LOG_DEBUG("version = %" PRId32, VER(hub_info));
|
||||||
LOG_DEBUG("VIR length = %d", guess_addr_width(nb_nodes) + m_width);
|
LOG_DEBUG("VIR length = %d", guess_addr_width(nb_nodes) + m_width);
|
||||||
|
|
||||||
/* Because the number of SLD nodes is now known, the Nodes on the hub can be
|
/* Because the number of SLD nodes is now known, the Nodes on the hub can be
|
||||||
|
@ -259,11 +259,11 @@ static int or1k_tap_vjtag_init(struct or1k_jtag *jtag_info)
|
||||||
|
|
||||||
LOG_DEBUG("Node info register");
|
LOG_DEBUG("Node info register");
|
||||||
LOG_DEBUG("--------------------");
|
LOG_DEBUG("--------------------");
|
||||||
LOG_DEBUG("instance_id = %d", ID(node_info));
|
LOG_DEBUG("instance_id = %" PRId32, ID(node_info));
|
||||||
LOG_DEBUG("manufacturer_id = 0x%02x", MANUF(node_info));
|
LOG_DEBUG("manufacturer_id = 0x%02" PRIx32, MANUF(node_info));
|
||||||
LOG_DEBUG("node_id = %d (%s)", ID(node_info),
|
LOG_DEBUG("node_id = %" PRId32 " (%s)", ID(node_info),
|
||||||
id_to_string(ID(node_info)));
|
id_to_string(ID(node_info)));
|
||||||
LOG_DEBUG("version = %d", VER(node_info));
|
LOG_DEBUG("version = %" PRId32, VER(node_info));
|
||||||
|
|
||||||
if (ID(node_info) == VJTAG_NODE_ID)
|
if (ID(node_info) == VJTAG_NODE_ID)
|
||||||
vjtag_node_address = node_index + 1;
|
vjtag_node_address = node_index + 1;
|
||||||
|
|
Loading…
Reference in New Issue