summaryrefslogtreecommitdiff
path: root/src/exceptions.rs
diff options
context:
space:
mode:
authortaitep <taitep@taitep.se>2025-12-27 21:47:22 +0100
committertaitep <taitep@taitep.se>2025-12-27 21:47:22 +0100
commit8024af6b1348b5f47fabe5a1949de54607a33888 (patch)
tree4b9cbf86d2adc23eeb77eb8ed6c2d24ba7d57b32 /src/exceptions.rs
parent5c008bfc0446e4631dbab64be61159af04f78dd1 (diff)
Implement ECALL and EBREAK, the final RV64I instructions!
Diffstat (limited to 'src/exceptions.rs')
-rw-r--r--src/exceptions.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/exceptions.rs b/src/exceptions.rs
index 5e3f02f..6bc21f2 100644
--- a/src/exceptions.rs
+++ b/src/exceptions.rs
@@ -31,6 +31,15 @@ pub enum ExceptionType {
HardwareError = 19,
}
+impl ExceptionType {
+ pub fn with_no_value(self) -> Exception {
+ Exception {
+ type_: self,
+ value: 0,
+ }
+ }
+}
+
#[derive(Debug, Clone, Copy)]
pub struct Exception {
pub type_: ExceptionType,