EXCEPTION SYSTEM (initial version - may change later)

This commit is contained in:
2025-12-24 13:56:41 +01:00
parent 3f789442c0
commit 09d9064372
11 changed files with 338 additions and 332 deletions

30
src/exceptions.rs Normal file
View File

@@ -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,
}