提交 c79ac84f 编写于 作者: Z Zihao Yu

riscv64,csr: change macro variable name: val -> addr

上级 632882bd
...@@ -117,7 +117,7 @@ CSR_STRUCT_END(sepc) ...@@ -117,7 +117,7 @@ CSR_STRUCT_END(sepc)
CSR_STRUCT_START(sscratch) CSR_STRUCT_START(sscratch)
CSR_STRUCT_END(sscratch) CSR_STRUCT_END(sscratch)
#define CSRS_DECL(name, val) extern concat(name, _t)* const name; #define CSRS_DECL(name, addr) extern concat(name, _t)* const name;
MAP(CSRS, CSRS_DECL) MAP(CSRS, CSRS_DECL)
word_t* csr_decode(uint32_t addr); word_t* csr_decode(uint32_t addr);
......
...@@ -38,11 +38,11 @@ rtlreg_t isa_reg_str2val(const char *s, bool *success) { ...@@ -38,11 +38,11 @@ rtlreg_t isa_reg_str2val(const char *s, bool *success) {
static word_t csr_array[4096] = {}; static word_t csr_array[4096] = {};
#define CSRS_DEF(name, val) \ #define CSRS_DEF(name, addr) \
concat(name, _t)* const name = (void *)&csr_array[val]; concat(name, _t)* const name = (void *)&csr_array[addr];
MAP(CSRS, CSRS_DEF) MAP(CSRS, CSRS_DEF)
#define CSRS_EXIST(name, val) [val] = 1, #define CSRS_EXIST(name, addr) [addr] = 1,
static bool csr_exist[4096] = { static bool csr_exist[4096] = {
MAP(CSRS, CSRS_EXIST) MAP(CSRS, CSRS_EXIST)
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册