riscv: Use the XML target descriptions to report 3 system registers
authorVincent Chen <vincent.chen@sifive.com>
Thu, 16 Apr 2020 02:38:07 +0000 (10:38 +0800)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Mon, 18 May 2020 18:38:11 +0000 (11:38 -0700)
commitd96575709cc7056f34fdd5cdc16bcffe5bdb573d
tree73935f4d016aa0de26ce4276e2715ae84bd5c731
parentfe89bd2be8667d4d876329dd534dd59158e33b1f
riscv: Use the XML target descriptions to report 3 system registers

The $status, $badaddr, and $cause registers belong to the thread context,
so KGDB can obtain their contents from pt_regs in each trap. However, the
sequential number of these registers in the gdb register list is far from
the general-purpose registers. If riscv port uses the existing method to
report these three registers, many trivial registers with sequence numbers
in the middle of them will also be packaged to the reply packets. To solve
this problem, the riscv port wants to introduce the GDB target description
mechanism to customize the reported register list. By the list, the KGDB
can ignore the intermediate registers and just reports the general-purpose
registers and these three system registers.

Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/Kconfig
arch/riscv/include/asm/gdb_xml.h [new file with mode: 0644]
arch/riscv/include/asm/kgdb.h
arch/riscv/kernel/kgdb.c