forked from Mirrors/opensbi
riscv_asm.h: Use CSR_<FOO> instead of <foo> for csr_read()
Some toolchains might not have all the CSRs available (as seen with GCC 7.2). So, instead use the defined CSR_ values. Signed-off-by: Olof Johansson <olof@lixom.net>
This commit is contained in:

committed by
Anup Patel

parent
30dfdf6e0e
commit
c0addfe751
@@ -28,7 +28,7 @@ int sbi_misaligned_load_handler(u32 hartid, ulong mcause,
|
||||
union reg_data val;
|
||||
ulong mstatus = csr_read(mstatus);
|
||||
ulong insn = get_insn(regs->mepc, &mstatus);
|
||||
ulong addr = csr_read(mtval);
|
||||
ulong addr = csr_read(CSR_MTVAL);
|
||||
int i, fp = 0, shift = 0, len = 0;
|
||||
|
||||
if ((insn & INSN_MASK_LW) == INSN_MATCH_LW) {
|
||||
@@ -114,7 +114,7 @@ int sbi_misaligned_store_handler(u32 hartid, ulong mcause,
|
||||
union reg_data val;
|
||||
ulong mstatus = csr_read(mstatus);
|
||||
ulong insn = get_insn(regs->mepc, &mstatus);
|
||||
ulong addr = csr_read(mtval);
|
||||
ulong addr = csr_read(CSR_MTVAL);
|
||||
int i, len = 0;
|
||||
|
||||
val.data_ulong = GET_RS2(insn, regs);
|
||||
|
Reference in New Issue
Block a user