commit 2573410cb02d2f261c9d8b0c7422e0353c994af2
parent 90fddd88f9e4a9dfc9aed846dd8572c3b6a2ec8f
Author: Michail Konstantinos Dimopoulos <mk@mcdim.xyz>
Date: Thu, 3 Sep 2026 06:57:26 +0300
Added trap.h
Diffstat:
| A | trap.h | | | 25 | +++++++++++++++++++++++++ |
1 file changed, 25 insertions(+), 0 deletions(-)
diff --git a/trap.h b/trap.h
@@ -0,0 +1,25 @@
+#ifndef TRAP_H
+#define TRAP_H
+
+typedef enum {
+ TRAP_NONE = 0,
+ TRAP_BREAKPOINT,
+ TRAP_ECALL,
+ TRAP_ILLEGAL_INSTRUCTION,
+ TRAP_INSTRUCTION_MISALIGNED,
+ TRAP_INSTRUCTION_ACCESS_FAULT,
+/*
+ TRAP_LOAD_MISALIGNED,
+ TRAP_LOAD_ACCESS_FAULT,
+ TRAP_STORE_MISALIGNED,
+ TRAP_STORE_ACCESS_FAULT
+*/
+} trap_cause_t;
+
+typedef struct {
+ trap_cause_t cause;
+ uint32_t pc;
+ uint32_t tval;
+} trap_info_t;
+
+#endif