diff --git a/src/coreclr/gc/gcimpl.h b/src/coreclr/gc/gcimpl.h index f7ff4c2f8d7d50..8dcf062889c85e 100644 --- a/src/coreclr/gc/gcimpl.h +++ b/src/coreclr/gc/gcimpl.h @@ -283,7 +283,7 @@ class GCHeap : public IGCHeapInternal //return TRUE if GC actually happens, otherwise FALSE bool StressHeap(gc_alloc_context * acontext); -#ifndef FEATURE_NATIVEAOT // Redhawk forces relocation a different way +#ifndef FEATURE_NATIVEAOT // NativeAOT forces relocation a different way #ifdef STRESS_HEAP protected: diff --git a/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/ExceptionHandling.cs b/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/ExceptionHandling.cs index 27b4b10d4030de..75e8b469d6f686 100644 --- a/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/ExceptionHandling.cs +++ b/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/ExceptionHandling.cs @@ -444,9 +444,9 @@ public static Exception GetRuntimeException(ExceptionIDs id) private enum HwExceptionCode : uint { - STATUS_REDHAWK_NULL_REFERENCE = 0x00000000u, - STATUS_REDHAWK_UNMANAGED_HELPER_NULL_REFERENCE = 0x00000042u, - STATUS_REDHAWK_THREAD_ABORT = 0x00000043u, + STATUS_NATIVEAOT_NULL_REFERENCE = 0x00000000u, + STATUS_NATIVEAOT_UNMANAGED_HELPER_NULL_REFERENCE = 0x00000042u, + STATUS_NATIVEAOT_THREAD_ABORT = 0x00000043u, STATUS_DATATYPE_MISALIGNMENT = 0x80000002u, STATUS_ACCESS_VIOLATION = 0xC0000005u, @@ -574,11 +574,11 @@ public static void RhThrowHwEx(uint exceptionCode, ref ExInfo exInfo) switch (exceptionCode) { - case (uint)HwExceptionCode.STATUS_REDHAWK_NULL_REFERENCE: + case (uint)HwExceptionCode.STATUS_NATIVEAOT_NULL_REFERENCE: exceptionId = ExceptionIDs.NullReference; break; - case (uint)HwExceptionCode.STATUS_REDHAWK_UNMANAGED_HELPER_NULL_REFERENCE: + case (uint)HwExceptionCode.STATUS_NATIVEAOT_UNMANAGED_HELPER_NULL_REFERENCE: // The write barrier where the actual fault happened has been unwound already. // The IP of this fault needs to be treated as return address, not as IP of // faulting instruction. @@ -587,7 +587,7 @@ public static void RhThrowHwEx(uint exceptionCode, ref ExInfo exInfo) break; #if NATIVEAOT - case (uint)HwExceptionCode.STATUS_REDHAWK_THREAD_ABORT: + case (uint)HwExceptionCode.STATUS_NATIVEAOT_THREAD_ABORT: exceptionToThrow = InternalCalls.RhpGetThreadAbortException(); break; #endif @@ -597,7 +597,7 @@ public static void RhThrowHwEx(uint exceptionCode, ref ExInfo exInfo) break; // N.B. -- AVs that have a read/write address lower than 64k are already transformed to - // HwExceptionCode.REDHAWK_NULL_REFERENCE prior to calling this routine. + // HwExceptionCode.STATUS_NATIVEAOT_NULL_REFERENCE prior to calling this routine. case (uint)HwExceptionCode.STATUS_ACCESS_VIOLATION: exceptionId = ExceptionIDs.AccessViolation; break; diff --git a/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/GCStress.cs b/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/GCStress.cs index 3478cf3353309d..70ddce2a354891 100644 --- a/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/GCStress.cs +++ b/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/GCStress.cs @@ -32,7 +32,7 @@ public static void Initialize() // drop the first element Head = Head.Next; - // notify redhawku.dll + // notify the runtime InternalCalls.RhpInitializeGcStress(); #endif // FEATURE_GC_STRESS } diff --git a/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/InteropServices/OutAttribute.cs b/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/InteropServices/OutAttribute.cs index 97838bea3476c1..5b89da9ac1096e 100644 --- a/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/InteropServices/OutAttribute.cs +++ b/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/InteropServices/OutAttribute.cs @@ -3,7 +3,7 @@ namespace System.Runtime.InteropServices { - // Not used in Redhawk. Only here as C# compiler requires it + // Only here as C# compiler requires it [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] internal sealed class OutAttribute : Attribute { diff --git a/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/TypeCast.cs b/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/TypeCast.cs index 8425f31f16cc15..bc5abe5dc63dcc 100644 --- a/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/TypeCast.cs +++ b/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/TypeCast.cs @@ -789,27 +789,12 @@ public static unsafe void StelemRef(object?[] array, nint index, object? obj) // This is supported only on arrays Debug.Assert(array is null || array.GetMethodTable()->IsArray, "first argument must be an array"); -#if INPLACE_RUNTIME // This will throw NullReferenceException if obj is null. if ((nuint)index >= (uint)array.Length) ThrowIndexOutOfRangeException(array); Debug.Assert(index >= 0); ref object? element = ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), index); -#else - if (array is null) - { - // TODO: If both array and obj are null, we're likely going to throw Redhawk's NullReferenceException. - // This should blame the caller. - throw obj.GetMethodTable()->GetClasslibException(ExceptionIDs.NullReference); - } - if ((uint)index >= (uint)array.Length) - { - throw array.GetMethodTable()->GetClasslibException(ExceptionIDs.IndexOutOfRange); - } - ref object rawData = ref Unsafe.As(ref Unsafe.As(array).Data); - ref object element = ref Unsafe.Add(ref rawData, index); -#endif MethodTable* elementType = array.GetMethodTable()->RelatedParameterType; diff --git a/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/__Finalizer.cs b/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/__Finalizer.cs index e0573bf5c1b830..2053b5b34620d3 100644 --- a/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/__Finalizer.cs +++ b/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/__Finalizer.cs @@ -7,7 +7,7 @@ using System.Runtime.InteropServices; // -// Implements the single finalizer thread for a Redhawk instance. Essentially waits for an event to fire +// Implements the single finalizer thread for a NativeAOT instance. Essentially waits for an event to fire // indicating finalization is necessary then drains the queue of pending finalizable objects, calling the // finalize method for each one. // diff --git a/src/coreclr/nativeaot/Runtime.Base/src/System/RuntimeTypeHandle.cs b/src/coreclr/nativeaot/Runtime.Base/src/System/RuntimeTypeHandle.cs index 8ecb99bc49e584..f216c6c3330ca5 100644 --- a/src/coreclr/nativeaot/Runtime.Base/src/System/RuntimeTypeHandle.cs +++ b/src/coreclr/nativeaot/Runtime.Base/src/System/RuntimeTypeHandle.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // System.Type and System.RuntimeTypeHandle are defined here as the C# compiler requires them -// In the redhawk runtime these are not used. In the class library there is an implementation that support typeof using System; using System.Runtime.CompilerServices; diff --git a/src/coreclr/nativeaot/Runtime/AsmOffsetsVerify.cpp b/src/coreclr/nativeaot/Runtime/AsmOffsetsVerify.cpp index 9e6a65bc7d9a3f..a0e4356830fbd3 100644 --- a/src/coreclr/nativeaot/Runtime/AsmOffsetsVerify.cpp +++ b/src/coreclr/nativeaot/Runtime/AsmOffsetsVerify.cpp @@ -4,7 +4,6 @@ #include "gcenv.h" #include "gcheaputilities.h" #include "rhassert.h" -#include "RedhawkWarnings.h" #include "slist.h" #include "regdisplay.h" #include "StackFrameIterator.h" diff --git a/src/coreclr/nativeaot/Runtime/CMakeLists.txt b/src/coreclr/nativeaot/Runtime/CMakeLists.txt index 2d73f2e7293cc7..c6a19f9b9bf023 100644 --- a/src/coreclr/nativeaot/Runtime/CMakeLists.txt +++ b/src/coreclr/nativeaot/Runtime/CMakeLists.txt @@ -120,8 +120,8 @@ if (WIN32) include_directories(windows) list(APPEND COMMON_RUNTIME_SOURCES - windows/PalRedhawkCommon.cpp - windows/PalRedhawkMinWin.cpp + windows/PalCommon.cpp + windows/PalMinWin.cpp ${GC_DIR}/windows/gcenv.windows.cpp ) @@ -155,7 +155,7 @@ else() endif() list(APPEND COMMON_RUNTIME_SOURCES - unix/PalRedhawkUnix.cpp + unix/PalUnix.cpp unix/PalCreateDump.cpp ${GC_DIR}/unix/gcenv.unix.cpp ${GC_DIR}/unix/numasupport.cpp diff --git a/src/coreclr/nativeaot/Runtime/CachedInterfaceDispatchPal.h b/src/coreclr/nativeaot/Runtime/CachedInterfaceDispatchPal.h index 7edc8347b28848..08665bca02f763 100644 --- a/src/coreclr/nativeaot/Runtime/CachedInterfaceDispatchPal.h +++ b/src/coreclr/nativeaot/Runtime/CachedInterfaceDispatchPal.h @@ -8,13 +8,12 @@ #include "CommonMacros.h" #include "daccess.h" #include "DebugMacrosExt.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "rhassert.h" #include "slist.h" #include "holder.h" #include "Crst.h" -#include "RedhawkWarnings.h" #include "TargetPtrs.h" #include "MethodTable.h" #include "Range.h" diff --git a/src/coreclr/nativeaot/Runtime/Crst.cpp b/src/coreclr/nativeaot/Runtime/Crst.cpp index e7779a6ad8fb23..36beaf28ed5656 100644 --- a/src/coreclr/nativeaot/Runtime/Crst.cpp +++ b/src/coreclr/nativeaot/Runtime/Crst.cpp @@ -3,8 +3,8 @@ #include "common.h" #include "CommonTypes.h" #include "CommonMacros.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "holder.h" #include "Crst.h" diff --git a/src/coreclr/nativeaot/Runtime/DebugHeader.cpp b/src/coreclr/nativeaot/Runtime/DebugHeader.cpp index 9db38fc25eb855..9c2a06892c629f 100644 --- a/src/coreclr/nativeaot/Runtime/DebugHeader.cpp +++ b/src/coreclr/nativeaot/Runtime/DebugHeader.cpp @@ -7,8 +7,8 @@ #include "gcinterface.dac.h" #include "rhassert.h" #include "TargetPtrs.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "holder.h" #include "RuntimeInstance.h" #include "regdisplay.h" @@ -80,7 +80,7 @@ struct DotNetRuntimeDebugHeader // v1-v4 were never doc'ed but history is source control if you need it // v5 - Thread now has an m_eeAllocContext field and the previous m_rgbAllocContextBuffer // field is nested inside of it. - // + // const uint16_t MajorVersion = 5; // This counter can be incremented to indicate back-compatible changes diff --git a/src/coreclr/nativeaot/Runtime/EHHelpers.cpp b/src/coreclr/nativeaot/Runtime/EHHelpers.cpp index c400bd021b983d..8c956352c2d453 100644 --- a/src/coreclr/nativeaot/Runtime/EHHelpers.cpp +++ b/src/coreclr/nativeaot/Runtime/EHHelpers.cpp @@ -10,8 +10,8 @@ #include "GcEnum.h" #include "shash.h" #include "TypeManager.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "holder.h" #include "Crst.h" #include "RuntimeInstance.h" @@ -357,13 +357,13 @@ int32_t RhpHardwareExceptionHandler(uintptr_t faultCode, uintptr_t faultAddress, if (pCodeManager != NULL) { // Make sure that the OS does not use our internal fault codes - ASSERT(faultCode != STATUS_REDHAWK_NULL_REFERENCE && faultCode != STATUS_REDHAWK_UNMANAGED_HELPER_NULL_REFERENCE); + ASSERT(faultCode != STATUS_NATIVEAOT_NULL_REFERENCE && faultCode != STATUS_NATIVEAOT_UNMANAGED_HELPER_NULL_REFERENCE); if (faultCode == STATUS_ACCESS_VIOLATION) { if (faultAddress < NULL_AREA_SIZE) { - faultCode = STATUS_REDHAWK_NULL_REFERENCE; + faultCode = STATUS_NATIVEAOT_NULL_REFERENCE; } } else if (faultCode == STATUS_STACK_OVERFLOW) @@ -387,7 +387,7 @@ int32_t RhpHardwareExceptionHandler(uintptr_t faultCode, uintptr_t faultAddress, { if (faultAddress < NULL_AREA_SIZE) { - faultCode = STATUS_REDHAWK_UNMANAGED_HELPER_NULL_REFERENCE; + faultCode = STATUS_NATIVEAOT_UNMANAGED_HELPER_NULL_REFERENCE; } // we were AV-ing in a helper - unwind our way to our caller @@ -490,13 +490,13 @@ LONG WINAPI RhpVectoredExceptionHandler(PEXCEPTION_POINTERS pExPtrs) if (pCodeManager != NULL) { // Make sure that the OS does not use our internal fault codes - ASSERT(faultCode != STATUS_REDHAWK_NULL_REFERENCE && faultCode != STATUS_REDHAWK_UNMANAGED_HELPER_NULL_REFERENCE); + ASSERT(faultCode != STATUS_NATIVEAOT_NULL_REFERENCE && faultCode != STATUS_NATIVEAOT_UNMANAGED_HELPER_NULL_REFERENCE); if (faultCode == STATUS_ACCESS_VIOLATION) { if (pExPtrs->ExceptionRecord->ExceptionInformation[1] < NULL_AREA_SIZE) { - faultCode = STATUS_REDHAWK_NULL_REFERENCE; + faultCode = STATUS_NATIVEAOT_NULL_REFERENCE; } } else if (faultCode == STATUS_STACK_OVERFLOW) @@ -525,7 +525,7 @@ LONG WINAPI RhpVectoredExceptionHandler(PEXCEPTION_POINTERS pExPtrs) { if (pExPtrs->ExceptionRecord->ExceptionInformation[1] < NULL_AREA_SIZE) { - faultCode = STATUS_REDHAWK_UNMANAGED_HELPER_NULL_REFERENCE; + faultCode = STATUS_NATIVEAOT_UNMANAGED_HELPER_NULL_REFERENCE; } // we were AV-ing in a helper - unwind our way to our caller diff --git a/src/coreclr/nativeaot/Runtime/GCHelpers.cpp b/src/coreclr/nativeaot/Runtime/GCHelpers.cpp index 9cd79820daf7ed..6e37321143e541 100644 --- a/src/coreclr/nativeaot/Runtime/GCHelpers.cpp +++ b/src/coreclr/nativeaot/Runtime/GCHelpers.cpp @@ -15,7 +15,7 @@ #include "forward_declarations.h" #include "RhConfig.h" -#include "PalRedhawkCommon.h" +#include "PalLimitedContext.h" #include "slist.h" #include "regdisplay.h" #include "StackFrameIterator.h" diff --git a/src/coreclr/nativeaot/Runtime/GCMemoryHelpers.cpp b/src/coreclr/nativeaot/Runtime/GCMemoryHelpers.cpp index b34c41c37bb34b..64401560751866 100644 --- a/src/coreclr/nativeaot/Runtime/GCMemoryHelpers.cpp +++ b/src/coreclr/nativeaot/Runtime/GCMemoryHelpers.cpp @@ -7,7 +7,7 @@ #include "common.h" #include "gcenv.h" -#include "PalRedhawkCommon.h" +#include "PalLimitedContext.h" #include "CommonMacros.inl" #include "GCMemoryHelpers.inl" @@ -30,14 +30,14 @@ FCIMPL2(void *, RhpGcSafeZeroMemory, void * mem, size_t size) } FCIMPLEND -#if defined(TARGET_X86) || defined(TARGET_AMD64) - // +#if defined(TARGET_X86) || defined(TARGET_AMD64) + // // Memory writes are already ordered - // - #define GCHeapMemoryBarrier() + // + #define GCHeapMemoryBarrier() #else - #define GCHeapMemoryBarrier() MemoryBarrier() -#endif + #define GCHeapMemoryBarrier() MemoryBarrier() +#endif // Move memory, in a way that is compatible with a move onto the heap, but // does not require the destination pointer to be on the heap. diff --git a/src/coreclr/nativeaot/Runtime/GcStressControl.cpp b/src/coreclr/nativeaot/Runtime/GcStressControl.cpp index ad3d9dfdd9ae8d..dc9506acebb0a6 100644 --- a/src/coreclr/nativeaot/Runtime/GcStressControl.cpp +++ b/src/coreclr/nativeaot/Runtime/GcStressControl.cpp @@ -8,8 +8,8 @@ #include "CommonTypes.h" #include "CommonMacros.h" #include "daccess.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "rhassert.h" #include "holder.h" #include "Crst.h" diff --git a/src/coreclr/nativeaot/Runtime/HandleTableHelpers.cpp b/src/coreclr/nativeaot/Runtime/HandleTableHelpers.cpp index 0804f99661a5eb..91750c078e4539 100644 --- a/src/coreclr/nativeaot/Runtime/HandleTableHelpers.cpp +++ b/src/coreclr/nativeaot/Runtime/HandleTableHelpers.cpp @@ -1,13 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// -// Helper functions that are p/invoked from redhawkm in order to expose handle table functionality to managed -// code. These p/invokes are special in that the handle table code requires we remain in co-operative mode -// (since these routines mutate the handle tables which are also accessed during garbage collections). The -// binder has special knowledge of these methods and doesn't generate the normal code to transition out of the -// runtime prior to the call. -// #include "common.h" #include "gcenv.h" #include "objecthandle.h" diff --git a/src/coreclr/nativeaot/Runtime/MethodTable.cpp b/src/coreclr/nativeaot/Runtime/MethodTable.cpp index 4edd82359e5fd1..024222c965191e 100644 --- a/src/coreclr/nativeaot/Runtime/MethodTable.cpp +++ b/src/coreclr/nativeaot/Runtime/MethodTable.cpp @@ -7,8 +7,8 @@ #include "rhassert.h" #include "rhbinder.h" #include "MethodTable.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "CommonMacros.inl" #include "MethodTable.inl" diff --git a/src/coreclr/nativeaot/Runtime/MiscHelpers.cpp b/src/coreclr/nativeaot/Runtime/MiscHelpers.cpp index 9fe749e23ed8c8..138c3917198ec4 100644 --- a/src/coreclr/nativeaot/Runtime/MiscHelpers.cpp +++ b/src/coreclr/nativeaot/Runtime/MiscHelpers.cpp @@ -9,8 +9,8 @@ #include "CommonTypes.h" #include "CommonMacros.h" #include "daccess.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "rhassert.h" #include "slist.h" #include "holder.h" @@ -76,7 +76,7 @@ EXTERN_C void QCALLTYPE RhFlushProcessWriteBuffers() PalFlushProcessWriteBuffers(); } -// Get the list of currently loaded Redhawk modules (as OS HMODULE handles). The caller provides a reference +// Get the list of currently loaded NativeAOT modules (as OS HMODULE handles). The caller provides a reference // to an array of pointer-sized elements and we return the total number of modules currently loaded (whether // that is less than, equal to or greater than the number of elements in the array). If there are more modules // loaded than the array will hold then the array is filled to capacity and the caller can tell further diff --git a/src/coreclr/nativeaot/Runtime/ObjectLayout.cpp b/src/coreclr/nativeaot/Runtime/ObjectLayout.cpp index 707d134fb5e118..eff0b754c18fa0 100644 --- a/src/coreclr/nativeaot/Runtime/ObjectLayout.cpp +++ b/src/coreclr/nativeaot/Runtime/ObjectLayout.cpp @@ -9,9 +9,8 @@ #include "CommonMacros.h" #include "daccess.h" #include "rhassert.h" -#include "RedhawkWarnings.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "TargetPtrs.h" #include "MethodTable.h" #include "ObjectLayout.h" diff --git a/src/coreclr/nativeaot/Runtime/ObjectLayout.h b/src/coreclr/nativeaot/Runtime/ObjectLayout.h index 606148a0f32704..6586961750893c 100644 --- a/src/coreclr/nativeaot/Runtime/ObjectLayout.h +++ b/src/coreclr/nativeaot/Runtime/ObjectLayout.h @@ -6,8 +6,7 @@ // // Bits stolen from the sync block index that the GC/HandleTable knows about (currently these are at the same -// positions as the mainline runtime but we can change this below when it becomes apparent how Redhawk will -// handle sync blocks). +// positions as the mainline runtime). #define BIT_SBLK_GC_RESERVE 0x20000000 #define BIT_SBLK_FINALIZER_RUN 0x40000000 diff --git a/src/coreclr/nativeaot/Runtime/PalRedhawk.h b/src/coreclr/nativeaot/Runtime/Pal.h similarity index 84% rename from src/coreclr/nativeaot/Runtime/PalRedhawk.h rename to src/coreclr/nativeaot/Runtime/Pal.h index dc4f66b6e7b858..c96f28effa6a6b 100644 --- a/src/coreclr/nativeaot/Runtime/PalRedhawk.h +++ b/src/coreclr/nativeaot/Runtime/Pal.h @@ -2,13 +2,13 @@ // The .NET Foundation licenses this file to you under the MIT license. // -// Provides declarations for external resources consumed by Redhawk. This comprises functionality +// Provides declarations for external resources consumed by NativeAOT. This comprises functionality // normally exported from Win32 libraries such as KERNEL32 and MSVCRT. When hosted on Win32 calls to these // functions become simple pass throughs to the native implementation via export forwarding entries in a PAL // (Platform Abstraction Layer) library. On other platforms the PAL library has actual code to emulate the // functionality of these same APIs. // -// In order to make it both obvious and intentional where Redhawk consumes an external API, such functions are +// In order to make it both obvious and intentional where NativeAOT consumes an external API, such functions are // decorated with an 'Pal' prefix. Ideally the associated supporting types, constants etc. would be // similarly isolated from their concrete Win32 definitions, making the extent of platform dependence within // the core explicit. For now that is too big a work item and we'll settle for manually restricting the use of @@ -25,11 +25,11 @@ #include "CommonTypes.h" #include "CommonMacros.h" +#include "PalLimitedContext.h" #include "gcenv.structs.h" // EEThreadId -#include "PalRedhawkCommon.h" -#ifndef PAL_REDHAWK_INCLUDED -#define PAL_REDHAWK_INCLUDED +#ifndef PAL_INCLUDED +#define PAL_INCLUDED /* Adapted from intrin.h - For compatibility with , some intrinsics are __cdecl except on x64 */ #if defined (_M_X64) @@ -64,8 +64,6 @@ #endif // TARGET_UNIX #ifdef TARGET_UNIX -// There are some fairly primitive type definitions below but don't pull them into the rest of Redhawk unless -// we have to (in which case these definitions will move to CommonTypes.h). typedef int32_t HRESULT; #define S_OK 0x0 @@ -102,8 +100,8 @@ typedef struct _EXCEPTION_RECORD EXCEPTION_RECORD, *PEXCEPTION_RECORD; #endif // TARGET_UNIX -#define STATUS_REDHAWK_NULL_REFERENCE ((uint32_t )0x00000000L) -#define STATUS_REDHAWK_UNMANAGED_HELPER_NULL_REFERENCE ((uint32_t )0x00000042L) +#define STATUS_NATIVEAOT_NULL_REFERENCE ((uint32_t )0x00000000L) +#define STATUS_NATIVEAOT_UNMANAGED_HELPER_NULL_REFERENCE ((uint32_t )0x00000042L) #ifdef TARGET_UNIX #define NULL_AREA_SIZE (4*1024) @@ -154,11 +152,7 @@ typedef char TCHAR; extern uint32_t g_RhNumberOfProcessors; -#ifndef DACCESS_COMPILE -#include "PalRedhawkFunctions.h" -#endif // !DACCESS_COMPILE - -// The Redhawk PAL must be initialized before any of its exports can be called. Returns true for a successful +// The NativeAOT PAL must be initialized before any of its exports can be called. Returns true for a successful // initialization and false on failure. bool PalInit(); @@ -240,6 +234,7 @@ HANDLE PalGetModuleHandleFromPointer(_In_ void* pointer); #ifdef TARGET_UNIX uint32_t PalGetOsPageSize(); +typedef int32_t (*PHARDWARE_EXCEPTION_HANDLER)(uintptr_t faultCode, uintptr_t faultAddress, PAL_LIMITED_CONTEXT* palContext, uintptr_t* arg0Reg, uintptr_t* arg1Reg); void PalSetHardwareExceptionHandler(PHARDWARE_EXCEPTION_HANDLER handler); #endif @@ -289,6 +284,29 @@ void* PalGetProcAddress(HANDLE module, const char* functionName); int32_t _stricmp(const char *string1, const char *string2); #endif // TARGET_UNIX -#include "PalRedhawkInline.h" +uint16_t PalCaptureStackBackTrace(uint32_t arg1, uint32_t arg2, void* arg3, uint32_t* arg4); +UInt32_BOOL PalCloseHandle(HANDLE arg1); +void PalFlushProcessWriteBuffers(); +uint32_t PalGetCurrentProcessId(); + +#ifdef UNICODE +uint32_t PalGetEnvironmentVariable(_In_opt_ LPCWSTR lpName, _Out_writes_to_opt_(nSize, return + 1) LPWSTR lpBuffer, _In_ uint32_t nSize); +#else +uint32_t PalGetEnvironmentVariable(_In_opt_ LPCSTR lpName, _Out_writes_to_opt_(nSize, return + 1) LPSTR lpBuffer, _In_ uint32_t nSize); +#endif + +UInt32_BOOL PalResetEvent(HANDLE arg1); +UInt32_BOOL PalSetEvent(HANDLE arg1); +uint32_t PalWaitForSingleObjectEx(HANDLE arg1, uint32_t arg2, UInt32_BOOL arg3); + +void PalGetSystemTimeAsFileTime(FILETIME * arg1); + +void RuntimeThreadShutdown(void* thread); + +typedef void (*ThreadExitCallback)(); + +extern ThreadExitCallback g_threadExitCallback; + +#include "PalInline.h" -#endif // !PAL_REDHAWK_INCLUDED +#endif // !PAL_INCLUDED diff --git a/src/coreclr/nativeaot/Runtime/PalRedhawkCommon.h b/src/coreclr/nativeaot/Runtime/PalLimitedContext.h similarity index 84% rename from src/coreclr/nativeaot/Runtime/PalRedhawkCommon.h rename to src/coreclr/nativeaot/Runtime/PalLimitedContext.h index fcab725f0dbe38..c5e36453687aef 100644 --- a/src/coreclr/nativeaot/Runtime/PalRedhawkCommon.h +++ b/src/coreclr/nativeaot/Runtime/PalLimitedContext.h @@ -1,17 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// -// Provide common definitions between the Redhawk and the Redhawk PAL implementation. This header file is used -// (rather than PalRedhawk.h) since the PAL implementation is built in a different environment than Redhawk -// code. For instance both environments may provide a definition of various common macros such as NULL. -// -// This header contains only environment neutral definitions (i.e. using only base C++ types and compositions -// of those types) and can thus be included from either environment without issue. -// - -#ifndef __PAL_REDHAWK_COMMON_INCLUDED -#define __PAL_REDHAWK_COMMON_INCLUDED + +#ifndef PAL_LIMITED_CONTEXT_INCLUDED +#define PAL_LIMITED_CONTEXT_INCLUDED #include "rhassert.h" @@ -217,14 +209,4 @@ struct PAL_LIMITED_CONTEXT #endif // TARGET_ARM }; -void RuntimeThreadShutdown(void* thread); - -typedef void (*ThreadExitCallback)(); - -extern ThreadExitCallback g_threadExitCallback; - -#ifdef TARGET_UNIX -typedef int32_t (*PHARDWARE_EXCEPTION_HANDLER)(uintptr_t faultCode, uintptr_t faultAddress, PAL_LIMITED_CONTEXT* palContext, uintptr_t* arg0Reg, uintptr_t* arg1Reg); -#endif - -#endif // __PAL_REDHAWK_COMMON_INCLUDED +#endif // PAL_LIMITED_CONTEXT_INCLUDED diff --git a/src/coreclr/nativeaot/Runtime/PalRedhawkFunctions.h b/src/coreclr/nativeaot/Runtime/PalRedhawkFunctions.h deleted file mode 100644 index 271cad80fab970..00000000000000 --- a/src/coreclr/nativeaot/Runtime/PalRedhawkFunctions.h +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -uint16_t PalCaptureStackBackTrace(uint32_t arg1, uint32_t arg2, void* arg3, uint32_t* arg4); -UInt32_BOOL PalCloseHandle(HANDLE arg1); -void PalFlushProcessWriteBuffers(); -uint32_t PalGetCurrentProcessId(); - -#ifdef UNICODE -uint32_t PalGetEnvironmentVariable(_In_opt_ LPCWSTR lpName, _Out_writes_to_opt_(nSize, return + 1) LPWSTR lpBuffer, _In_ uint32_t nSize); -#else -uint32_t PalGetEnvironmentVariable(_In_opt_ LPCSTR lpName, _Out_writes_to_opt_(nSize, return + 1) LPSTR lpBuffer, _In_ uint32_t nSize); -#endif - -UInt32_BOOL PalResetEvent(HANDLE arg1); -UInt32_BOOL PalSetEvent(HANDLE arg1); -uint32_t PalWaitForSingleObjectEx(HANDLE arg1, uint32_t arg2, UInt32_BOOL arg3); - -#ifdef PAL_REDHAWK_INCLUDED -void PalGetSystemTimeAsFileTime(FILETIME * arg1); -#endif diff --git a/src/coreclr/nativeaot/Runtime/RedhawkWarnings.h b/src/coreclr/nativeaot/Runtime/RedhawkWarnings.h deleted file mode 100644 index e3cc1118b5d8d3..00000000000000 --- a/src/coreclr/nativeaot/Runtime/RedhawkWarnings.h +++ /dev/null @@ -1,8 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// -// Disable some commonly ignored warnings -// - -MSVC_DISABLE_WARNING(4200) // nonstandard extension used : zero-sized array in struct/union diff --git a/src/coreclr/nativeaot/Runtime/RestrictedCallouts.cpp b/src/coreclr/nativeaot/Runtime/RestrictedCallouts.cpp index cf2cbf5df66934..782d7f5f9dc8bb 100644 --- a/src/coreclr/nativeaot/Runtime/RestrictedCallouts.cpp +++ b/src/coreclr/nativeaot/Runtime/RestrictedCallouts.cpp @@ -10,8 +10,8 @@ #include "CommonTypes.h" #include "CommonMacros.h" #include "daccess.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "rhassert.h" #include "slist.h" #include "holder.h" diff --git a/src/coreclr/nativeaot/Runtime/RhConfig.cpp b/src/coreclr/nativeaot/Runtime/RhConfig.cpp index 506cf750672bfa..23d405822b513b 100644 --- a/src/coreclr/nativeaot/Runtime/RhConfig.cpp +++ b/src/coreclr/nativeaot/Runtime/RhConfig.cpp @@ -4,8 +4,8 @@ #ifndef DACCESS_COMPILE #include "CommonTypes.h" #include "CommonMacros.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "holder.h" #include "RhConfig.h" diff --git a/src/coreclr/nativeaot/Runtime/RuntimeInstance.cpp b/src/coreclr/nativeaot/Runtime/RuntimeInstance.cpp index 9bdc8ac5ce9079..919a99a7148f2e 100644 --- a/src/coreclr/nativeaot/Runtime/RuntimeInstance.cpp +++ b/src/coreclr/nativeaot/Runtime/RuntimeInstance.cpp @@ -1,11 +1,12 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + #include "common.h" #include "CommonTypes.h" #include "CommonMacros.h" #include "daccess.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "rhassert.h" #include "slist.h" #include "holder.h" diff --git a/src/coreclr/nativeaot/Runtime/StackFrameIterator.cpp b/src/coreclr/nativeaot/Runtime/StackFrameIterator.cpp index 764e503af34896..eed5f5f152c71e 100644 --- a/src/coreclr/nativeaot/Runtime/StackFrameIterator.cpp +++ b/src/coreclr/nativeaot/Runtime/StackFrameIterator.cpp @@ -6,9 +6,8 @@ #include "CommonTypes.h" #include "CommonMacros.h" #include "daccess.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" -#include "RedhawkWarnings.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "rhassert.h" #include "slist.h" #include "regdisplay.h" diff --git a/src/coreclr/nativeaot/Runtime/StackFrameIterator.h b/src/coreclr/nativeaot/Runtime/StackFrameIterator.h index 9c1739c3951fb4..bf76e5c4438463 100644 --- a/src/coreclr/nativeaot/Runtime/StackFrameIterator.h +++ b/src/coreclr/nativeaot/Runtime/StackFrameIterator.h @@ -6,7 +6,7 @@ #include "CommonMacros.h" #include "ICodeManager.h" -#include "PalRedhawk.h" // NATIVE_CONTEXT +#include "Pal.h" // NATIVE_CONTEXT #include "regdisplay.h" #include "forward_declarations.h" diff --git a/src/coreclr/nativeaot/Runtime/SyncClean.cpp b/src/coreclr/nativeaot/Runtime/SyncClean.cpp index a856a584744acd..57ca29fce9c70b 100644 --- a/src/coreclr/nativeaot/Runtime/SyncClean.cpp +++ b/src/coreclr/nativeaot/Runtime/SyncClean.cpp @@ -4,8 +4,8 @@ #include "CommonTypes.h" #include "CommonMacros.h" #include "daccess.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "rhassert.h" #include "slist.h" #include "holder.h" diff --git a/src/coreclr/nativeaot/Runtime/ThunksMapping.cpp b/src/coreclr/nativeaot/Runtime/ThunksMapping.cpp index 11f38b82986e9b..9e087f6e9c1879 100644 --- a/src/coreclr/nativeaot/Runtime/ThunksMapping.cpp +++ b/src/coreclr/nativeaot/Runtime/ThunksMapping.cpp @@ -5,10 +5,10 @@ #include "CommonTypes.h" #include "CommonMacros.h" #include "daccess.h" -#include "PalRedhawkCommon.h" +#include "PalLimitedContext.h" #include "CommonMacros.inl" #include "volatile.h" -#include "PalRedhawk.h" +#include "Pal.h" #include "rhassert.h" diff --git a/src/coreclr/nativeaot/Runtime/TypeManager.cpp b/src/coreclr/nativeaot/Runtime/TypeManager.cpp index cb993dfd74ffa3..edba0b2ed20771 100644 --- a/src/coreclr/nativeaot/Runtime/TypeManager.cpp +++ b/src/coreclr/nativeaot/Runtime/TypeManager.cpp @@ -4,8 +4,8 @@ #include "CommonTypes.h" #include "CommonMacros.h" #include "daccess.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "holder.h" #include "rhassert.h" #include "slist.h" diff --git a/src/coreclr/nativeaot/Runtime/UniversalTransitionHelpers.cpp b/src/coreclr/nativeaot/Runtime/UniversalTransitionHelpers.cpp index 649aac21ac8d18..aabf45392313ae 100644 --- a/src/coreclr/nativeaot/Runtime/UniversalTransitionHelpers.cpp +++ b/src/coreclr/nativeaot/Runtime/UniversalTransitionHelpers.cpp @@ -1,10 +1,11 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + #include "common.h" #include "CommonTypes.h" #include "CommonMacros.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #ifdef _DEBUG #define TRASH_SAVED_ARGUMENT_REGISTERS diff --git a/src/coreclr/nativeaot/Runtime/allocheap.cpp b/src/coreclr/nativeaot/Runtime/allocheap.cpp index b50ded0af56c17..dd8425cc0ef519 100644 --- a/src/coreclr/nativeaot/Runtime/allocheap.cpp +++ b/src/coreclr/nativeaot/Runtime/allocheap.cpp @@ -5,8 +5,8 @@ #include "CommonMacros.h" #include "daccess.h" #include "DebugMacrosExt.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "rhassert.h" #include "slist.h" #include "holder.h" diff --git a/src/coreclr/nativeaot/Runtime/amd64/AsmMacros.inc b/src/coreclr/nativeaot/Runtime/amd64/AsmMacros.inc index 13b65d17570366..a81cfc9679a4b6 100644 --- a/src/coreclr/nativeaot/Runtime/amd64/AsmMacros.inc +++ b/src/coreclr/nativeaot/Runtime/amd64/AsmMacros.inc @@ -367,8 +367,8 @@ TrapThreadsFlags_None equ 0 TrapThreadsFlags_AbortInProgress equ 1 TrapThreadsFlags_TrapThreads equ 2 -;; This must match HwExceptionCode.STATUS_REDHAWK_THREAD_ABORT -STATUS_REDHAWK_THREAD_ABORT equ 43h +;; This must match HwExceptionCode.STATUS_NATIVEAOT_THREAD_ABORT +STATUS_NATIVEAOT_THREAD_ABORT equ 43h ;; ;; CONSTANTS -- SYMBOLS diff --git a/src/coreclr/nativeaot/Runtime/amd64/ExceptionHandling.asm b/src/coreclr/nativeaot/Runtime/amd64/ExceptionHandling.asm index e42f6fd3e2d8aa..928a3a9bce785a 100644 --- a/src/coreclr/nativeaot/Runtime/amd64/ExceptionHandling.asm +++ b/src/coreclr/nativeaot/Runtime/amd64/ExceptionHandling.asm @@ -508,7 +508,7 @@ endif je @f ;; It was the ThreadAbortException, so rethrow it - mov rcx, STATUS_REDHAWK_THREAD_ABORT + mov rcx, STATUS_NATIVEAOT_THREAD_ABORT mov rdx, rax ;; rdx <- continuation address as exception RIP lea rax, [RhpThrowHwEx] ;; Throw the ThreadAbortException as a special kind of hardware exception diff --git a/src/coreclr/nativeaot/Runtime/amd64/GcProbe.S b/src/coreclr/nativeaot/Runtime/amd64/GcProbe.S index ef4709055f0101..dbf23d54bc928a 100644 --- a/src/coreclr/nativeaot/Runtime/amd64/GcProbe.S +++ b/src/coreclr/nativeaot/Runtime/amd64/GcProbe.S @@ -131,7 +131,7 @@ NESTED_ENTRY RhpWaitForGC, _TEXT, NoHandler ret LOCAL_LABEL(Abort): POP_PROBE_FRAME - mov rcx, STATUS_REDHAWK_THREAD_ABORT + mov rcx, STATUS_NATIVEAOT_THREAD_ABORT pop rdx // return address as exception RIP jmp C_FUNC(RhpThrowHwEx) // Throw the ThreadAbortException as a special kind of hardware exception diff --git a/src/coreclr/nativeaot/Runtime/amd64/GcProbe.asm b/src/coreclr/nativeaot/Runtime/amd64/GcProbe.asm index ae06ae89188688..86f5816ade7985 100644 --- a/src/coreclr/nativeaot/Runtime/amd64/GcProbe.asm +++ b/src/coreclr/nativeaot/Runtime/amd64/GcProbe.asm @@ -50,7 +50,7 @@ endm ;; registers and return value to their values from before the probe was called (while also updating any ;; object refs or byrefs). ;; -POP_PROBE_FRAME macro +POP_PROBE_FRAME macro movdqa xmm0, [rsp + 20h] add rsp, 20h + 10h + 8 ; deallocate stack and discard saved m_RIP pop rbp @@ -124,7 +124,7 @@ NESTED_ENTRY RhpWaitForGC, _TEXT ret Abort: POP_PROBE_FRAME - mov rcx, STATUS_REDHAWK_THREAD_ABORT + mov rcx, STATUS_NATIVEAOT_THREAD_ABORT pop rdx ;; return address as exception RIP jmp RhpThrowHwEx ;; Throw the ThreadAbortException as a special kind of hardware exception diff --git a/src/coreclr/nativeaot/Runtime/arm/GcProbe.S b/src/coreclr/nativeaot/Runtime/arm/GcProbe.S index 0092be687bcec5..ad6dbe8ecac67f 100644 --- a/src/coreclr/nativeaot/Runtime/arm/GcProbe.S +++ b/src/coreclr/nativeaot/Runtime/arm/GcProbe.S @@ -85,7 +85,7 @@ NESTED_ENTRY RhpWaitForGC, _TEXT, NoHandler PUSH_PROBE_FRAME r2, r3, r12 - ldr r0, [r2, #OFFSETOF__Thread__m_pDeferredTransitionFrame] + ldr r0, [r2, #OFFSETOF__Thread__m_pDeferredTransitionFrame] bl RhpWaitForGC2 ldr r2, [sp, #OFFSETOF__PInvokeTransitionFrame__m_Flags] @@ -97,7 +97,7 @@ NESTED_ENTRY RhpWaitForGC, _TEXT, NoHandler LOCAL_LABEL(ThrowThreadAbort): POP_PROBE_FRAME - mov r0, #STATUS_REDHAWK_THREAD_ABORT + mov r0, #STATUS_NATIVEAOT_THREAD_ABORT mov r1, lr // return address as exception PC b C_FUNC(RhpThrowHwEx) NESTED_END RhpWaitForGC diff --git a/src/coreclr/nativeaot/Runtime/arm64/AsmMacros.h b/src/coreclr/nativeaot/Runtime/arm64/AsmMacros.h index 7e02484922ba16..09e5493c7fb46a 100644 --- a/src/coreclr/nativeaot/Runtime/arm64/AsmMacros.h +++ b/src/coreclr/nativeaot/Runtime/arm64/AsmMacros.h @@ -72,8 +72,8 @@ TrapThreadsFlags_TrapThreads equ 2 TrapThreadsFlags_AbortInProgress_Bit equ 0 TrapThreadsFlags_TrapThreads_Bit equ 1 -;; This must match HwExceptionCode.STATUS_REDHAWK_THREAD_ABORT -STATUS_REDHAWK_THREAD_ABORT equ 0x43 +;; This must match HwExceptionCode.STATUS_NATIVEAOT_THREAD_ABORT +STATUS_NATIVEAOT_THREAD_ABORT equ 0x43 ;; ;; Rename fields of nested structs diff --git a/src/coreclr/nativeaot/Runtime/arm64/ExceptionHandling.S b/src/coreclr/nativeaot/Runtime/arm64/ExceptionHandling.S index 0f7e1b7e31aec8..40c0b37b9917ec 100644 --- a/src/coreclr/nativeaot/Runtime/arm64/ExceptionHandling.S +++ b/src/coreclr/nativeaot/Runtime/arm64/ExceptionHandling.S @@ -506,7 +506,7 @@ LOCAL_LABEL(DonePopping): // It was the ThreadAbortException, so rethrow it // reset SP mov x1, x0 // x1 <- continuation address as exception PC - mov w0, #STATUS_REDHAWK_THREAD_ABORT + mov w0, #STATUS_NATIVEAOT_THREAD_ABORT mov sp, x2 b C_FUNC(RhpThrowHwEx) diff --git a/src/coreclr/nativeaot/Runtime/arm64/ExceptionHandling.asm b/src/coreclr/nativeaot/Runtime/arm64/ExceptionHandling.asm index 3c2437fb91350f..5918745625fd83 100644 --- a/src/coreclr/nativeaot/Runtime/arm64/ExceptionHandling.asm +++ b/src/coreclr/nativeaot/Runtime/arm64/ExceptionHandling.asm @@ -482,7 +482,7 @@ DonePopping ;; It was the ThreadAbortException, so rethrow it ;; reset SP mov x1, x0 ;; x1 <- continuation address as exception PC - mov w0, #STATUS_REDHAWK_THREAD_ABORT + mov w0, #STATUS_NATIVEAOT_THREAD_ABORT mov sp, x2 b RhpThrowHwEx diff --git a/src/coreclr/nativeaot/Runtime/arm64/GcProbe.S b/src/coreclr/nativeaot/Runtime/arm64/GcProbe.S index b8ae78630a6eab..42ef0e3b510cc3 100644 --- a/src/coreclr/nativeaot/Runtime/arm64/GcProbe.S +++ b/src/coreclr/nativeaot/Runtime/arm64/GcProbe.S @@ -149,7 +149,7 @@ NESTED_ENTRY RhpWaitForGC, _TEXT, NoHandler .cfi_restore_state LOCAL_LABEL(ThrowThreadAbort): POP_PROBE_FRAME - mov w0, #STATUS_REDHAWK_THREAD_ABORT + mov w0, #STATUS_NATIVEAOT_THREAD_ABORT mov x1, lr // return address as exception PC b C_FUNC(RhpThrowHwEx) NESTED_END RhpWaitForGC diff --git a/src/coreclr/nativeaot/Runtime/arm64/GcProbe.asm b/src/coreclr/nativeaot/Runtime/arm64/GcProbe.asm index 4de07d18896971..bd6e6d37652f23 100644 --- a/src/coreclr/nativeaot/Runtime/arm64/GcProbe.asm +++ b/src/coreclr/nativeaot/Runtime/arm64/GcProbe.asm @@ -174,7 +174,7 @@ WaitForGC EPILOG_RETURN ThrowThreadAbort POP_PROBE_FRAME - EPILOG_NOP mov w0, #STATUS_REDHAWK_THREAD_ABORT + EPILOG_NOP mov w0, #STATUS_NATIVEAOT_THREAD_ABORT EPILOG_NOP mov x1, lr ;; return address as exception PC EPILOG_NOP b RhpThrowHwEx NESTED_END RhpWaitForGC diff --git a/src/coreclr/nativeaot/Runtime/disabledeventpipeinternal.cpp b/src/coreclr/nativeaot/Runtime/disabledeventpipeinternal.cpp index 6c48533b05c1ea..ecd0227c57e785 100644 --- a/src/coreclr/nativeaot/Runtime/disabledeventpipeinternal.cpp +++ b/src/coreclr/nativeaot/Runtime/disabledeventpipeinternal.cpp @@ -3,7 +3,7 @@ #include "CommonTypes.h" #include "CommonMacros.h" -#include "PalRedhawk.h" +#include "Pal.h" #include diff --git a/src/coreclr/nativeaot/Runtime/disabledruntimeeventinternal.cpp b/src/coreclr/nativeaot/Runtime/disabledruntimeeventinternal.cpp index f590021e6ff924..728e572e9ff1fc 100644 --- a/src/coreclr/nativeaot/Runtime/disabledruntimeeventinternal.cpp +++ b/src/coreclr/nativeaot/Runtime/disabledruntimeeventinternal.cpp @@ -3,7 +3,7 @@ #include "CommonTypes.h" #include "CommonMacros.h" -#include "PalRedhawk.h" +#include "Pal.h" #ifdef FEATURE_PERFTRACING diff --git a/src/coreclr/nativeaot/Runtime/event.cpp b/src/coreclr/nativeaot/Runtime/event.cpp index e53875d16318e1..1d97dd30780d1c 100644 --- a/src/coreclr/nativeaot/Runtime/event.cpp +++ b/src/coreclr/nativeaot/Runtime/event.cpp @@ -1,12 +1,13 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + #include "common.h" #include "CommonTypes.h" #include "CommonMacros.h" #include "daccess.h" #include "event.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "rhassert.h" #include "slist.h" #include "regdisplay.h" diff --git a/src/coreclr/nativeaot/Runtime/eventpipe/NativeaotEventPipeSupport.h b/src/coreclr/nativeaot/Runtime/eventpipe/NativeaotEventPipeSupport.h index 253f147e32d998..1248e68fa12b01 100644 --- a/src/coreclr/nativeaot/Runtime/eventpipe/NativeaotEventPipeSupport.h +++ b/src/coreclr/nativeaot/Runtime/eventpipe/NativeaotEventPipeSupport.h @@ -8,8 +8,8 @@ // definitions which are needed by these source files but are not available in NativeAOT // runtime source files. -// As mentioned PalRedhawk*.cpp, in general we don't want to assume that Windows and -// Redhawk global definitions can co-exist, meaning NativeAOT runtime source files +// As mentioned Pal*.cpp, in general we don't want to assume that Windows and +// NativeAOT global definitions can co-exist, meaning NativeAOT runtime source files // generally do not have access to windows.h; that said, the HOST_WIN32 parts of the shared // EventPipe code are designed to rely on windows.h, so windows.h must be included when // compiling shared EventPipe source files, and a marker is set to indicate that windows.h diff --git a/src/coreclr/nativeaot/Runtime/eventpipeinternal.cpp b/src/coreclr/nativeaot/Runtime/eventpipeinternal.cpp index 0fc3881c53476e..6716c7bbd18aa3 100644 --- a/src/coreclr/nativeaot/Runtime/eventpipeinternal.cpp +++ b/src/coreclr/nativeaot/Runtime/eventpipeinternal.cpp @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. #include "common.h" -#include "PalRedhawk.h" +#include "Pal.h" #include #include #include diff --git a/src/coreclr/nativeaot/Runtime/eventtrace.cpp b/src/coreclr/nativeaot/Runtime/eventtrace.cpp index b4ae115742694c..a9ed42ed400d0f 100644 --- a/src/coreclr/nativeaot/Runtime/eventtrace.cpp +++ b/src/coreclr/nativeaot/Runtime/eventtrace.cpp @@ -67,7 +67,7 @@ void ETW::GCLog::FireGcStart(ETW_GC_INFO* pGcInfo) (pGcInfo->GCStart.Depth == GCHeapUtilities::GetGCHeap()->GetMaxGeneration()) && (pGcInfo->GCStart.Reason == ETW_GC_INFO::GC_INDUCED)) { - // No InterlockedExchange64 on Redhawk (presumably b/c there is no compiler + // No InterlockedExchange64 on NativeAOT (presumably b/c there is no compiler // intrinsic for this on x86, even though there is one for InterlockedCompareExchange64) l64ClientSequenceNumberToLog = PalInterlockedCompareExchange64(&s_l64LastClientSequenceNumber, 0, s_l64LastClientSequenceNumber); } diff --git a/src/coreclr/nativeaot/Runtime/eventtrace_bulktype.cpp b/src/coreclr/nativeaot/Runtime/eventtrace_bulktype.cpp index a86c5657700589..70a3d7a7ad1d34 100644 --- a/src/coreclr/nativeaot/Runtime/eventtrace_bulktype.cpp +++ b/src/coreclr/nativeaot/Runtime/eventtrace_bulktype.cpp @@ -354,7 +354,7 @@ int BulkTypeEventLogger::LogSingleType(MethodTable * pEEType) // // Arguments: // * thAsAddr - MethodTable to log -// * typeLogBehavior - Ignored in Redhawk builds +// * typeLogBehavior - Ignored in NativeAOT builds // void BulkTypeEventLogger::LogTypeAndParameters(uint64_t thAsAddr) @@ -384,7 +384,7 @@ void BulkTypeEventLogger::LogTypeAndParameters(uint64_t thAsAddr) } else if (cTypeParams > 1) { - + ASSERT_UNCONDITIONALLY("unexpected value of cTypeParams greater than 1"); } } diff --git a/src/coreclr/nativeaot/Runtime/eventtrace_etw.h b/src/coreclr/nativeaot/Runtime/eventtrace_etw.h index d4994f68d928ea..e9862ec074e2cd 100644 --- a/src/coreclr/nativeaot/Runtime/eventtrace_etw.h +++ b/src/coreclr/nativeaot/Runtime/eventtrace_etw.h @@ -2,8 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // -// This header provides Redhawk-specific ETW code and macros, to allow sharing of common -// ETW code between Redhawk and desktop CLR. +// This header provides NativeAOT-specific ETW code and macros, to allow sharing of common +// ETW code. // #ifndef EVENTTRACE_ETW_H #define EVENTTRACE_ETW_H diff --git a/src/coreclr/nativeaot/Runtime/eventtrace_gcheap.cpp b/src/coreclr/nativeaot/Runtime/eventtrace_gcheap.cpp index d2cdf011ba2a99..11e46dae8111bc 100644 --- a/src/coreclr/nativeaot/Runtime/eventtrace_gcheap.cpp +++ b/src/coreclr/nativeaot/Runtime/eventtrace_gcheap.cpp @@ -37,14 +37,14 @@ BOOL ETW::GCLog::ShouldWalkHeapObjectsForEtw() { return RUNTIME_PROVIDER_CATEGORY_ENABLED( TRACE_LEVEL_INFORMATION, - CLR_GCHEAPDUMP_KEYWORD); + CLR_GCHEAPDUMP_KEYWORD); } BOOL ETW::GCLog::ShouldWalkHeapRootsForEtw() { return RUNTIME_PROVIDER_CATEGORY_ENABLED( TRACE_LEVEL_INFORMATION, - CLR_GCHEAPDUMP_KEYWORD); + CLR_GCHEAPDUMP_KEYWORD); } BOOL ETW::GCLog::ShouldTrackMovementForEtw() @@ -415,13 +415,7 @@ void ETW::GCLog::ForceGC(LONGLONG l64ClientSequenceNumber) if (!GCHeapUtilities::IsGCHeapInitialized()) return; - // No InterlockedExchange64 on Redhawk, even though there is one for - // InterlockedCompareExchange64. Technically, there's a race here by using - // InterlockedCompareExchange64, but it's not worth addressing. The race would be - // between two ETW controllers trying to trigger GCs simultaneously, in which case - // one will win and get its sequence number to appear in the GCStart event, while the - // other will lose. Rare, uninteresting, and low-impact. - PalInterlockedCompareExchange64(&s_l64LastClientSequenceNumber, l64ClientSequenceNumber, s_l64LastClientSequenceNumber); + InterlockedExchange64(&s_l64LastClientSequenceNumber, l64ClientSequenceNumber); ForceGCForDiagnostics(); } diff --git a/src/coreclr/nativeaot/Runtime/gcenv.h b/src/coreclr/nativeaot/Runtime/gcenv.h index da485d2ef0c532..ad9589fca4b030 100644 --- a/src/coreclr/nativeaot/Runtime/gcenv.h +++ b/src/coreclr/nativeaot/Runtime/gcenv.h @@ -35,8 +35,8 @@ #include "TargetPtrs.h" #include "MethodTable.h" #include "ObjectLayout.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "gcenv.interlocked.inl" #include "slist.h" diff --git a/src/coreclr/nativeaot/Runtime/holder.h b/src/coreclr/nativeaot/Runtime/holder.h index 22bd3dbfe3f5e0..ed7395d2cf58ac 100644 --- a/src/coreclr/nativeaot/Runtime/holder.h +++ b/src/coreclr/nativeaot/Runtime/holder.h @@ -3,7 +3,7 @@ // ----------------------------------------------------------------------------------------------------------- // Cut down versions of the Holder and Wrapper template classes used in the CLR. If this coding pattern is -// also common in the Redhawk code then it might be worth investigating pulling the whole holder.h header file +// also common in the NativeAOT code then it might be worth investigating pulling the whole holder.h header file // over (a quick look indicates it might not drag in too many extra dependencies). // diff --git a/src/coreclr/nativeaot/Runtime/i386/AsmMacros.inc b/src/coreclr/nativeaot/Runtime/i386/AsmMacros.inc index 2e9cd75420a7c9..698df51ea775a2 100644 --- a/src/coreclr/nativeaot/Runtime/i386/AsmMacros.inc +++ b/src/coreclr/nativeaot/Runtime/i386/AsmMacros.inc @@ -138,8 +138,8 @@ TrapThreadsFlags_None equ 0 TrapThreadsFlags_AbortInProgress equ 1 TrapThreadsFlags_TrapThreads equ 2 -;; This must match HwExceptionCode.STATUS_REDHAWK_THREAD_ABORT -STATUS_REDHAWK_THREAD_ABORT equ 43h +;; This must match HwExceptionCode.STATUS_NATIVEAOT_THREAD_ABORT +STATUS_NATIVEAOT_THREAD_ABORT equ 43h ;; ;; Rename fields of nested structs diff --git a/src/coreclr/nativeaot/Runtime/i386/ExceptionHandling.asm b/src/coreclr/nativeaot/Runtime/i386/ExceptionHandling.asm index 4e823bbbd6ad1c..facdc3abd304e1 100644 --- a/src/coreclr/nativeaot/Runtime/i386/ExceptionHandling.asm +++ b/src/coreclr/nativeaot/Runtime/i386/ExceptionHandling.asm @@ -357,7 +357,7 @@ FASTCALL_FUNC RhpCallCatchFunclet, 16 mov ebp, [ecx] ;; It was the ThreadAbortException, so rethrow it - mov ecx, STATUS_REDHAWK_THREAD_ABORT + mov ecx, STATUS_NATIVEAOT_THREAD_ABORT mov edx, [esp + esp_offsetof_ResumeIP] mov esp, eax ;; reset the SP to resume SP value jmp RhpThrowHwEx ;; Throw the ThreadAbortException as a special kind of hardware exception diff --git a/src/coreclr/nativeaot/Runtime/i386/GcProbe.asm b/src/coreclr/nativeaot/Runtime/i386/GcProbe.asm index 8500381fc4fc4b..42f62c27fe403a 100644 --- a/src/coreclr/nativeaot/Runtime/i386/GcProbe.asm +++ b/src/coreclr/nativeaot/Runtime/i386/GcProbe.asm @@ -172,7 +172,7 @@ RhpWaitForGC proc HijackFixupEpilog Abort: - mov ecx, STATUS_REDHAWK_THREAD_ABORT + mov ecx, STATUS_NATIVEAOT_THREAD_ABORT pop edx pop eax ;; ecx was pushed here, but we don't care for its value pop ebp diff --git a/src/coreclr/nativeaot/Runtime/inc/MethodTable.h b/src/coreclr/nativeaot/Runtime/inc/MethodTable.h index ffc32334dc0dde..1bd480dc052716 100644 --- a/src/coreclr/nativeaot/Runtime/inc/MethodTable.h +++ b/src/coreclr/nativeaot/Runtime/inc/MethodTable.h @@ -13,7 +13,7 @@ class TypeManager; struct TypeManagerHandle; //------------------------------------------------------------------------------------------------- -// The subset of TypeFlags that Redhawk knows about at runtime +// The subset of TypeFlags that NativeAOT knows about at runtime // This should match the TypeFlags enum in the managed type system. enum EETypeElementType : uint8_t { diff --git a/src/coreclr/nativeaot/Runtime/inc/stressLog.h b/src/coreclr/nativeaot/Runtime/inc/stressLog.h index 76cf347416f631..952789228023fb 100644 --- a/src/coreclr/nativeaot/Runtime/inc/stressLog.h +++ b/src/coreclr/nativeaot/Runtime/inc/stressLog.h @@ -289,7 +289,7 @@ class StressLog { UNREFERENCED_PARAMETER(level); return FALSE; #else - // In Redhawk we have rationalized facility codes and have much + // In NativeAOT, we have rationalized facility codes and have much // fewer compared to desktop, as such we'll log all facilities and // limit the filtering to the log level... return diff --git a/src/coreclr/nativeaot/Runtime/interoplibinterface_objc.cpp b/src/coreclr/nativeaot/Runtime/interoplibinterface_objc.cpp index e3f1ca24cee3fa..954e46cd3e18bd 100644 --- a/src/coreclr/nativeaot/Runtime/interoplibinterface_objc.cpp +++ b/src/coreclr/nativeaot/Runtime/interoplibinterface_objc.cpp @@ -5,8 +5,8 @@ #include "CommonTypes.h" #include "CommonMacros.h" #include "daccess.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "rhassert.h" #include "slist.h" #include "holder.h" diff --git a/src/coreclr/nativeaot/Runtime/loongarch64/ExceptionHandling.S b/src/coreclr/nativeaot/Runtime/loongarch64/ExceptionHandling.S index 004eea7fe1c802..a285ca1f208c51 100644 --- a/src/coreclr/nativeaot/Runtime/loongarch64/ExceptionHandling.S +++ b/src/coreclr/nativeaot/Runtime/loongarch64/ExceptionHandling.S @@ -524,7 +524,7 @@ LOCAL_LABEL(DonePopping): // It was the ThreadAbortException, so rethrow it // reset SP ori $a1, $a0, 0 // a1 <- continuation address as exception PC - addi.w $a0, $zero, STATUS_REDHAWK_THREAD_ABORT + addi.w $a0, $zero, STATUS_NATIVEAOT_THREAD_ABORT ori $sp, $a2, 0 b C_FUNC(RhpThrowHwEx) diff --git a/src/coreclr/nativeaot/Runtime/loongarch64/GcProbe.S b/src/coreclr/nativeaot/Runtime/loongarch64/GcProbe.S index a614bc7eabc71a..74e71fab8a3613 100644 --- a/src/coreclr/nativeaot/Runtime/loongarch64/GcProbe.S +++ b/src/coreclr/nativeaot/Runtime/loongarch64/GcProbe.S @@ -145,7 +145,7 @@ NESTED_ENTRY RhpWaitForGC, _TEXT, NoHandler .cfi_restore_state LOCAL_LABEL(ThrowThreadAbort): POP_PROBE_FRAME - addi.w $a0, $zero, STATUS_REDHAWK_THREAD_ABORT + addi.w $a0, $zero, STATUS_NATIVEAOT_THREAD_ABORT ori $a1, $ra, 0 // return address as exception PC b RhpThrowHwEx NESTED_END RhpWaitForGC diff --git a/src/coreclr/nativeaot/Runtime/portable.cpp b/src/coreclr/nativeaot/Runtime/portable.cpp index 29c9f07470eb66..2f30e42253d876 100644 --- a/src/coreclr/nativeaot/Runtime/portable.cpp +++ b/src/coreclr/nativeaot/Runtime/portable.cpp @@ -5,10 +5,10 @@ #include "CommonTypes.h" #include "CommonMacros.h" #include "daccess.h" -#include "PalRedhawkCommon.h" +#include "PalLimitedContext.h" #include "CommonMacros.inl" #include "volatile.h" -#include "PalRedhawk.h" +#include "Pal.h" #include "rhassert.h" #include "slist.h" diff --git a/src/coreclr/nativeaot/Runtime/profheapwalkhelper.cpp b/src/coreclr/nativeaot/Runtime/profheapwalkhelper.cpp index 6d9d7edc6fea46..d239ab93c3abb8 100644 --- a/src/coreclr/nativeaot/Runtime/profheapwalkhelper.cpp +++ b/src/coreclr/nativeaot/Runtime/profheapwalkhelper.cpp @@ -5,7 +5,7 @@ // On desktop CLR, GC ETW event firing borrows heavily from code in the profiling API, // as the GC already called hooks in the profapi to notify it of roots & references. // This file shims up that profapi code the GC expects, though only for the purpose of -// firing ETW events (not for getting a full profapi up on redhawk). +// firing ETW events (not for getting a full profapi up on NativeAOT). // #include "common.h" diff --git a/src/coreclr/nativeaot/Runtime/regdisplay.h b/src/coreclr/nativeaot/Runtime/regdisplay.h index 1e9856c98e795c..41eb41bf746975 100644 --- a/src/coreclr/nativeaot/Runtime/regdisplay.h +++ b/src/coreclr/nativeaot/Runtime/regdisplay.h @@ -6,7 +6,7 @@ #if defined(TARGET_X86) || defined(TARGET_AMD64) -#include "PalRedhawkCommon.h" // Fp128 +#include "PalLimitedContext.h" // Fp128 struct REGDISPLAY { diff --git a/src/coreclr/nativeaot/Runtime/rhassert.cpp b/src/coreclr/nativeaot/Runtime/rhassert.cpp index f66ec3f7d02a3b..91166a1e74a4b9 100644 --- a/src/coreclr/nativeaot/Runtime/rhassert.cpp +++ b/src/coreclr/nativeaot/Runtime/rhassert.cpp @@ -3,8 +3,8 @@ #include "common.h" #include "CommonTypes.h" #include "CommonMacros.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "rhassert.h" #include diff --git a/src/coreclr/nativeaot/Runtime/riscv64/ExceptionHandling.S b/src/coreclr/nativeaot/Runtime/riscv64/ExceptionHandling.S index 8258325967821a..09dc50e5ad62dd 100644 --- a/src/coreclr/nativeaot/Runtime/riscv64/ExceptionHandling.S +++ b/src/coreclr/nativeaot/Runtime/riscv64/ExceptionHandling.S @@ -560,7 +560,7 @@ LOCAL_LABEL(DonePopping): // It was the ThreadAbortException, so rethrow it // Reset SP mv a1, a0 // a1 <- continuation address as exception PC - li a0, STATUS_REDHAWK_THREAD_ABORT + li a0, STATUS_NATIVEAOT_THREAD_ABORT mv sp, a2 tail C_FUNC(RhpThrowHwEx) diff --git a/src/coreclr/nativeaot/Runtime/riscv64/GcProbe.S b/src/coreclr/nativeaot/Runtime/riscv64/GcProbe.S index 0d89b36e1aabdf..d7989f2f6694b2 100644 --- a/src/coreclr/nativeaot/Runtime/riscv64/GcProbe.S +++ b/src/coreclr/nativeaot/Runtime/riscv64/GcProbe.S @@ -134,7 +134,7 @@ NESTED_ENTRY RhpWaitForGC, _TEXT, NoHandler .cfi_restore_state LOCAL_LABEL(ThrowThreadAbort): POP_PROBE_FRAME - li a0, STATUS_REDHAWK_THREAD_ABORT + li a0, STATUS_NATIVEAOT_THREAD_ABORT mv a1, ra # Set return address as exception PC call C_FUNC(RhpThrowHwEx) NESTED_END RhpWaitForGC diff --git a/src/coreclr/nativeaot/Runtime/startup.cpp b/src/coreclr/nativeaot/Runtime/startup.cpp index 522d65a4027734..486e285cf37c65 100644 --- a/src/coreclr/nativeaot/Runtime/startup.cpp +++ b/src/coreclr/nativeaot/Runtime/startup.cpp @@ -4,8 +4,8 @@ #include "CommonTypes.h" #include "CommonMacros.h" #include "daccess.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "rhassert.h" #include "slist.h" #include "regdisplay.h" diff --git a/src/coreclr/nativeaot/Runtime/stressLog.cpp b/src/coreclr/nativeaot/Runtime/stressLog.cpp index 6c626eeef5a5dd..9253a9eb0e8709 100644 --- a/src/coreclr/nativeaot/Runtime/stressLog.cpp +++ b/src/coreclr/nativeaot/Runtime/stressLog.cpp @@ -13,8 +13,8 @@ #endif // DACCESS_COMPILE #include "CommonTypes.h" #include "CommonMacros.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "daccess.h" #include "stressLog.h" #include "holder.h" diff --git a/src/coreclr/nativeaot/Runtime/thread.cpp b/src/coreclr/nativeaot/Runtime/thread.cpp index 8fbf8a8e20fd78..2e27e230b2be62 100644 --- a/src/coreclr/nativeaot/Runtime/thread.cpp +++ b/src/coreclr/nativeaot/Runtime/thread.cpp @@ -8,8 +8,8 @@ #include "CommonTypes.h" #include "CommonMacros.h" #include "daccess.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "rhassert.h" #include "slist.h" #include "regdisplay.h" diff --git a/src/coreclr/nativeaot/Runtime/threadstore.cpp b/src/coreclr/nativeaot/Runtime/threadstore.cpp index cb98e309e29e82..2dc0c1a64d9738 100644 --- a/src/coreclr/nativeaot/Runtime/threadstore.cpp +++ b/src/coreclr/nativeaot/Runtime/threadstore.cpp @@ -6,8 +6,8 @@ #include "CommonTypes.h" #include "CommonMacros.h" #include "daccess.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "rhassert.h" #include "slist.h" #include "regdisplay.h" diff --git a/src/coreclr/nativeaot/Runtime/unix/HardwareExceptions.cpp b/src/coreclr/nativeaot/Runtime/unix/HardwareExceptions.cpp index 3d50a06d1ee05a..44a0b068a82811 100644 --- a/src/coreclr/nativeaot/Runtime/unix/HardwareExceptions.cpp +++ b/src/coreclr/nativeaot/Runtime/unix/HardwareExceptions.cpp @@ -2,7 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. #include "CommonTypes.h" -#include "PalRedhawkCommon.h" +#include "Pal.h" +#include "PalLimitedContext.h" #include "CommonMacros.h" #include "config.h" #include "daccess.h" diff --git a/src/coreclr/nativeaot/Runtime/unix/NativeContext.cpp b/src/coreclr/nativeaot/Runtime/unix/NativeContext.cpp index 0c1976e8ab3daf..d1a6b300054622 100644 --- a/src/coreclr/nativeaot/Runtime/unix/NativeContext.cpp +++ b/src/coreclr/nativeaot/Runtime/unix/NativeContext.cpp @@ -6,7 +6,7 @@ #include "CommonTypes.h" #include "CommonMacros.h" #include "daccess.h" -#include "PalRedhawkCommon.h" +#include "PalLimitedContext.h" #include "regdisplay.h" #include "config.h" diff --git a/src/coreclr/nativeaot/Runtime/unix/PalRedhawkInline.h b/src/coreclr/nativeaot/Runtime/unix/PalInline.h similarity index 99% rename from src/coreclr/nativeaot/Runtime/unix/PalRedhawkInline.h rename to src/coreclr/nativeaot/Runtime/unix/PalInline.h index 2bea01616f019b..7d64c1e1cd568d 100644 --- a/src/coreclr/nativeaot/Runtime/unix/PalRedhawkInline.h +++ b/src/coreclr/nativeaot/Runtime/unix/PalInline.h @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// Implementation of Redhawk PAL inline functions +// Implementation of NativeAOT PAL inline functions #include diff --git a/src/coreclr/nativeaot/Runtime/unix/PalRedhawkUnix.cpp b/src/coreclr/nativeaot/Runtime/unix/PalUnix.cpp similarity index 99% rename from src/coreclr/nativeaot/Runtime/unix/PalRedhawkUnix.cpp rename to src/coreclr/nativeaot/Runtime/unix/PalUnix.cpp index b27d0550fe641f..ef025469fb9170 100644 --- a/src/coreclr/nativeaot/Runtime/unix/PalRedhawkUnix.cpp +++ b/src/coreclr/nativeaot/Runtime/unix/PalUnix.cpp @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // -// Implementation of the Redhawk Platform Abstraction Layer (PAL) library when Unix is the platform. +// Implementation of the NativeAOT Platform Abstraction Layer (PAL) library when Unix is the platform. // #include @@ -408,7 +408,7 @@ static pthread_key_t key; bool InitializeSignalHandling(); #endif -// The Redhawk PAL must be initialized before any of its exports can be called. Returns true for a successful +// The NativeAOT PAL must be initialized before any of its exports can be called. Returns true for a successful // initialization and false on failure. bool PalInit() { @@ -1040,7 +1040,7 @@ HANDLE PalCreateLowMemoryResourceNotification() #if !__has_builtin(_mm_pause) extern "C" void _mm_pause() -// Defined for implementing PalYieldProcessor in PalRedhawk.h +// Defined for implementing PalYieldProcessor in Pal.h { #if defined(HOST_AMD64) || defined(HOST_X86) __asm__ volatile ("pause"); diff --git a/src/coreclr/nativeaot/Runtime/unix/UnixNativeCodeManager.cpp b/src/coreclr/nativeaot/Runtime/unix/UnixNativeCodeManager.cpp index 9ac748ecddd5ea..0321e2101817c8 100644 --- a/src/coreclr/nativeaot/Runtime/unix/UnixNativeCodeManager.cpp +++ b/src/coreclr/nativeaot/Runtime/unix/UnixNativeCodeManager.cpp @@ -5,7 +5,7 @@ #include "CommonTypes.h" #include "CommonMacros.h" #include "daccess.h" -#include "PalRedhawkCommon.h" +#include "PalLimitedContext.h" #include "regdisplay.h" #include "ICodeManager.h" #include "UnixNativeCodeManager.h" @@ -417,7 +417,7 @@ bool UnixNativeCodeManager::IsUnwindable(PTR_VOID pvAddress) // ADD{S}.W FP, SP, # // 1111 0x01 000x 1101 0xxx 1011 xxxx xxxx -#define ADD_W_FP_SP_BITS 0xF10D0B00 +#define ADD_W_FP_SP_BITS 0xF10D0B00 #define ADD_W_FP_SP_MASK 0xFBEF8F00 // PUSH @@ -676,7 +676,7 @@ int UnixNativeCodeManager::TrailingEpilogueInstructionsCount(MethodInfo * pMetho // For details see similar code in OOPStackUnwinderAMD64::UnwindEpilogue // // - // + // // A canonical epilogue sequence consists of the following operations: // // 1. Optional cleanup of fixed and dynamic stack allocations, which is @@ -880,7 +880,7 @@ int UnixNativeCodeManager::TrailingEpilogueInstructionsCount(MethodInfo * pMetho // Since we stop on branches, the search is roughly limited by the containing basic block. // We typically examine just 1-5 instructions and in rare cases up to 30. - // + // // TODO: we can also limit the search by the longest possible epilogue length, but // we must be sure the longest length considers all possibilities, // which is somewhat nontrivial to derive/prove. @@ -888,7 +888,7 @@ int UnixNativeCodeManager::TrailingEpilogueInstructionsCount(MethodInfo * pMetho for (uint32_t* pInstr = (uint32_t*)pvAddress - 1; pInstr > start; pInstr--) { uint32_t instr = *pInstr; - + // check for Branches, Exception Generating and System instruction group. // If we see such instruction before seeing FP or LR restored, we are not in an epilog. // Note: this includes RET, BRK, branches, calls, tailcalls, fences, etc... diff --git a/src/coreclr/nativeaot/Runtime/unix/UnixSignals.cpp b/src/coreclr/nativeaot/Runtime/unix/UnixSignals.cpp index 33852920653ff6..518b4bbf82f36a 100644 --- a/src/coreclr/nativeaot/Runtime/unix/UnixSignals.cpp +++ b/src/coreclr/nativeaot/Runtime/unix/UnixSignals.cpp @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. #include "CommonTypes.h" -#include "PalRedhawkCommon.h" +#include "PalLimitedContext.h" #include "CommonMacros.h" #include "config.h" diff --git a/src/coreclr/nativeaot/Runtime/unix/unixasmmacros.inc b/src/coreclr/nativeaot/Runtime/unix/unixasmmacros.inc index 3f0fe522361d61..7e9c70354e43cb 100644 --- a/src/coreclr/nativeaot/Runtime/unix/unixasmmacros.inc +++ b/src/coreclr/nativeaot/Runtime/unix/unixasmmacros.inc @@ -3,8 +3,8 @@ #define INVALIDGCVALUE 0xCCCCCCCD -// This must match HwExceptionCode.STATUS_REDHAWK_THREAD_ABORT -#define STATUS_REDHAWK_THREAD_ABORT 0x43 +// This must match HwExceptionCode.STATUS_NATIVEAOT_THREAD_ABORT +#define STATUS_NATIVEAOT_THREAD_ABORT 0x43 // Enforce subsections via symbols to workaround bugs in Xcode 15 linker. #if defined(__APPLE__) diff --git a/src/coreclr/nativeaot/Runtime/windows/CoffNativeCodeManager.cpp b/src/coreclr/nativeaot/Runtime/windows/CoffNativeCodeManager.cpp index 531e6db8904fab..f709bc4650360d 100644 --- a/src/coreclr/nativeaot/Runtime/windows/CoffNativeCodeManager.cpp +++ b/src/coreclr/nativeaot/Runtime/windows/CoffNativeCodeManager.cpp @@ -1,5 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + #include "common.h" #include @@ -7,7 +8,7 @@ #include "CommonTypes.h" #include "CommonMacros.h" #include "daccess.h" -#include "PalRedhawkCommon.h" +#include "PalLimitedContext.h" #include "regdisplay.h" #include "ICodeManager.h" #include "CoffNativeCodeManager.h" diff --git a/src/coreclr/nativeaot/Runtime/windows/PalRedhawkCommon.cpp b/src/coreclr/nativeaot/Runtime/windows/PalCommon.cpp similarity index 89% rename from src/coreclr/nativeaot/Runtime/windows/PalRedhawkCommon.cpp rename to src/coreclr/nativeaot/Runtime/windows/PalCommon.cpp index 3d94dfabc1b805..c10587751eb10b 100644 --- a/src/coreclr/nativeaot/Runtime/windows/PalRedhawkCommon.cpp +++ b/src/coreclr/nativeaot/Runtime/windows/PalCommon.cpp @@ -2,13 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. // -// Implementation of the portions of the Redhawk Platform Abstraction Layer (PAL) library that are common among +// Implementation of the portions of the Platform Abstraction Layer (PAL) library that are common among // multiple PAL variants. // -// Note that in general we don't want to assume that Windows and Redhawk global definitions can co-exist. -// Since this code must include Windows headers to do its job we can't therefore safely include general -// Redhawk header files. -// #include #include @@ -16,8 +12,8 @@ #include #include "CommonTypes.h" #include "daccess.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include #include "CommonMacros.h" #include "rhassert.h" diff --git a/src/coreclr/nativeaot/Runtime/windows/PalRedhawkInline.h b/src/coreclr/nativeaot/Runtime/windows/PalInline.h similarity index 99% rename from src/coreclr/nativeaot/Runtime/windows/PalRedhawkInline.h rename to src/coreclr/nativeaot/Runtime/windows/PalInline.h index 595c7f663b9d13..d03d9399d01573 100644 --- a/src/coreclr/nativeaot/Runtime/windows/PalRedhawkInline.h +++ b/src/coreclr/nativeaot/Runtime/windows/PalInline.h @@ -5,7 +5,7 @@ #include #endif -// Implementation of Redhawk PAL inline functions +// Implementation of NativeAOT PAL inline functions EXTERN_C long __cdecl _InterlockedIncrement(long volatile *); #pragma intrinsic(_InterlockedIncrement) diff --git a/src/coreclr/nativeaot/Runtime/windows/PalRedhawkMinWin.cpp b/src/coreclr/nativeaot/Runtime/windows/PalMinWin.cpp similarity index 98% rename from src/coreclr/nativeaot/Runtime/windows/PalRedhawkMinWin.cpp rename to src/coreclr/nativeaot/Runtime/windows/PalMinWin.cpp index 9d70930b7caa02..2927e358535359 100644 --- a/src/coreclr/nativeaot/Runtime/windows/PalRedhawkMinWin.cpp +++ b/src/coreclr/nativeaot/Runtime/windows/PalMinWin.cpp @@ -1,16 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// -// Implementation of the Redhawk Platform Abstraction Layer (PAL) library when MinWin is the platform. In this -// case most or all of the import requirements which Redhawk has can be satisfied via a forwarding export to -// some native MinWin library. Therefore most of the work is done in the .def file and there is very little -// code here. -// -// Note that in general we don't want to assume that Windows and Redhawk global definitions can co-exist. -// Since this code must include Windows headers to do its job we can't therefore safely include general -// Redhawk header files. -// #include "common.h" #include #include @@ -184,7 +174,7 @@ void InitializeCurrentProcessCpuCount() g_RhNumberOfProcessors = count; } -// The Redhawk PAL must be initialized before any of its exports can be called. Returns true for a successful +// The NativeAOT PAL must be initialized before any of its exports can be called. Returns true for a successful // initialization and false on failure. bool PalInit() { diff --git a/src/coreclr/nativeaot/Runtime/yieldprocessornormalized.cpp b/src/coreclr/nativeaot/Runtime/yieldprocessornormalized.cpp index ae62fba4cb96d5..06d068f7d26820 100644 --- a/src/coreclr/nativeaot/Runtime/yieldprocessornormalized.cpp +++ b/src/coreclr/nativeaot/Runtime/yieldprocessornormalized.cpp @@ -8,8 +8,8 @@ #include "CommonMacros.h" #include "daccess.h" #include "DebugMacrosExt.h" -#include "PalRedhawkCommon.h" -#include "PalRedhawk.h" +#include "PalLimitedContext.h" +#include "Pal.h" #include "rhassert.h" #include "slist.h" #include "volatile.h" diff --git a/src/coreclr/nativeaot/Runtime/yieldprocessornormalized.h b/src/coreclr/nativeaot/Runtime/yieldprocessornormalized.h index 5539ebf90561bc..8a600e2b8498bb 100644 --- a/src/coreclr/nativeaot/Runtime/yieldprocessornormalized.h +++ b/src/coreclr/nativeaot/Runtime/yieldprocessornormalized.h @@ -1,5 +1,5 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#include "PalRedhawk.h" +#include "Pal.h" #include "../../inc/yieldprocessornormalized.h" diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Core/Execution/ExecutionEnvironment.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Core/Execution/ExecutionEnvironment.cs index 1045f76bf927b9..ad13f8561375f3 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Core/Execution/ExecutionEnvironment.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Core/Execution/ExecutionEnvironment.cs @@ -19,7 +19,7 @@ namespace Internal.Reflection.Core.Execution { // - // This class abstracts the underlying Redhawk (or whatever execution engine) runtime and exposes the services + // This class abstracts the underlying NativeAOT runtime (or whatever execution engine) runtime and exposes the services // that I.R.Core.Execution needs. // [CLSCompliant(false)] diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Core/Execution/FieldAccessor.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Core/Execution/FieldAccessor.cs index 3a931657e2d482..7b2a5eb5b7040a 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Core/Execution/FieldAccessor.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Core/Execution/FieldAccessor.cs @@ -10,7 +10,7 @@ namespace Internal.Reflection.Core.Execution { // - // This class abstracts the underlying Redhawk (or whatever execution engine) runtime that sets and gets fields. + // This class abstracts the underlying NativeAOT runtime (or whatever execution engine) runtime that sets and gets fields. // [CLSCompliant(false)] public abstract class FieldAccessor diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs index abf213ccfb4719..7adbb86c7fcd2d 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs @@ -15,7 +15,7 @@ namespace System.Runtime { // CONTRACT with Runtime - // This class lists all the static methods that the redhawk runtime exports to a class library + // This class lists all the static methods that the NativeAOT runtime exports to a class library // These are not expected to change much but are needed by the class library to implement its functionality // // The contents of this file can be modified if needed by the class library diff --git a/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ReflectionExecution.cs b/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ReflectionExecution.cs index 736c09a8a095fd..24d6d68772b886 100644 --- a/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ReflectionExecution.cs +++ b/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ReflectionExecution.cs @@ -10,7 +10,7 @@ // // Internal.Reflection.Core.Execution has an abstract model // for an "execution engine" - this contract provides the -// concrete implementation of this model for Redhawk. +// concrete implementation of this model for NativeAOT. // // // Implemented by: @@ -18,7 +18,7 @@ // N/A on desktop: // // Consumed by: -// Redhawk app's directly via an under-the-hood ILTransform. +// NativeAOT app's directly via an under-the-hood ILTransform. // System.Private.CoreLib.dll, via a callback (see Internal.System.Runtime.Augment) // diff --git a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderTypeSystemContext.cs b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderTypeSystemContext.cs index fb45055e11db5a..00736f8178e9b9 100644 --- a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderTypeSystemContext.cs +++ b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderTypeSystemContext.cs @@ -10,7 +10,7 @@ namespace Internal.Runtime.TypeLoader { /// /// TypeSystemContext that can interfact with the - /// Redhawk runtime type system and native metadata + /// NativeAOT runtime type system and native metadata /// public partial class TypeLoaderTypeSystemContext : TypeSystemContext { diff --git a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/TypeSystem/RuntimeMethodDesc.cs b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/TypeSystem/RuntimeMethodDesc.cs index 9df61f9ad7f1bc..e07a286b1bb23a 100644 --- a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/TypeSystem/RuntimeMethodDesc.cs +++ b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/TypeSystem/RuntimeMethodDesc.cs @@ -10,7 +10,7 @@ namespace Internal.TypeSystem.NoMetadata { /// - /// Represents a method within the Redhawk runtime + /// Represents a method within the NativeAOT runtime /// internal sealed partial class RuntimeMethodDesc : NoMetadataMethodDesc { diff --git a/src/coreclr/nativeaot/Test.CoreLib/src/System/Runtime/RuntimeImports.cs b/src/coreclr/nativeaot/Test.CoreLib/src/System/Runtime/RuntimeImports.cs index 85d2096b89a409..026f0b8d109cc6 100644 --- a/src/coreclr/nativeaot/Test.CoreLib/src/System/Runtime/RuntimeImports.cs +++ b/src/coreclr/nativeaot/Test.CoreLib/src/System/Runtime/RuntimeImports.cs @@ -10,7 +10,7 @@ namespace System.Runtime { // CONTRACT with Runtime - // This class lists all the static methods that the redhawk runtime exports to a class library + // This class lists all the static methods that the NativeAOT runtime exports to a class library // These are not expected to change much but are needed by the class library to implement its functionality // // The contents of this file can be modified if needed by the class library diff --git a/src/coreclr/runtime/i386/WriteBarriers.S b/src/coreclr/runtime/i386/WriteBarriers.S index f26590a88ab462..e9bad9c715db2a 100644 --- a/src/coreclr/runtime/i386/WriteBarriers.S +++ b/src/coreclr/runtime/i386/WriteBarriers.S @@ -207,7 +207,6 @@ LEAF_END RhpCheckedAssignRef\REFREG, _TEXT DEFINE_CHECKED_WRITE_BARRIER ECX, EDX, EAX DEFINE_WRITE_BARRIER ECX, EDX, EAX -// Need some more write barriers to run CLR compiled MDIL on Redhawk - commented out for now DEFINE_WRITE_BARRIER EDX, EAX, ECX DEFINE_WRITE_BARRIER EDX, ECX, EAX DEFINE_WRITE_BARRIER EDX, EBX, EAX diff --git a/src/coreclr/runtime/i386/WriteBarriers.asm b/src/coreclr/runtime/i386/WriteBarriers.asm index a0ea69e425212b..6437762161626f 100644 --- a/src/coreclr/runtime/i386/WriteBarriers.asm +++ b/src/coreclr/runtime/i386/WriteBarriers.asm @@ -224,7 +224,6 @@ endm DEFINE_CHECKED_WRITE_BARRIER ECX, EDX DEFINE_WRITE_BARRIER ECX, EDX -;; Need some more write barriers to run CLR compiled MDIL on Redhawk - commented out for now DEFINE_WRITE_BARRIER EDX, EAX DEFINE_WRITE_BARRIER EDX, ECX DEFINE_WRITE_BARRIER EDX, EBX diff --git a/src/coreclr/scripts/genEventing.py b/src/coreclr/scripts/genEventing.py index d97a3a080bca1b..ffa616469fd912 100644 --- a/src/coreclr/scripts/genEventing.py +++ b/src/coreclr/scripts/genEventing.py @@ -889,7 +889,7 @@ def updateclreventsfile(write_xplatheader, target_cpp, runtimeFlavor, is_host_wi Clrallevents.write('#define CLR_ETW_ALL_MAIN_H\n\n') elif generatedFileType == "source-impl": Clrallevents.write('#include \n') - Clrallevents.write('#include \n') + Clrallevents.write('#include \n') Clrallevents.write('#include "clretwallmain.h"\n') Clrallevents.write('#include "clreventpipewriteevents.h"\n') if user_events and runtimeFlavor.coreclr: @@ -901,7 +901,7 @@ def updateclreventsfile(write_xplatheader, target_cpp, runtimeFlavor, is_host_wi elif generatedFileType == "source-impl-noop": Clrallevents.write('#include \n') Clrallevents.write('#include \n\n') - Clrallevents.write('#include \n\n') + Clrallevents.write('#include \n\n') Clrallevents.write('#ifndef ERROR_SUCCESS\n') Clrallevents.write('#define ERROR_SUCCESS 0L\n') Clrallevents.write('#endif\n\n') diff --git a/src/coreclr/vm/excep.cpp b/src/coreclr/vm/excep.cpp index 640042104428a4..6cddfde642076e 100644 --- a/src/coreclr/vm/excep.cpp +++ b/src/coreclr/vm/excep.cpp @@ -6192,7 +6192,7 @@ void HandleManagedFault(EXCEPTION_RECORD* pExceptionRecord, CONTEXT* pContext) { if (pExceptionRecord->ExceptionInformation[1] < NULL_AREA_SIZE) { - exceptionCode = 0; //STATUS_REDHAWK_NULL_REFERENCE; + exceptionCode = 0; //STATUS_NATIVEAOT_NULL_REFERENCE; } } @@ -11433,7 +11433,7 @@ void SoftwareExceptionFrame::UpdateContextFromTransitionBlock(TransitionBlock *p m_Context.SegCs = 0; m_Context.SegSs = 0; m_Context.EFlags = 0; - m_Context.Eax = 0; + m_Context.Eax = 0; m_Context.Ecx = pTransitionBlock->m_argumentRegisters.ECX; m_Context.Edx = pTransitionBlock->m_argumentRegisters.EDX; #ifdef FEATURE_EH_FUNCLETS diff --git a/src/coreclr/vm/exceptionhandling.cpp b/src/coreclr/vm/exceptionhandling.cpp index 2d1c8a21f79e0b..73043f2e6f1f99 100644 --- a/src/coreclr/vm/exceptionhandling.cpp +++ b/src/coreclr/vm/exceptionhandling.cpp @@ -1,8 +1,5 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// - -// #include "common.h" @@ -1506,7 +1503,7 @@ BOOL HandleHardwareException(PAL_SEHException* ex) { if (ex->GetExceptionRecord()->ExceptionInformation[1] < NULL_AREA_SIZE) { - exceptionCode = 0; //STATUS_REDHAWK_NULL_REFERENCE; + exceptionCode = 0; //STATUS_NATIVEAOT_NULL_REFERENCE; } }