aboutsummaryrefslogtreecommitdiff
path: root/sys/libkern
diff options
context:
space:
mode:
authorMitchell Horne <mhorne@FreeBSD.org>2020-09-08 15:39:19 +0000
committerMitchell Horne <mhorne@FreeBSD.org>2020-09-08 15:39:19 +0000
commit66245bc5360ccff5d734bded0d22d436bc11b2a9 (patch)
treeff0a5874696d15647256bbe84731d9cb6084e916 /sys/libkern
parent752eb6a99576f8b450397adb7e437a90799f3775 (diff)
downloadsrc-66245bc5360ccff5d734bded0d22d436bc11b2a9.tar.gz
src-66245bc5360ccff5d734bded0d22d436bc11b2a9.zip
Notes
Diffstat (limited to 'sys/libkern')
-rw-r--r--sys/libkern/gsb_crc32.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/sys/libkern/gsb_crc32.c b/sys/libkern/gsb_crc32.c
index 81583567ce84..b2f7421c20eb 100644
--- a/sys/libkern/gsb_crc32.c
+++ b/sys/libkern/gsb_crc32.c
@@ -58,7 +58,8 @@ __FBSDID("$FreeBSD$");
#endif
#if defined(__aarch64__)
-#include <machine/cpu.h>
+#include <machine/elf.h>
+#include <machine/md_var.h>
#endif
#endif /* _KERNEL */
@@ -755,14 +756,7 @@ calculate_crc32c(uint32_t crc32c,
} else
#endif
#if defined(__aarch64__)
- uint64_t reg;
-
- /*
- * We only test for CRC32 support on the CPU with index 0 assuming that
- * this applies to all CPUs.
- */
- reg = READ_SPECIALREG(id_aa64isar0_el1);
- if (ID_AA64ISAR0_CRC32_VAL(reg) != ID_AA64ISAR0_CRC32_NONE) {
+ if ((elf_hwcap & HWCAP_CRC32) != 0) {
return (armv8_crc32c(crc32c, buffer, length));
} else
#endif