X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=crc%2Fcrc32c.h;h=5d664079b940fcb1691ceb569e7882fee7b57966;hb=6a2c93631bf45ab2e189a36d06e5cf402d6a4517;hp=46c106393ef13f6012d977d55e36fb414ede87f9;hpb=e3aaafc4e902a0f78b8ee4d4bc85f8edac6e09d2;p=fio.git diff --git a/crc/crc32c.h b/crc/crc32c.h index 46c10639..5d664079 100644 --- a/crc/crc32c.h +++ b/crc/crc32c.h @@ -21,8 +21,19 @@ #include "../arch/arch.h" extern uint32_t crc32c_sw(unsigned char const *, unsigned long); +extern int crc32c_arm64_available; extern int crc32c_intel_available; +#ifdef ARCH_HAVE_ARM64_CRC_CRYPTO +extern uint32_t crc32c_arm64(unsigned char const *, unsigned long); +extern void crc32c_arm64_probe(void); +#else +#define crc32c_arm64 crc32c_sw +static inline void crc32c_arm64_probe(void) +{ +} +#endif + #ifdef ARCH_HAVE_SSE4_2 extern uint32_t crc32c_intel(unsigned char const *, unsigned long); extern void crc32c_intel_probe(void); @@ -33,8 +44,11 @@ static inline void crc32c_intel_probe(void) } #endif -static inline uint32_t crc32c(unsigned char const *buf, unsigned long len) +static inline uint32_t fio_crc32c(unsigned char const *buf, unsigned long len) { + if (crc32c_arm64_available) + return crc32c_arm64(buf, len); + if (crc32c_intel_available) return crc32c_intel(buf, len);