Use getauxval system function for detecting ARM HW features
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Mon, 8 Apr 2019 17:44:08 +0000 (20:44 +0300)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Mon, 8 Apr 2019 20:25:19 +0000 (23:25 +0300)
commit6812a2c5bd2d9129bfdf34f3daf89cd8543ed8e5
tree4179a5991aafb6f4f1da1ab747defcd71c938b6b
parent04a6c3c7482dd1ecb5113a049b1765b0d5f212fb
Use getauxval system function for detecting ARM HW features

* configure.ac: Add header check for 'sys/auxv.h'; Add function check
for 'getauxval'.
* src/hwf-arm.c [HAVE_SYS_AUXV_H && HAVE_GETAUXVAL]: Include
'sys/auxv.h'.
(HAS_SYS_AT_HWCAP): Enable AT_HWCAP if have 'getauxval' in addition of
__linux__.
(AT_HWCAP, AT_HWCAP2, HWCAP_NEON, HWCAP2_AES, HWCAP2_PMULL)
(HWCAP2_SHA1, HWCAP2_SHA2, HWCAP_ASIMD, HWCAP_AES)
(HWCAP_PMULL, HWCAP_SHA1, HWCAP_SHA2): Define these macros only if not
already defined.
(get_hwcap) [HAVE_SYS_AUXV_H && HAVE_GETAUXVAL]: Use 'getauxval' to
fetch HW capability flags.
--

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
configure.ac
src/hwf-arm.c