aboutsummaryrefslogtreecommitdiff
path: root/src/rtos
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2018-04-09 12:17:08 -0700
committerTim Newsome <tim@sifive.com>2018-04-09 12:17:08 -0700
commitc73e06809d6db1bc9264ac94459d55ed62aea39c (patch)
tree4c0d85f4bbf564583e2c3bacd0eb053b89116325 /src/rtos
parent11445b298a23e93dcd886bed611e68ad37c0ea6d (diff)
parentbe87994d60457ac846740dd9e5df3c8f63cf646e (diff)
downloadriscv-openocd-c73e06809d6db1bc9264ac94459d55ed62aea39c.zip
riscv-openocd-c73e06809d6db1bc9264ac94459d55ed62aea39c.tar.gz
riscv-openocd-c73e06809d6db1bc9264ac94459d55ed62aea39c.tar.bz2
Merge branch 'master' into from_upstream
Conflicts: src/rtos/rtos.c src/rtos/rtos.h src/server/gdb_server.c Change-Id: Icd5a8165fe111f699542530c9cb034faf30e09b2
Diffstat (limited to 'src/rtos')
-rw-r--r--src/rtos/ChibiOS.c2
-rw-r--r--src/rtos/rtos.c16
-rw-r--r--src/rtos/rtos.h1
3 files changed, 16 insertions, 3 deletions
diff --git a/src/rtos/ChibiOS.c b/src/rtos/ChibiOS.c
index ef0bb16..a46f7a4 100644
--- a/src/rtos/ChibiOS.c
+++ b/src/rtos/ChibiOS.c
@@ -247,7 +247,7 @@ static int ChibiOS_update_stacking(struct rtos *rtos)
/* Check for armv7m with *enabled* FPU, i.e. a Cortex-M4 */
struct armv7m_common *armv7m_target = target_to_armv7m(rtos->target);
if (is_armv7m(armv7m_target)) {
- if (armv7m_target->fp_feature == FPv4_SP) {
+ if (armv7m_target->fp_feature != FP_NONE) {
/* Found ARM v7m target which includes a FPU */
uint32_t cpacr;
diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c
index a37f44a..4f23040 100644
--- a/src/rtos/rtos.c
+++ b/src/rtos/rtos.c
@@ -59,6 +59,15 @@ int rtos_smp_init(struct target *target)
return ERROR_TARGET_INIT_FAILED;
}
+static int rtos_target_for_threadid(struct connection *connection, int64_t threadid, struct target **t)
+{
+ struct target *curr = get_target_from_connection(connection);
+ if (t)
+ *t = curr;
+
+ return ERROR_OK;
+}
+
static int os_alloc(struct target *target, struct rtos_type *ostype)
{
struct rtos *os = target->rtos = calloc(1, sizeof(struct rtos));
@@ -75,6 +84,7 @@ static int os_alloc(struct target *target, struct rtos_type *ostype)
/* RTOS drivers can override the packet handler in _create(). */
os->gdb_thread_packet = rtos_thread_packet;
os->gdb_v_packet = NULL;
+ os->gdb_target_for_threadid = rtos_target_for_threadid;
return JIM_OK;
}
@@ -339,8 +349,10 @@ int rtos_thread_packet(struct connection *connection, char const *packet, int pa
return ERROR_OK;
} else if (strncmp(packet, "qSymbol", 7) == 0) {
if (rtos_qsymbol(connection, packet, packet_size) == 1) {
- target->rtos_auto_detect = false;
- target->rtos->type->create(target);
+ if (target->rtos_auto_detect == true) {
+ target->rtos_auto_detect = false;
+ target->rtos->type->create(target);
+ }
target->rtos->type->update_threads(target->rtos);
}
return ERROR_OK;
diff --git a/src/rtos/rtos.h b/src/rtos/rtos.h
index 9da035a..c9ac1e5 100644
--- a/src/rtos/rtos.h
+++ b/src/rtos/rtos.h
@@ -55,6 +55,7 @@ struct rtos {
int thread_count;
int (*gdb_thread_packet)(struct connection *connection, char const *packet, int packet_size);
int (*gdb_v_packet)(struct connection *connection, char const *packet, int packet_size);
+ int (*gdb_target_for_threadid)(struct connection *connection, int64_t thread_id, struct target **p_target);
void *rtos_specific_params;
};