Skip to content

Commit

Permalink
riscv : fix the inverted logc interrupt-are-disabled-while-single-ste…
Browse files Browse the repository at this point in the history
…pping
  • Loading branch information
mean committed Feb 16, 2024
1 parent c4015cd commit 632674d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/target/riscv_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,10 +831,11 @@ static void riscv_halt_resume(target_s *target, const bool step)
uint32_t stepping_config = 0U;
if (!riscv_csr_read(hart, RV_DCSR | RV_CSR_FORCE_32_BIT, &stepping_config))
return;
if (step)
stepping_config |= RV_DCSR_STEP | RV_DCSR_STEPIE;
else {
stepping_config &= ~(RV_DCSR_STEP | RV_DCSR_STEPIE);
if (step) {
stepping_config |= RV_DCSR_STEP;
stepping_config &= ~RV_DCSR_STEPIE; // disable interrupt during single step
} else {
stepping_config &= ~RV_DCSR_STEP;
stepping_config |= RV_DCSR_EBREAK_MACHINE;
}
if (!riscv_csr_write(hart, RV_DCSR | RV_CSR_FORCE_32_BIT, &stepping_config))
Expand Down

0 comments on commit 632674d

Please sign in to comment.