aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2018-04-20 16:28:24 -0700
committerTim Newsome <tim@sifive.com>2018-04-20 16:28:24 -0700
commit9a69c1c096a5498900c997daa17f23fbc5d7b87d (patch)
treeae4fe1e76808ea8f032cd867528e5df4196e9b28 /src
parent4593659edfb7c3c5c8873a7666a7d4a7ed28c6eb (diff)
downloadriscv-openocd-9a69c1c096a5498900c997daa17f23fbc5d7b87d.zip
riscv-openocd-9a69c1c096a5498900c997daa17f23fbc5d7b87d.tar.gz
riscv-openocd-9a69c1c096a5498900c997daa17f23fbc5d7b87d.tar.bz2
Fix mingw32 build.
Change-Id: If7a57749ba8c49385a4020ce8d2d8dbb94242122
Diffstat (limited to 'src')
-rw-r--r--src/helper/log.h3
-rw-r--r--src/target/riscv/riscv-013.c8
2 files changed, 6 insertions, 5 deletions
diff --git a/src/helper/log.h b/src/helper/log.h
index c2398ca..d60587f 100644
--- a/src/helper/log.h
+++ b/src/helper/log.h
@@ -149,7 +149,8 @@ extern int debug_level;
*/
#define ERROR_FAIL (-4)
#define ERROR_WAIT (-5)
-#define ERROR_TIMEOUT (-6)
+/* ERROR_TIMEOUT is already taken by winerror.h. */
+#define ERROR_TIMEOUT_REACHED (-6)
#endif /* OPENOCD_HELPER_LOG_H */
diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c
index 116d82a..9a628bb 100644
--- a/src/target/riscv/riscv-013.c
+++ b/src/target/riscv/riscv-013.c
@@ -521,7 +521,7 @@ static int dmi_op_timeout(struct target *target, uint32_t *data_in, int dmi_op,
return ERROR_FAIL;
}
if (time(NULL) - start > timeout_sec)
- return ERROR_TIMEOUT;
+ return ERROR_TIMEOUT_REACHED;
}
if (status != DMI_STATUS_SUCCESS) {
@@ -545,7 +545,7 @@ static int dmi_op_timeout(struct target *target, uint32_t *data_in, int dmi_op,
return ERROR_FAIL;
}
if (time(NULL) - start > timeout_sec)
- return ERROR_TIMEOUT;
+ return ERROR_TIMEOUT_REACHED;
}
if (status != DMI_STATUS_SUCCESS) {
@@ -567,7 +567,7 @@ static int dmi_op(struct target *target, uint32_t *data_in, int dmi_op,
{
int result = dmi_op_timeout(target, data_in, dmi_op, address, data_out,
riscv_command_timeout_sec);
- if (result == ERROR_TIMEOUT) {
+ if (result == ERROR_TIMEOUT_REACHED) {
LOG_ERROR("DMI operation didn't complete in %d seconds. The target is "
"either really slow or broken. You could increase the "
"timeout with riscv set_command_timeout_sec.",
@@ -1619,7 +1619,7 @@ static int deassert_reset(struct target *target)
while (1) {
int result = dmstatus_read_timeout(target, &dmstatus, true,
riscv_reset_timeout_sec);
- if (result == ERROR_TIMEOUT)
+ if (result == ERROR_TIMEOUT_REACHED)
LOG_ERROR("Hart %d didn't complete a DMI read coming out of "
"reset in %ds; Increase the timeout with riscv "
"set_reset_timeout_sec.",