commit 0b2ff5297571f291d96f8995892f2a71fef373e4
parent e075e52884b4572820ee494451a5994dfaa17d0f
Author: Dimitris Papastamos <dimitris.papastamos@arm.com>
Date: Thu, 25 Apr 2019 15:54:35 +0100
Merge changes from topics 'rv/unused', 'rv/doc'
* changes:
[rom] Print only 4 registers per line
[doc] Add documentation about the debug language
Diffstat:
2 files changed, 39 insertions(+), 3 deletions(-)
diff --git a/doc/DESIGN b/doc/DESIGN
@@ -214,6 +214,42 @@ TBD
5) Debug language
-----------------
+Rcode has a builtin debug language that can be used to test different
+features of the code. The language is composed by a set of commands
+that can receive several parameters:
+
+ - Set a register: set <reg> <value>
+ It sets a value in a register
+ - Get a register: get <reg>
+ it prints the value of a register
+ - Dump trapframe: dump
+ Dump the full trapframe
+ - Call trap handler: trap
+ Calls the trap handler passing the trapframe
+ - Call RMC handler: rmc imm1 imm2
+ Calls the RMC handler with the specific imm1 and imm2 values
+ - Call RMU handler: rmu rmucmd|?
+ Calls one specific RMU handler. If a question mark is passed as
+ parameter then it prints the list of available RMU handlers
+ - Exit debug environment: exit [status]
+ Exits from the debug environment with an optional status value
+ - Print the help menu: help
+ - Print the content of an entry: cat path
+ It opens a path in the namespace and prints the content of the
+ entry
+ - list content of a directory: ls path
+ It lists all the entries contained in a directory of the namespace
+ - write content to a file: echo path string ...
+ It writes all the arguments separated by one space to the path
+ represented by the first parameter and append a new line at
+ the end.
+
+The debug language uses the character '>' as a way to synchronize.
+Every time that it is ready to accept a new command it prints the
+string '> READY' including a new line at the end. The errors are marked
+with '> ERR' and some message including a new line at the end.
+
+
6) Build system
---------------
diff --git a/src/romfw/rmc.c b/src/romfw/rmc.c
@@ -63,10 +63,10 @@ dumpregs(struct trapframe *fp)
{
int i;
- for (i = X0; i < NR_REGS; i++)
+ for (i = 0; i < NR_REGS; i++)
kprint("%s=0x%llx%c", regnames[i], fp->r[i],
- (i > 0 && i % 4 == 0) ? '\n' : ' ');
- if (i % 4 == 0)
+ (i > 0 && i % 3 == 0) ? '\n' : ' ');
+ if (i % 4 != 3)
kputc('\n');
}