riscv: Unaligned load/store handling for M_MODE

Add handlers for unaligned load and store traps that may be generated
by applications. Code heavily inspired from the OpenSBI project.
Handling of the unaligned access traps is suitable for applications
compiled with or without compressed instructions and is independent of
the kernel CONFIG_RISCV_ISA_C option value.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
This commit is contained in:
Damien Le Moal 2020-03-16 09:47:36 +09:00 • committed by Palmer Dabbelt
commit 956d705dd2
No known key found for this signature in database
GPG key ID: 2E1319F35FBB1889
3 changed files with 395 additions and 4 deletions