Exemplo n.º 1
0
 public TrueCryptException(ExceptionCause cause, int errorCode, string ioControl, string message) :
     base(message)
 {
     this.cause     = cause;
     this.errorCode = errorCode;
     this.ioControl = ioControl;
 }
Exemplo n.º 2
0
        public static MatrixInvertException Create(Matrix matrix, ExceptionCause cause)
        {
            var message = "Matrix is not invertable, because it ";

            switch (cause)
            {
            case ExceptionCause.NotSquare:
                message += "is not square";
                break;

            case ExceptionCause.Singular:
                message += "is singular";
                break;
            }
            return(new MatrixInvertException(message, matrix, cause));
        }
Exemplo n.º 3
0
 public TrueCryptException(ExceptionCause cause) :
     this(cause, null)
 {
 }
Exemplo n.º 4
0
 public TrueCryptException(ExceptionCause cause, string message) :
     this(cause, 0, message)
 {
 }
Exemplo n.º 5
0
 public TrueCryptException(ExceptionCause cause, int errorCode, string message) :
     this(cause, errorCode, null, message)
 {
 }
Exemplo n.º 6
0
 public MatrixInvertException(string message, Matrix matrix, ExceptionCause cause) : base(message)
 {
     Matrix = matrix;
     Cause  = cause;
 }
 public ExpressionParserException(long offset, ExceptionCause cause, string message = null) : base(message ?? cause.ToString())
 {
     Offset = offset;
     Cause  = cause;
 }
Exemplo n.º 8
0
        public void Trigger(Interrupt priority, ExceptionCause cause)
        {
            switch (priority)
            {
                case Interrupt.SynchronizeSignal:
                case Interrupt.MemoryFault:
                case Interrupt.Timer0:
                case Interrupt.Timer1:
                case Interrupt.Message:
                case Interrupt.DirectAccess0:
                case Interrupt.DirectAccess1:
                case Interrupt.WiredAnd:
                    if (cause != ExceptionCause.None)
                        throw new ArgumentException(
                            "Exception cause not allowed for {0}.".Interpolate(priority),
                            "priority");

                    break;
                case Interrupt.SoftwareException:
                case Interrupt.User:
                    if (cause == ExceptionCause.None)
                        throw new ArgumentException(
                            "Exception cause required for {0}.".Interpolate(priority),
                            "priority");

                    break;
                default:
                    throw new ArgumentException(
                        "Invalid Interrupt value ({0}).".Interpolate(priority),
                        "priority");
            }

            var exCause = 0;

            switch (cause)
            {
                case ExceptionCause.None:
                    break;
                case ExceptionCause.Unimplemented:
                    exCause = Core.Machine.Architecture == Architecture.EpiphanyIV ? 0xF : 0x4;
                    break;
                case ExceptionCause.SoftwareInterrupt:
                    exCause = Core.Machine.Architecture == Architecture.EpiphanyIV ? 0xE : 0x1;
                    break;
                case ExceptionCause.UnalignedAccess:
                    exCause = Core.Machine.Architecture == Architecture.EpiphanyIV ? 0xD : 0x2;
                    break;
                case ExceptionCause.IllegalAccess:
                    exCause = Core.Machine.Architecture == Architecture.EpiphanyIV ? 0xC : 0x5;
                    break;
                case ExceptionCause.FloatingPoint:
                    exCause = Core.Machine.Architecture == Architecture.EpiphanyIV ? 0x7 : 0x3;
                    break;
                default:
                    throw new ArgumentException(
                        "Invalid ExceptionCause value ({0}).".Interpolate(cause),
                        "cause");
            }

            lock (_lock)
            {
                Core.Registers.InterruptLatch = Bits.Set(Core.Registers.InterruptLatch, (int)priority);

                if (cause != ExceptionCause.None)
                    Core.Registers.CoreStatus = Bits.Insert(Core.Registers.CoreStatus, (uint)exCause, 16, 4);
            }
        }
Exemplo n.º 9
0
 public RegistrationException(string message, Exception innerException, ExceptionCause cause = ExceptionCause.Unknown)
     : base(message, innerException)
 {
     Cause = cause;
 }
Exemplo n.º 10
0
 public RegistrationException(string message, List <string> details, Exception innerException, ExceptionCause cause = ExceptionCause.Unknown)
     : base(message, innerException)
 {
     Details = details;
     Cause   = cause;
 }
Exemplo n.º 11
0
 public TrueCryptException(ExceptionCause cause)
     : this(cause, null)
 {
 }
Exemplo n.º 12
0
 public TrueCryptException(ExceptionCause cause, string message)
     : this(cause, 0, message)
 {
 }
Exemplo n.º 13
0
 public TrueCryptException(ExceptionCause cause, int errorCode, string message)
     : this(cause, errorCode, null, message)
 {
 }
Exemplo n.º 14
0
 public TrueCryptException(ExceptionCause cause, int errorCode, string ioControl, string message)
     : base(message)
 {
     this.cause = cause;
     this.errorCode = errorCode;
     this.ioControl = ioControl;
 }
Exemplo n.º 15
0
 public AuthenticationException(string message, ExceptionCause cause = ExceptionCause.Unknown)
     : base(message)
 {
     Cause = cause;
 }