mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-22 10:45:06 +00:00
#749 Use HWCAP to detect AES feature on ARMv8, thanks @lhirlimann.
This commit is contained in:
parent
7e4858db2a
commit
ab60add9d5
2 changed files with 12 additions and 3 deletions
|
@ -11,7 +11,7 @@ option(WITH_DEBUG_LOG "Enable debug log output" OFF)
|
||||||
option(WITH_TLS "Enable OpenSSL support" ON)
|
option(WITH_TLS "Enable OpenSSL support" ON)
|
||||||
option(WITH_ASM "Enable ASM PoW implementations" ON)
|
option(WITH_ASM "Enable ASM PoW implementations" ON)
|
||||||
option(BUILD_STATIC "Build static binary" OFF)
|
option(BUILD_STATIC "Build static binary" OFF)
|
||||||
option(ARM_TARGET "Force use specific ARM target 8 or 7" 0)
|
option(ARM_TARGET "Force use specific ARM target 8 or 7" 0)
|
||||||
|
|
||||||
include (CheckIncludeFile)
|
include (CheckIncludeFile)
|
||||||
include (cmake/cpu.cmake)
|
include (cmake/cpu.cmake)
|
||||||
|
|
|
@ -25,6 +25,11 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
|
#if __ARM_FEATURE_CRYPTO
|
||||||
|
# include <sys/auxv.h>
|
||||||
|
# include <asm/hwcap.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include "common/cpu/BasicCpuInfo.h"
|
#include "common/cpu/BasicCpuInfo.h"
|
||||||
|
|
||||||
|
@ -35,10 +40,14 @@ xmrig::BasicCpuInfo::BasicCpuInfo() :
|
||||||
m_brand(),
|
m_brand(),
|
||||||
m_threads(std::thread::hardware_concurrency())
|
m_threads(std::thread::hardware_concurrency())
|
||||||
{
|
{
|
||||||
memcpy(m_brand, "Unknown", 7);
|
# ifdef XMRIG_ARMv8
|
||||||
|
memcpy(m_brand, "ARMv8", 5);
|
||||||
|
# else
|
||||||
|
memcpy(m_brand, "ARMv7", 5);
|
||||||
|
# endif
|
||||||
|
|
||||||
# if __ARM_FEATURE_CRYPTO
|
# if __ARM_FEATURE_CRYPTO
|
||||||
m_aes = true;
|
m_aes = getauxval(AT_HWCAP) & HWCAP_AES;
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue