Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

riscv : fix the inverted logc interrupt-are-disabled-while-single-ste… #1767

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/target/riscv_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@
#define RV_DCSR_CAUSE_MASK 0x000001c0U
#define RV_DCSR_STEPIE 0x00000800U
#define RV_DCSR_EBREAK_MACHINE 0x00008000U
#define RV_DCSR_STOP_TIME (1U << 9)
#define RV_DCSR_STOP_COUNT (1U << 10)

#define RV_GPRS_COUNT 32U

Expand Down Expand Up @@ -1014,9 +1016,9 @@ static void riscv_halt_resume(target_s *target, const bool step)
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;
stepping_config |= RV_DCSR_STEP | RV_DCSR_STOP_TIME | RV_DCSR_STOP_COUNT;
else {
stepping_config &= ~(RV_DCSR_STEP | RV_DCSR_STEPIE);
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
Loading