From 82ddf76a3ead434ec281702ab359f09a18b609eb Mon Sep 17 00:00:00 2001 From: Steve MacLean Date: Wed, 26 Jul 2017 12:18:25 -0400 Subject: [PATCH] [Arm64] Enable CPUGroupInfo (#12766) --- src/utilcode/util.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/utilcode/util.cpp b/src/utilcode/util.cpp index 8e9979e..8b2ee6f 100644 --- a/src/utilcode/util.cpp +++ b/src/utilcode/util.cpp @@ -870,7 +870,7 @@ BYTE * ClrVirtualAllocWithinRange(const BYTE *pMinAddr, } CONTRACTL_END; -#if !defined(FEATURE_REDHAWK) && defined(_TARGET_AMD64_) +#if !defined(FEATURE_REDHAWK) && (defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)) #ifndef FEATURE_PAL HMODULE hMod = GetModuleHandleW(WINDOWS_KERNEL32_DLLNAME_W); #else @@ -907,7 +907,7 @@ BYTE * ClrVirtualAllocWithinRange(const BYTE *pMinAddr, #endif } -#if !defined(FEATURE_REDHAWK) && defined(_TARGET_AMD64_) +#if !defined(FEATURE_REDHAWK) && (defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)) // Calculate greatest common divisor DWORD GCD(DWORD u, DWORD v) { @@ -938,7 +938,7 @@ DWORD LCM(DWORD u, DWORD v) } CONTRACTL_END; -#if !defined(FEATURE_REDHAWK) && defined(_TARGET_AMD64_) +#if !defined(FEATURE_REDHAWK) && (defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)) BYTE *bBuffer = NULL; SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *pSLPIEx = NULL; SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *pRecord = NULL; @@ -1013,7 +1013,7 @@ DWORD LCM(DWORD u, DWORD v) { LIMITED_METHOD_CONTRACT; -#if !defined(FEATURE_REDHAWK) && defined(_TARGET_AMD64_) +#if !defined(FEATURE_REDHAWK) && (defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)) WORD begin = 0; WORD nr_proc = 0; @@ -1040,7 +1040,7 @@ DWORD LCM(DWORD u, DWORD v) } CONTRACTL_END; -#if !defined(FEATURE_REDHAWK) && defined(_TARGET_AMD64_) +#if !defined(FEATURE_REDHAWK) && (defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)) BOOL enableGCCPUGroups = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_GCCpuGroup) != 0; BOOL threadUseAllCpuGroups = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_Thread_UseAllCpuGroups) != 0; @@ -1065,7 +1065,7 @@ DWORD LCM(DWORD u, DWORD v) BOOL hasMultipleGroups = m_nGroups > 1; m_enableGCCPUGroups = enableGCCPUGroups && hasMultipleGroups; m_threadUseAllCpuGroups = threadUseAllCpuGroups && hasMultipleGroups; -#endif // _TARGET_AMD64_ +#endif // _TARGET_AMD64_ || _TARGET_ARM64_ } /*static*/ BOOL CPUGroupInfo::IsInitialized() @@ -1123,7 +1123,7 @@ retry: { LIMITED_METHOD_CONTRACT; -#if !defined(FEATURE_REDHAWK) && defined(_TARGET_AMD64_) +#if !defined(FEATURE_REDHAWK) && (defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)) WORD bTemp = 0; WORD bDiff = processor_number - bTemp; @@ -1154,7 +1154,7 @@ retry: } CONTRACTL_END; -#if !defined(FEATURE_REDHAWK) && defined(_TARGET_AMD64_) +#if !defined(FEATURE_REDHAWK) && (defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)) // m_enableGCCPUGroups and m_threadUseAllCpuGroups must be TRUE _ASSERTE(m_enableGCCPUGroups && m_threadUseAllCpuGroups); @@ -1186,7 +1186,7 @@ retry: } CONTRACTL_END; -#if defined(_TARGET_AMD64_) +#if (defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)) WORD i, minGroup = 0; DWORD minWeight = 0; @@ -1229,7 +1229,7 @@ found: /*static*/ void CPUGroupInfo::ClearCPUGroupAffinity(GROUP_AFFINITY *gf) { LIMITED_METHOD_CONTRACT; -#if defined(_TARGET_AMD64_) +#if (defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)) // m_enableGCCPUGroups and m_threadUseAllCpuGroups must be TRUE _ASSERTE(m_enableGCCPUGroups && m_threadUseAllCpuGroups); -- 2.7.4