qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 02/31] target/loongarch: Add CSR registers definition


From: Richard Henderson
Subject: Re: [PATCH 02/31] target/loongarch: Add CSR registers definition
Date: Tue, 19 Oct 2021 12:10:14 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 10/19/21 12:34 AM, Xiaojuan Yang wrote:
+/*
+ * All Possible CSR registers used by tcg
+ *
+ * default value  in target/loongarch/cpu.c
+ *
+ * This macro will be used only in:
+ *  > target/loongarch/cpu.h:CPULoongArchState
+ *
+ * during translate:
+ *  > helper_csr_rdq()
+ *  > helper_csr_wrq()
+ *  > helper_csr_xchgq()
+ *  > helper_csr_xchgq_r0()
+ */
+#define CPU_LOONGARCH_CSR    \
+    uint64_t CSR_CRMD;       \
+    uint64_t CSR_PRMD;       \

I don't see the point in this macro. Just put the structure members directly into CPULoongArchState.

In addition, I think you'll want to include these members unconditionally. We have found for ARM that it is easiest to minimize the differences between system and user emulation. Having to ifdef each use of the csrs does not help.


r~



reply via email to

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