riscv: Unaligned load/store handling for M_MODE
authorDamien Le Moal <damien.lemoal@wdc.com>
Mon, 16 Mar 2020 00:47:36 +0000 (09:47 +0900)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Fri, 3 Apr 2020 17:45:33 +0000 (10:45 -0700)
commit956d705dd279f70d5a222375fa97b637d6e8c43d
treee781737be5e254e288f757535a7d020d13286ec6
parentf1e58583b9c7ceae7f11646e9edf2561d67f29c9
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>
arch/riscv/kernel/Makefile
arch/riscv/kernel/traps.c
arch/riscv/kernel/traps_misaligned.c [new file with mode: 0644]