Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Au <andrewau@microsoft.com>2017-07-07 18:59:18 +0300
committerAndrew Au <andrewau@microsoft.com>2017-07-07 18:59:18 +0300
commita61fac9dce2b1873a61cbe70489d8c0ecdad3ad4 (patch)
tree9dc81f67e77366aa2c4af1a74cf668b9bb69a518 /src/Runtime.Base
parentb5be0e6aac9002f171012ee6c48488d7d43448d9 (diff)
(On behalf of Jan Vorlicek) Thread abort stage 1
[tfs-changeset: 1664997]
Diffstat (limited to 'src/Runtime.Base')
-rw-r--r--src/Runtime.Base/src/System/Runtime/ExceptionHandling.cs19
-rw-r--r--src/Runtime.Base/src/System/Runtime/ExceptionIDs.cs1
-rw-r--r--src/Runtime.Base/src/System/Runtime/InternalCalls.cs4
3 files changed, 22 insertions, 2 deletions
diff --git a/src/Runtime.Base/src/System/Runtime/ExceptionHandling.cs b/src/Runtime.Base/src/System/Runtime/ExceptionHandling.cs
index 78bf58608..5b02c8ef7 100644
--- a/src/Runtime.Base/src/System/Runtime/ExceptionHandling.cs
+++ b/src/Runtime.Base/src/System/Runtime/ExceptionHandling.cs
@@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
+using System.Runtime;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -400,7 +401,7 @@ namespace System.Runtime
case ExceptionIDs.InvalidCast:
return new InvalidCastException();
-
+
default:
Debug.Assert(false, "unexpected ExceptionID");
FallbackFailFast(RhFailFastReason.InternalError, null);
@@ -413,6 +414,7 @@ namespace System.Runtime
{
STATUS_REDHAWK_NULL_REFERENCE = 0x00000000u,
STATUS_REDHAWK_WRITE_BARRIER_NULL_REFERENCE = 0x00000042u,
+ STATUS_REDHAWK_THREAD_ABORT = 0x00000043u,
STATUS_DATATYPE_MISALIGNMENT = 0x80000002u,
STATUS_ACCESS_VIOLATION = 0xC0000005u,
@@ -542,6 +544,10 @@ namespace System.Runtime
exceptionId = ExceptionIDs.NullReference;
break;
+ case (uint)HwExceptionCode.STATUS_REDHAWK_THREAD_ABORT:
+ exceptionId = ExceptionIDs.ThreadAbort;
+ break;
+
case (uint)HwExceptionCode.STATUS_DATATYPE_MISALIGNMENT:
exceptionId = ExceptionIDs.DataMisaligned;
break;
@@ -569,7 +575,16 @@ namespace System.Runtime
break;
}
- Exception exceptionToThrow = GetClasslibException(exceptionId, faultingCodeAddress);
+ Exception exceptionToThrow;
+
+ if (exceptionId == ExceptionIDs.ThreadAbort)
+ {
+ exceptionToThrow = InternalCalls.RhpGetThreadAbortException();
+ }
+ else
+ {
+ exceptionToThrow = GetClasslibException(exceptionId, faultingCodeAddress);
+ }
exInfo.Init(exceptionToThrow, instructionFault);
DispatchEx(ref exInfo._frameIter, ref exInfo, MaxTryRegionIdx);
diff --git a/src/Runtime.Base/src/System/Runtime/ExceptionIDs.cs b/src/Runtime.Base/src/System/Runtime/ExceptionIDs.cs
index 52d5830c7..dc0b16a72 100644
--- a/src/Runtime.Base/src/System/Runtime/ExceptionIDs.cs
+++ b/src/Runtime.Base/src/System/Runtime/ExceptionIDs.cs
@@ -16,5 +16,6 @@ namespace System.Runtime
NullReference = 8,
AccessViolation = 9,
DataMisaligned = 10,
+ ThreadAbort = 11,
}
}
diff --git a/src/Runtime.Base/src/System/Runtime/InternalCalls.cs b/src/Runtime.Base/src/System/Runtime/InternalCalls.cs
index 3fb169472..0aee9900a 100644
--- a/src/Runtime.Base/src/System/Runtime/InternalCalls.cs
+++ b/src/Runtime.Base/src/System/Runtime/InternalCalls.cs
@@ -397,6 +397,10 @@ namespace System.Runtime
[ManuallyManaged(GcPollPolicy.Never)]
internal extern static int RhpGetThunkBlockSize();
+ [RuntimeImport(Redhawk.BaseName, "RhpGetThreadAbortException")]
+ [MethodImpl(MethodImplOptions.InternalCall)]
+ internal extern static Exception RhpGetThreadAbortException();
+
//------------------------------------------------------------------------------------------------------------
// PInvoke-based internal calls
//