aboutsummaryrefslogtreecommitdiff
path: root/include/sbi/sbi_trap.h
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2018-12-27 21:39:13 +0530
committerAnup Patel <anup@brainfault.org>2018-12-31 09:28:26 +0530
commit5959312a5c26df64ebfdd9b4d926e88cf3d87840 (patch)
treef6e7f81f1a8611537c52385a439cbf291ee745be /include/sbi/sbi_trap.h
parent56e41f7a8db2c9bcfd1116748d496e5d40d2397b (diff)
lib: Redirect illegal instruction trap to S-mode when not handled
Currently, we fail with error SBI_ENOTSUPP when we are not able to handle illegal instruction trap. Instead, we should just redirect illegal instruction trap to S-mode when not handled. This redirection of illegal instruction trap will help lazy save/restore of floating point registers to work correctly in Linux kernel. Signed-off-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'include/sbi/sbi_trap.h')
-rw-r--r--include/sbi/sbi_trap.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/sbi/sbi_trap.h b/include/sbi/sbi_trap.h
index a6b22e4..4e5a054 100644
--- a/include/sbi/sbi_trap.h
+++ b/include/sbi/sbi_trap.h
@@ -51,6 +51,10 @@ struct sbi_trap_regs {
struct sbi_scratch;
+int sbi_trap_redirect(struct sbi_trap_regs *regs,
+ struct sbi_scratch *scratch,
+ ulong epc, ulong cause, ulong tval);
+
void sbi_trap_handler(struct sbi_trap_regs *regs,
struct sbi_scratch *scratch);