qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 4/5] RISC-V: Typed CSRs in gdbserver


From: Richard Henderson
Subject: Re: [PATCH v2 4/5] RISC-V: Typed CSRs in gdbserver
Date: Tue, 4 Jan 2022 15:01:34 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0

On 1/4/22 7:51 AM, Konrad Schwarz wrote:
+++ b/target/riscv/csr32-op-gdbserver.h
...
+++ b/target/riscv/csr64-op-gdbserver.h

There is a *lot* of overlap between these two files.
Why not add this data to the main csr_ops array?
That would put all the info for each csr in one place.

+  [CSR_CYCLE] { .gdb_type = "uint64", .gdb_group = "user" },

I think you should be able to use "unsigned long" as a proxy for the native 
register size.

+char const riscv_gdb_csr_types[] =
+#ifdef TARGET_RISCV32
...
+#elif defined TARGET_RISCV64
...
+# endif
+;

Ideally we shouldn't use ifdefs for this -- we should choose one or the other depending on the startup env->misa_mxl_max. We are still using an ifdef for the main riscv-*-virtual.xml, but that could be considered a bug to fix.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]