#include <linux/fs.h>
#include <scsi/sg.h>
+#ifdef ARCH_HAVE_CRC_CRYPTO
+#include <sys/auxv.h>
+#ifndef HWCAP_CRC32
+#define HWCAP_CRC32 (1 << 7)
+#endif /* HWCAP_CRC32 */
+#endif /* ARCH_HAVE_CRC_CRYPTO */
+
#include "./os-linux-syscall.h"
#include "binject.h"
#include "../file.h"
}
#endif
+#define FIO_HAVE_CPU_HAS
+static inline bool os_cpu_has(cpu_features feature)
+{
+ bool have_feature;
+ unsigned long fio_unused hwcap;
+
+ switch (feature) {
+#ifdef ARCH_HAVE_CRC_CRYPTO
+ case CPU_ARM64_CRC32C:
+ hwcap = getauxval(AT_HWCAP);
+ have_feature = (hwcap & HWCAP_CRC32) != 0;
+ break;
+#endif
+ default:
+ have_feature = false;
+ }
+
+ return have_feature;
+}
+
#endif