X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=os%2Fos-linux.h;h=3001140ca486630d6bb60a2958c01d824fbd7fc8;hb=2b3d4a6a924e0aa82654d3b96fb134085af7a98a;hp=12886037dd40ddf5dc3dafbd99be943253e4b78d;hpb=8d6e8d99c8e080a20c025cf16f98097b630c072e;p=fio.git diff --git a/os/os-linux.h b/os/os-linux.h index 12886037..3001140c 100644 --- a/os/os-linux.h +++ b/os/os-linux.h @@ -20,6 +20,9 @@ #ifdef ARCH_HAVE_CRC_CRYPTO #include +#ifndef HWCAP_PMULL +#define HWCAP_PMULL (1 << 4) +#endif /* HWCAP_PMULL */ #ifndef HWCAP_CRC32 #define HWCAP_CRC32 (1 << 7) #endif /* HWCAP_CRC32 */ @@ -129,6 +132,11 @@ static inline int ioprio_value(int ioprio_class, int ioprio) return (ioprio_class << IOPRIO_CLASS_SHIFT) | ioprio; } +static inline bool ioprio_value_is_class_rt(unsigned int priority) +{ + return (priority >> IOPRIO_CLASS_SHIFT) == IOPRIO_CLASS_RT; +} + static inline int ioprio_set(int which, int who, int ioprio_class, int ioprio) { return syscall(__NR_ioprio_set, which, who, @@ -400,7 +408,8 @@ static inline bool os_cpu_has(cpu_features feature) #ifdef ARCH_HAVE_CRC_CRYPTO case CPU_ARM64_CRC32C: hwcap = getauxval(AT_HWCAP); - have_feature = (hwcap & HWCAP_CRC32) != 0; + have_feature = (hwcap & (HWCAP_PMULL | HWCAP_CRC32)) == + (HWCAP_PMULL | HWCAP_CRC32); break; #endif default: