Commit 4f3bad6e authored by Anup Patel's avatar Anup Patel Committed by Anup Patel
Browse files

lib: sbi: Handle the case where MTVAL has illegal instruction address



The Kendryte K210 follows RISC-V v1.9 spec so MTVAL has instruction
address (instead of instruction encoding) on illegal instruction trap.

To handle above case, we fix sbi_illegal_insn_handler() without any
impact on RISC-V v1.10 (or higher) systems. This achieved by exploiting
the fact that program counter (and instruction address) is always 2-byte
aligned in RISC-V world.

Signed-off-by: default avatarAnup Patel <anup.patel@wdc.com>
Tested-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: default avatarBin Meng <bin.meng@windriver.com>
Reviewed-by: default avatarAtish Patra <atish.patra@wdc.com>
parent e435ba05
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment