From 166c011d373d428ed503b31d29aeaad035925cb0 Mon Sep 17 00:00:00 2001 From: SChernykh Date: Wed, 7 Oct 2020 18:09:42 +0200 Subject: [PATCH] Fixed ARM compilation --- src/crypto/randomx/jit_compiler_a64.cpp | 11 ++++++++--- src/crypto/randomx/jit_compiler_a64.hpp | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/crypto/randomx/jit_compiler_a64.cpp b/src/crypto/randomx/jit_compiler_a64.cpp index 964f30a36..a3e308c8e 100644 --- a/src/crypto/randomx/jit_compiler_a64.cpp +++ b/src/crypto/randomx/jit_compiler_a64.cpp @@ -33,7 +33,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "crypto/randomx/reciprocal.h" #include "crypto/randomx/virtual_memory.hpp" -void randomx_set_huge_pages_jit(bool) {} +static bool hugePagesJIT = false; + +void randomx_set_huge_pages_jit(bool hugePages) +{ + hugePagesJIT = hugePages; +} namespace ARMV8A { @@ -91,8 +96,8 @@ static size_t CalcDatasetItemSize() constexpr uint32_t IntRegMap[8] = { 4, 5, 6, 7, 12, 13, 14, 15 }; -JitCompilerA64::JitCompilerA64(bool) - : code((uint8_t*) allocExecutableMemory(CodeSize + CalcDatasetItemSize())) +JitCompilerA64::JitCompilerA64(bool hugePagesEnable) + : code((uint8_t*) allocExecutableMemory(CodeSize + CalcDatasetItemSize(), hugePagesJIT && hugePagesEnable)) , literalPos(ImulRcpLiteralsEnd) , num32bitLiterals(0) { diff --git a/src/crypto/randomx/jit_compiler_a64.hpp b/src/crypto/randomx/jit_compiler_a64.hpp index 1683230d6..cfcb0f85f 100644 --- a/src/crypto/randomx/jit_compiler_a64.hpp +++ b/src/crypto/randomx/jit_compiler_a64.hpp @@ -46,7 +46,7 @@ namespace randomx { class JitCompilerA64 { public: - explicit JitCompilerA64(bool); + explicit JitCompilerA64(bool hugePagesEnable); ~JitCompilerA64(); void prepare() {}