RISC-V: Access CSRs using CSR numbers
authorAnup Patel <Anup.Patel@wdc.com>
Thu, 25 Apr 2019 08:38:41 +0000 (08:38 +0000)
committerPalmer Dabbelt <palmer@sifive.com>
Fri, 17 May 2019 03:42:11 +0000 (20:42 -0700)
commita3182c91ef4e7dda90ff080a4132efd3ecb8786a
tree5309b2480f3c6bb9e6df4d7921c7a71ce18dcc4d
parent6dcaf00487ca10d87e53fc8decb2e30f113c955d
RISC-V: Access CSRs using CSR numbers

We should prefer accessing CSRs using their CSR numbers because:
1. It compiles fine with older toolchains.
2. We can use latest CSR names in #define macro names of CSR numbers
   as-per RISC-V spec.
3. We can access newly added CSRs even if toolchain does not recognize
   newly addes CSRs by name.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
arch/riscv/include/asm/csr.h
arch/riscv/include/asm/irqflags.h
arch/riscv/include/asm/mmu_context.h
arch/riscv/kernel/entry.S
arch/riscv/kernel/head.S
arch/riscv/kernel/perf_event.c
arch/riscv/kernel/smp.c
arch/riscv/kernel/traps.c
arch/riscv/mm/fault.c