riscv-openocd
riscv-openocd copied to clipboard
target/riscv: check `abstractcs.busy`
According to the RISC-V Debug Spec (1.0.0-rc1)[3.7 Abstract Commands]:
While an abstract command is executing (busy in abstractcs is high), a debugger must not change hartsel, and must not write 1 to haltreq, resumereq, ackhavereset, setresethaltreq, or clrresethaltreq.
This patch ensures OpenOCD does not violate this rule.
The patch is separated into three commits.
- target/riscv: cache
abstractcs.busy
indm013_info_t
-- provides facilities to track the state ofabstractcs.busy
- target/riscv: introduce
examine_dm()
function -- ensures the rule is followed during examination. - target/riscv: check
abstractcs.busy
-- takes care of other cases.