summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Léger <[email protected]>2025-01-10 14:15:51 +0100
committerAnup Patel <[email protected]>2025-01-30 10:32:18 +0530
commit9d2c9c6ca0a56b30379d4993ffcf8d707bd4a8ea (patch)
tree428bb95a37ce7979608d186307ddc7a3f165ab6b
parent3943ddbaab00247b391128ae0a1f9258d4007f4f (diff)
lib: sbi: move sbi_double_trap_handler() to a dedicated header
We will add new functions to sbi_double_trap.c in order to register an SSE event, split this to a header as part of preparation work. Signed-off-by: Clément Léger <[email protected]> Reviewed-by: Anup Patel <[email protected]>
-rw-r--r--include/sbi/sbi_double_trap.h20
-rw-r--r--include/sbi/sbi_trap_ldst.h2
-rw-r--r--lib/sbi/sbi_trap.c1
3 files changed, 21 insertions, 2 deletions
diff --git a/include/sbi/sbi_double_trap.h b/include/sbi/sbi_double_trap.h
new file mode 100644
index 00000000..c3d64dfd
--- /dev/null
+++ b/include/sbi/sbi_double_trap.h
@@ -0,0 +1,20 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2025 Rivos Inc.
+ *
+ * Authors:
+ * Clément Léger <[email protected]>
+ */
+
+#ifndef __SBI_DOUBLE_TRAP_H__
+#define __SBI_DOUBLE_TRAP_H__
+
+#include <sbi/sbi_types.h>
+#include <sbi/sbi_trap.h>
+
+int sbi_double_trap_handler(struct sbi_trap_context *tcntx);
+
+void sbi_double_trap_init(struct sbi_scratch *scratch);
+
+#endif
diff --git a/include/sbi/sbi_trap_ldst.h b/include/sbi/sbi_trap_ldst.h
index 34877ccc..a6a6c75b 100644
--- a/include/sbi/sbi_trap_ldst.h
+++ b/include/sbi/sbi_trap_ldst.h
@@ -28,8 +28,6 @@ int sbi_load_access_handler(struct sbi_trap_context *tcntx);
int sbi_store_access_handler(struct sbi_trap_context *tcntx);
-int sbi_double_trap_handler(struct sbi_trap_context *tcntx);
-
ulong sbi_misaligned_tinst_fixup(ulong orig_tinst, ulong new_tinst,
ulong addr_offset);
diff --git a/lib/sbi/sbi_trap.c b/lib/sbi/sbi_trap.c
index 242ffe9b..e63a563b 100644
--- a/lib/sbi/sbi_trap.c
+++ b/lib/sbi/sbi_trap.c
@@ -11,6 +11,7 @@
#include <sbi/riscv_encoding.h>
#include <sbi/sbi_bitops.h>
#include <sbi/sbi_console.h>
+#include <sbi/sbi_double_trap.h>
#include <sbi/sbi_ecall.h>
#include <sbi/sbi_error.h>
#include <sbi/sbi_hart.h>