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~