aboutsummaryrefslogtreecommitdiff
path: root/src/rtos
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2023-10-23 12:29:21 -0700
committerTim Newsome <tim@sifive.com>2023-10-23 12:29:21 -0700
commitaf08d582b55f8c8e326b422a46c63909bca6009c (patch)
tree86e13b5da9ce8b8c02e1ceec6ec066a9b9da27f0 /src/rtos
parent132e3faf1d47f4a2ca7d01aa0191c59f5e1816c5 (diff)
parente17fe4db0f256ee4fb97dcfd6b9f7f55c966b190 (diff)
downloadriscv-openocd-af08d582b55f8c8e326b422a46c63909bca6009c.zip
riscv-openocd-af08d582b55f8c8e326b422a46c63909bca6009c.tar.gz
riscv-openocd-af08d582b55f8c8e326b422a46c63909bca6009c.tar.bz2
Merge commit 'e17fe4db0f256ee4fb97dcfd6b9f7f55c966b190' into from_upstream
Conflicts: src/flash/nor/drivers.c src/target/riscv/riscv.c Change-Id: Ide3eded7e0d5b0b446bfd0873a32c00cc9f128bd
Diffstat (limited to 'src/rtos')
-rw-r--r--src/rtos/chibios.c8
-rw-r--r--src/rtos/linux.c2
-rw-r--r--src/rtos/rtos.c16
-rw-r--r--src/rtos/rtos.h15
4 files changed, 20 insertions, 21 deletions
diff --git a/src/rtos/chibios.c b/src/rtos/chibios.c
index 68fe8a1..2037827 100644
--- a/src/rtos/chibios.c
+++ b/src/rtos/chibios.c
@@ -80,12 +80,12 @@ struct chibios_params {
static struct chibios_params chibios_params_list[] = {
{
"cortex_m", /* target_name */
- 0,
+ NULL,
NULL, /* stacking_info */
},
{
"hla_target", /* target_name */
- 0,
+ NULL,
NULL, /* stacking_info */
}
};
@@ -198,7 +198,7 @@ static int chibios_update_memory_signature(struct rtos *rtos)
errfree:
/* Error reading the ChibiOS memory structure */
free(signature);
- param->signature = 0;
+ param->signature = NULL;
return -1;
}
@@ -468,7 +468,7 @@ static int chibios_get_thread_reg_list(struct rtos *rtos, int64_t thread_id,
return -1;
/* Update stacking if it can only be determined from runtime information */
- if ((param->stacking_info == 0) &&
+ if (!param->stacking_info &&
(chibios_update_stacking(rtos) != ERROR_OK)) {
LOG_ERROR("Failed to determine exact stacking for the target type %s", rtos->target->type->name);
return -1;
diff --git a/src/rtos/linux.c b/src/rtos/linux.c
index f9edabc..7517ec7 100644
--- a/src/rtos/linux.c
+++ b/src/rtos/linux.c
@@ -123,7 +123,7 @@ static int linux_read_memory(struct target *target,
target->rtos->rtos_specific_params;
uint32_t pa = (address & linux_os->phys_mask) + linux_os->phys_base;
#endif
- if (address < 0xc000000) {
+ if (address < 0xc0000000) {
LOG_ERROR("linux awareness : address in user space");
return ERROR_FAIL;
}
diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c
index c3870b7..b4f6a1f 100644
--- a/src/rtos/rtos.c
+++ b/src/rtos/rtos.c
@@ -16,22 +16,6 @@
#include "helper/binarybuffer.h"
#include "server/gdb_server.h"
-/* RTOSs */
-extern const struct rtos_type freertos_rtos;
-extern const struct rtos_type threadx_rtos;
-extern const struct rtos_type ecos_rtos;
-extern const struct rtos_type linux_rtos;
-extern const struct rtos_type chibios_rtos;
-extern const struct rtos_type chromium_ec_rtos;
-extern const struct rtos_type embkernel_rtos;
-extern const struct rtos_type mqx_rtos;
-extern const struct rtos_type ucos_iii_rtos;
-extern const struct rtos_type nuttx_rtos;
-extern const struct rtos_type hwthread_rtos;
-extern const struct rtos_type riot_rtos;
-extern const struct rtos_type zephyr_rtos;
-extern const struct rtos_type rtkernel_rtos;
-
static const struct rtos_type *rtos_types[] = {
&threadx_rtos,
&freertos_rtos,
diff --git a/src/rtos/rtos.h b/src/rtos/rtos.h
index f36288d..1ec7674 100644
--- a/src/rtos/rtos.h
+++ b/src/rtos/rtos.h
@@ -173,4 +173,19 @@ struct target *rtos_swbp_target(struct target *target, target_addr_t address,
uint32_t length, enum breakpoint_type type);
struct rtos *rtos_of_target(struct target *target);
+extern const struct rtos_type chibios_rtos;
+extern const struct rtos_type chromium_ec_rtos;
+extern const struct rtos_type ecos_rtos;
+extern const struct rtos_type embkernel_rtos;
+extern const struct rtos_type freertos_rtos;
+extern const struct rtos_type hwthread_rtos;
+extern const struct rtos_type linux_rtos;
+extern const struct rtos_type mqx_rtos;
+extern const struct rtos_type nuttx_rtos;
+extern const struct rtos_type riot_rtos;
+extern const struct rtos_type rtkernel_rtos;
+extern const struct rtos_type threadx_rtos;
+extern const struct rtos_type ucos_iii_rtos;
+extern const struct rtos_type zephyr_rtos;
+
#endif /* OPENOCD_RTOS_RTOS_H */