From 2d7dc3f5f577b16dfa99a24da4b8f8222c256dfe Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Mon, 21 Nov 2022 13:11:19 -0800 Subject: [PATCH] target/riscv: Fix small riscv013_halt_go() bug Exit the loop when no harts are running, instead of when at least one hart has halted. Change-Id: Ia69b626bf1fee4034bd5ccc800a651bfe0e53685 Signed-off-by: Tim Newsome --- src/target/riscv/riscv-013.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index 40ca38d13..4e9152c5f 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -4281,7 +4281,7 @@ static int riscv013_halt_go(struct target *target) if (dmstatus_read(target, &dmstatus, true) != ERROR_OK) return ERROR_FAIL; /* When no harts are running, there's no point in continuing this loop. */ - if (!get_field(dmstatus, DM_DMSTATUS_ALLRUNNING)) + if (!get_field(dmstatus, DM_DMSTATUS_ANYRUNNING)) break; }