dnl Availability of various common functions (non-fatal if missing),
dnl and various less common threadsafe functions
AC_CHECK_FUNCS_ONCE([\
+ elf_aux_info \
fallocate \
+ getauxval \
getegid \
geteuid \
getgid \
dnl Availability of various common headers (non-fatal if missing).
AC_CHECK_HEADERS([\
+ asm/hwcap.h \
ifaddrs.h \
libtasn1.h \
util.h \
#include <config.h>
#if defined(__aarch64__)
-# include <asm/hwcap.h>
+# if defined(HAVE_ASM_HWCAP_H)
+# include <asm/hwcap.h>
+# endif
# include <sys/auxv.h>
#endif
int cpu_feature_index = 0;
size_t i;
+# if defined(HAVE_GETAUXVAL)
if (!(getauxval(AT_HWCAP) & HWCAP_CPUID)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("CPUID registers unavailable"));
return -1;
}
+# endif
/* read the cpuid data from MIDR_EL1 register */
asm("mrs %0, MIDR_EL1" : "=r" (cpuid));
/* parse the corresponding vendor_id bits */
data->vendor_id = (cpuid >> 24) & 0xff;
+# if defined(HAVE_GETAUXVAL)
hwcaps = getauxval(AT_HWCAP);
+# elif defined(HAVE_ELF_AUX_INFO)
+ elf_aux_info(AT_HWCAP, &hwcaps, sizeof(u_long));
+# else
+# error No routines to retrieve a value from the auxiliary vector
+# endif
VIR_DEBUG("CPU flags read from register: 0x%016lx", hwcaps);
features = g_new0(char *, MAX_CPU_FLAGS + 1);