diff options
author | Steve MacLean <sdmaclea.qdt@qualcommdatacenter.com> | 2017-06-12 17:14:12 -0400 |
---|---|---|
committer | Maoni Stephens <Maoni0@users.noreply.github.com> | 2017-06-12 14:14:12 -0700 |
commit | 0ee3b5e64a98dc71aefed2304fe4bcf7f66ca9f5 (patch) | |
tree | 8f099e2391d8990de1c7d0f4ca4c3fcae6839e4d /src/inc | |
parent | c655981474be1d3aa0165408e5c3914c5cfc35a1 (diff) | |
download | coreclr-0ee3b5e64a98dc71aefed2304fe4bcf7f66ca9f5.tar.gz coreclr-0ee3b5e64a98dc71aefed2304fe4bcf7f66ca9f5.tar.bz2 coreclr-0ee3b5e64a98dc71aefed2304fe4bcf7f66ca9f5.zip |
[Arm64/Unix] Add 64K page support (#10981)
* [Arm64/Unix] Support 64K pages
* GC move GCToOSInterface::Initialize() into InitializeGarbageCollector()
Diffstat (limited to 'src/inc')
-rw-r--r-- | src/inc/pedecoder.inl | 8 | ||||
-rw-r--r-- | src/inc/switches.h | 6 | ||||
-rw-r--r-- | src/inc/utilcode.h | 3 |
3 files changed, 7 insertions, 10 deletions
diff --git a/src/inc/pedecoder.inl b/src/inc/pedecoder.inl index b75c4959f9..7f3c79ba59 100644 --- a/src/inc/pedecoder.inl +++ b/src/inc/pedecoder.inl @@ -103,7 +103,7 @@ inline PEDecoder::PEDecoder(PTR_VOID mappedBase, bool fixedUp /*= FALSE*/) { CONSTRUCTOR_CHECK; PRECONDITION(CheckPointer(mappedBase)); - PRECONDITION(CheckAligned(mappedBase, OS_PAGE_SIZE)); + PRECONDITION(CheckAligned(mappedBase, GetOsPageSize())); PRECONDITION(PEDecoder(mappedBase,fixedUp).CheckNTHeaders()); THROWS; GC_NOTRIGGER; @@ -113,7 +113,7 @@ inline PEDecoder::PEDecoder(PTR_VOID mappedBase, bool fixedUp /*= FALSE*/) CONTRACTL_END; // Temporarily set the size to 2 pages, so we can get the headers. - m_size = OS_PAGE_SIZE*2; + m_size = GetOsPageSize()*2; m_pNTHeaders = PTR_IMAGE_NT_HEADERS(FindNTHeaders()); if (!m_pNTHeaders) @@ -177,7 +177,7 @@ inline HRESULT PEDecoder::Init(void *mappedBase, bool fixedUp /*= FALSE*/) NOTHROW; GC_NOTRIGGER; PRECONDITION(CheckPointer(mappedBase)); - PRECONDITION(CheckAligned(mappedBase, OS_PAGE_SIZE)); + PRECONDITION(CheckAligned(mappedBase, GetOsPageSize())); PRECONDITION(!HasContents()); } CONTRACTL_END; @@ -188,7 +188,7 @@ inline HRESULT PEDecoder::Init(void *mappedBase, bool fixedUp /*= FALSE*/) m_flags |= FLAG_RELOCATED; // Temporarily set the size to 2 pages, so we can get the headers. - m_size = OS_PAGE_SIZE*2; + m_size = GetOsPageSize()*2; m_pNTHeaders = FindNTHeaders(); if (!m_pNTHeaders) diff --git a/src/inc/switches.h b/src/inc/switches.h index 79964530fa..fae746d853 100644 --- a/src/inc/switches.h +++ b/src/inc/switches.h @@ -72,11 +72,9 @@ #endif #if defined(_TARGET_X86_) || defined(_TARGET_ARM_) - #define PAGE_SIZE 0x1000 #define USE_UPPER_ADDRESS 0 #elif defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_) - #define PAGE_SIZE 0x1000 #define UPPER_ADDRESS_MAPPING_FACTOR 2 #define CLR_UPPER_ADDRESS_MIN 0x64400000000 #define CODEHEAP_START_ADDRESS 0x64480000000 @@ -92,10 +90,6 @@ #error Please add a new #elif clause and define all portability macros for the new platform #endif -#ifndef OS_PAGE_SIZE -#define OS_PAGE_SIZE PAGE_SIZE -#endif - #if defined(_WIN64) #define JIT_IS_ALIGNED #endif diff --git a/src/inc/utilcode.h b/src/inc/utilcode.h index 78dbf69226..db8465ad89 100644 --- a/src/inc/utilcode.h +++ b/src/inc/utilcode.h @@ -1490,6 +1490,9 @@ public: int GetCurrentProcessCpuCount(); DWORD_PTR GetCurrentProcessCpuMask(); +uint32_t GetOsPageSize(); + + //***************************************************************************** // Return != 0 if the bit at the specified index in the array is on and 0 if // it is off. |