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

Improve description of cmderr "busy" #1076

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
11 changes: 7 additions & 4 deletions debug_module.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,15 @@ that case, the command will return "not supported".
====

Debuggers execute abstract commands by writing them to {dm-command}. They can
determine whether an abstract command is complete by reading {abstractcs-busy} in {dm-abstractcs}. If the debugger starts a new command while {abstractcs-busy} is set, {abstractcs-cmderr} becomes 1 (busy), the
currently executing command still gets to run to completion, but any
error generated by the currently executing command is lost. After
determine whether an abstract command is complete by reading {abstractcs-busy} in {dm-abstractcs}. After
completion, {abstractcs-cmderr} indicates whether the command was successful or not.
JanMatCodasip marked this conversation as resolved.
Show resolved Hide resolved
Commands may fail because a hart is not halted, not running,
unavailable, or because they encounter an error during execution.
unavailable, because they encounter an error during execution.

If the debugger attempts to start a new command while {abstractcs-busy} is set,
the new command will not get started and the currently executing command still
gets to run to completion. After that, {abstractcs-cmderr} becomes 1 (busy),
and any error generated by the completed command is lost.

If the command takes arguments, the debugger must write them to the
`data` registers before writing to {dm-command}. If a command returns results, the
Expand Down
12 changes: 7 additions & 5 deletions xml/dm_registers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ same project unless stated otherwise.
<register name="Abstract Control and Status" short="abstractcs" address="0x16">
Writing this register while an abstract command is executing causes
{abstractcs-cmderr} to become 1 (busy) once the command completes
({abstractcs-busy} becomes 0).
(once {abstractcs-busy} becomes 0).

[NOTE]
====
Expand Down Expand Up @@ -573,7 +573,7 @@ same project unless stated otherwise.

Writing this register while an abstract command is executing causes
{abstractcs-cmderr} to become 1 (busy) once the command completes
(busy becomes 0).
(once {abstractcs-busy} becomes 0).

If {abstractcs-cmderr} is non-zero, writes to this register are ignored.

Expand Down Expand Up @@ -609,7 +609,7 @@ same project unless stated otherwise.
If this register is written while an abstract command is executing
then the write is ignored and
{abstractcs-cmderr} becomes 1 (busy) once the command completes
(busy becomes 0).
(once {abstractcs-busy} becomes 0).

<field name="autoexecprogbuf" bits="31:16" access="WARL" reset="0">
When a bit in this field is 1, read or write accesses to the
Expand Down Expand Up @@ -677,7 +677,8 @@ same project unless stated otherwise.
registers.

Accessing these registers while an abstract command is executing causes
{abstractcs-cmderr} to be set to 1 (busy) if it is 0.
{abstractcs-cmderr} to become 1 (busy) once the command completes
(once {abstractcs-busy} becomes 0).

Attempts to write them while {abstractcs-busy} is set does not change their value.

Expand Down Expand Up @@ -712,7 +713,8 @@ same project unless stated otherwise.
implemented starting at {dm-progbuf0}, counting up.

Accessing these registers while an abstract command is executing causes
{abstractcs-cmderr} to be set to 1 (busy) if it is 0.
{abstractcs-cmderr} to become 1 (busy) once the command completes
(once {abstractcs-busy} becomes 0).

Attempts to write them while {abstractcs-busy} is set does not change their value.

Expand Down
Loading