From f54eaf0b8e5b563e6906c00734d79770a5ed705f Mon Sep 17 00:00:00 2001 From: Dmitry Ryzhov Date: Fri, 24 Aug 2018 02:52:12 +0300 Subject: [PATCH] Switch active rtos thread on any hart halt. (#290) --- src/target/riscv/riscv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index 8d76c4aa4..24d633d87 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -1067,6 +1067,7 @@ int riscv_openocd_poll(struct target *target) if (riscv_rtos_enabled(target)) { target->rtos->current_threadid = halted_hart + 1; target->rtos->current_thread = halted_hart + 1; + riscv_set_rtos_hartid(target, halted_hart); } target->state = TARGET_HALTED;