summaryrefslogtreecommitdiff
path: root/src/exceptions.rs
diff options
context:
space:
mode:
authortaitep <taitep@taitep.se>2025-12-24 13:56:41 +0100
committertaitep <taitep@taitep.se>2025-12-24 13:56:41 +0100
commit09d90643726d2a86952473e27b6e5d64543e41a0 (patch)
tree52d0ebf404675e1ae359dd77af406131a0623111 /src/exceptions.rs
parent3f789442c0be7d0222209d98dde21efcff7602d0 (diff)
EXCEPTION SYSTEM (initial version - may change later)
Diffstat (limited to 'src/exceptions.rs')
-rw-r--r--src/exceptions.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/exceptions.rs b/src/exceptions.rs
new file mode 100644
index 0000000..2929d65
--- /dev/null
+++ b/src/exceptions.rs
@@ -0,0 +1,30 @@
+// Copyright (c) 2025 taitep
+// SPDX-License-Identifier: MIT
+//
+// This file is part of TRVE (https://gitea.taitep.se/taitep/trve)
+// See LICENSE file in the project root for full license text.
+
+use int_enum::IntEnum;
+
+#[repr(u8)]
+#[allow(dead_code)]
+#[derive(Debug, Clone, Copy, PartialEq, Eq, IntEnum)]
+pub enum ExceptionType {
+ InstructionAccessMisaligned = 0,
+ InstructionAccessFault = 1,
+ IllegalInstruction = 2,
+ Breakpoint = 3,
+ LoadAddressMisaligned = 4,
+ LoadAccessFault = 5,
+ StoreAmoAddressMisaligned = 6,
+ StoreAmoAccessFault = 7,
+ EnvironmentCallFromUMode = 8,
+ EnvironmentCallFromSMode = 9,
+ EnvironmentCallFromMMode = 11,
+ InstructionPageFault = 12,
+ LoadPageFault = 13,
+ StoreAmoPageFault = 15,
+ DoubleTrap = 16,
+ SoftwareCheck = 18,
+ HardwareError = 19,
+}