For readability, maintainability and future scalability, convert theSorry for noticing it so late. And thanks to Bjorn for pointing it out.
bottom half of the exception handling to C.
Mostly the assembly code is converted to C in a relatively
straightforward manner.
However, there are two modifications I need to mention:
1. the cause I.E the CSR_CAUSE value is passed to do_traps() via. 2nd
param, do_traps() doesn't get it from pt_regs because this way an extra
memory load is needed, the exception handling sits in hot code path,
every instruction matters.
2.To cope with SIFIVE_CIP_453 errata, it looks like we don't need
alternative mechanism any more after the asm->c conversion. Just
replace the excp_vect_table two entries.
Signed-off-by: Jisheng Zhang <jszhang@xxxxxxxxxx>
---
arch/riscv/errata/sifive/errata.c | 25 ++++++++---
arch/riscv/include/asm/asm-prototypes.h | 1 +
arch/riscv/include/asm/errata_list.h | 5 +--
arch/riscv/kernel/entry.S | 57 +------------------------
arch/riscv/kernel/traps.c | 37 ++++++++++++++++
5 files changed, 61 insertions(+), 64 deletions(-)