diff options
author | dotnet-bot <dotnet-bot@microsoft.com> | 2017-09-26 03:31:09 +0300 |
---|---|---|
committer | dotnet-bot <dotnet-bot@microsoft.com> | 2017-09-26 06:14:34 +0300 |
commit | 94f2d8ea3943f7e90cda86ae7b7cb47d3da5a53a (patch) | |
tree | 941c381b0df93a9a335bf7d40c31c3ab94bd95f0 /src/Native/Runtime/windows | |
parent | 351d113aaa275354213aeb31bdc0709b56774508 (diff) |
[tfs-changeset: 1676255]
Diffstat (limited to 'src/Native/Runtime/windows')
-rw-r--r-- | src/Native/Runtime/windows/AsmOffsets.cpp | 2 | ||||
-rw-r--r-- | src/Native/Runtime/windows/PalRedhawkInline.h | 2 | ||||
-rw-r--r-- | src/Native/Runtime/windows/PalRedhawkMinWin.cpp | 24 |
3 files changed, 20 insertions, 8 deletions
diff --git a/src/Native/Runtime/windows/AsmOffsets.cpp b/src/Native/Runtime/windows/AsmOffsets.cpp index a76400235..28415f764 100644 --- a/src/Native/Runtime/windows/AsmOffsets.cpp +++ b/src/Native/Runtime/windows/AsmOffsets.cpp @@ -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. // See the LICENSE file in the project root for more information. -#ifdef _ARM_ +#if defined(_ARM_) || defined(_ARM64_) #define HASH_DEFINE #define #define PLAT_ASM_OFFSET(offset, cls, member) HASH_DEFINE OFFSETOF__##cls##__##member 0x##offset diff --git a/src/Native/Runtime/windows/PalRedhawkInline.h b/src/Native/Runtime/windows/PalRedhawkInline.h index 4f3e75e63..9341544fc 100644 --- a/src/Native/Runtime/windows/PalRedhawkInline.h +++ b/src/Native/Runtime/windows/PalRedhawkInline.h @@ -53,7 +53,7 @@ FORCEINLINE Int64 PalInterlockedCompareExchange64(_Inout_ _Interlocked_operand_ return _InterlockedCompareExchange64(pDst, iValue, iComparand); } -#if defined(_AMD64_) +#if defined(_AMD64_) || defined(_ARM64_) EXTERN_C UInt8 _InterlockedCompareExchange128(Int64 volatile *, Int64, Int64, Int64 *); #pragma intrinsic(_InterlockedCompareExchange128) FORCEINLINE UInt8 PalInterlockedCompareExchange128(_Inout_ _Interlocked_operand_ Int64 volatile *pDst, Int64 iValueHigh, Int64 iValueLow, Int64 *pComparandAndResult) diff --git a/src/Native/Runtime/windows/PalRedhawkMinWin.cpp b/src/Native/Runtime/windows/PalRedhawkMinWin.cpp index 99d5a0315..b57f59a90 100644 --- a/src/Native/Runtime/windows/PalRedhawkMinWin.cpp +++ b/src/Native/Runtime/windows/PalRedhawkMinWin.cpp @@ -330,6 +330,14 @@ REDHAWK_PALEXPORT _Success_(return) bool REDHAWK_PALAPI PalGetThreadContext(HAND pCtx->R11 = win32ctx.R11; pCtx->SP = win32ctx.Sp; pCtx->LR = win32ctx.Lr; +#elif defined(_ARM64_) + for (int i = 0; i < GEN_REG_COUNT; ++i) { + pCtx->X[i] = win32ctx.X[i]; + } + pCtx->SP = win32ctx.Sp; + pCtx->LR = win32ctx.Lr; + pCtx->FP = win32ctx.Fp; + pCtx->IP = win32ctx.Pc; #else #error Unsupported platform #endif @@ -1063,7 +1071,8 @@ UInt32 CountBits(size_t bfBitfield) // 'answers' between the current implementation and the CLR implementation. // //#define TRACE_CACHE_TOPOLOGY -#ifdef _DEBUG +#if defined(_DEBUG) && !defined(_ARM64_) +// ARM64TODO: restore void DumpCacheTopology(_In_reads_(cRecords) SYSTEM_LOGICAL_PROCESSOR_INFORMATION * pProcInfos, UInt32 cRecords) { printf("----------------\n"); @@ -1115,7 +1124,7 @@ void DumpCacheTopologyResults(UInt32 maxCpuId, CpuVendor cpuVendor, _In_reads_(c printf(" g_cbLargestOnDieCache: 0x%08zx 0x%08zx :CLR_LargestOnDieCache(TRUE)\n", g_cbLargestOnDieCache, CLR_GetLargestOnDieCacheSize(TRUE, pProcInfos, cRecords)); printf("g_cbLargestOnDieCacheAdjusted: 0x%08zx 0x%08zx :CLR_LargestOnDieCache(FALSE)\n", g_cbLargestOnDieCacheAdjusted, CLR_GetLargestOnDieCacheSize(FALSE, pProcInfos, cRecords)); } -#endif // _DEBUG +#endif // defined(_DEBUG) && !defined(_ARM64_) // Method used to initialize the above values. bool PalQueryProcessorTopology() @@ -1288,18 +1297,21 @@ bool PalQueryProcessorTopology() g_cbLargestOnDieCache = cbCache; g_cbLargestOnDieCacheAdjusted = cbCacheAdjusted; -#ifdef _DEBUG -#ifdef TRACE_CACHE_TOPOLOGY +#if defined(_DEBUG) +#if defined(TRACE_CACHE_TOPOLOGY) && !defined(_ARM64_) +// ARM64TODO: restore DumpCacheTopologyResults(maxCpuId, cpuVendor, pProcInfos, cRecords); -#endif // TRACE_CACHE_TOPOLOGY +#endif // defined(TRACE_CACHE_TOPOLOGY) && !defined(_ARM64_) if ((CLR_GetLargestOnDieCacheSize(TRUE, pProcInfos, cRecords) != g_cbLargestOnDieCache) || (CLR_GetLargestOnDieCacheSize(FALSE, pProcInfos, cRecords) != g_cbLargestOnDieCacheAdjusted) || (CLR_GetLogicalCpuCount(pProcInfos, cRecords) != g_cLogicalCpus)) { +#if !defined(_ARM64_) DumpCacheTopologyResults(maxCpuId, cpuVendor, pProcInfos, cRecords); +#endif assert(!"QueryProcessorTopology doesn't match CLR's results. See stdout for more info."); } -#endif // TRACE_CACHE_TOPOLOGY +#endif } if (pProcInfos) |