From cc6aab7c3f96a07846d5c541a8c1826fb322b4e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Autin?= Date: Thu, 23 Mar 2023 20:58:10 +0100 Subject: [PATCH] Documented ExceptionType --- src/simulator/machine.rs | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/simulator/machine.rs b/src/simulator/machine.rs index d90c950..ff4c0e0 100644 --- a/src/simulator/machine.rs +++ b/src/simulator/machine.rs @@ -6,27 +6,26 @@ use super::{decode::{Instruction, decode}, interrupt::Interrupt}; use super::global::*; use std::fs::File; - -/* -* Decommenter la variant si il est utilisé quelque part - */ +/// Exceptions +/// todo: is this really supposed to stand in machine.rs? pub enum ExceptionType { - //Everything ok! + /// Everything ok NoException, - //SYSCALL_EXCEPTION,//A program executed a system call. - PagefaultException,//Page fault exception - ReadOnlyException,//Write attempted to a page marked "read-only" */ - BusErrorException, - /* translation resulted - in an invalid physical - address (mis-aligned or - out-of-bounds) */ - AddressErrorException, /* Reference that was - not mapped in the address - space */ - //OVERFLOW_EXCEPTION, //Integer overflow in add or sub. - //ILLEGALINSTR_EXCEPTION, //Unimplemented or reserved instr. - //NUM_EXCEPTION_TYPES + /// A program executed a system call + SyscallException, + /// Page fault exception + PagefaultException, + /// Write attempted to a page marked "read-only" + ReadOnlyException, + /// Translation resulted in an invalid physical address (mis-aligned or out-of-bounds) + BusErrorException, + /// Reference which was not mapped in the address space + AddressErrorException, + /// Integer overflow in add or sub + OverflowException, + /// Unimplemented or reserved instruction + IllegalInstrException, + NumExceptionTypes }