lib: Use CSR_<FOO> instead of <foo> for csr_*()

Some older toolchains may not have all the csr's defined. Update all
the csr functions to use the CSR_ #define values instead of the
toolchain defined values.

Suggested-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
Atish Patra
2019-02-12 18:32:06 -08:00
committed by Anup Patel
parent 4cb4d46875
commit 70a474d2c2
11 changed files with 84 additions and 76 deletions

View File

@@ -26,7 +26,7 @@ int sbi_misaligned_load_handler(u32 hartid, ulong mcause,
struct sbi_scratch *scratch)
{
union reg_data val;
ulong mstatus = csr_read(mstatus);
ulong mstatus = csr_read(CSR_MSTATUS);
ulong insn = get_insn(regs->mepc, &mstatus);
ulong addr = csr_read(CSR_MTVAL);
int i, fp = 0, shift = 0, len = 0;
@@ -112,7 +112,7 @@ int sbi_misaligned_store_handler(u32 hartid, ulong mcause,
struct sbi_scratch *scratch)
{
union reg_data val;
ulong mstatus = csr_read(mstatus);
ulong mstatus = csr_read(CSR_MSTATUS);
ulong insn = get_insn(regs->mepc, &mstatus);
ulong addr = csr_read(CSR_MTVAL);
int i, len = 0;