Skip to content

Commit 09d2e95

Browse files
henryZewilldeacon
authored andcommitted
kselftest/arm64: add crc32 feature to hwcap test
Add the CRC32 feature check in the set of hwcap tests. Signed-off-by: Zeng Heng <[email protected]> Reviewed-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent eb27c76 commit 09d2e95

File tree

1 file changed

+12
-0
lines changed
  • tools/testing/selftests/arm64/abi

1 file changed

+12
-0
lines changed

tools/testing/selftests/arm64/abi/hwcap.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
*/
3434
typedef void (*sigill_fn)(void);
3535

36+
static void crc32_sigill(void)
37+
{
38+
asm volatile("crc32w w0, w0, w1");
39+
}
40+
3641
static void cssc_sigill(void)
3742
{
3843
/* CNT x0, x0 */
@@ -233,6 +238,13 @@ static const struct hwcap_data {
233238
sigill_fn sigill_fn;
234239
bool sigill_reliable;
235240
} hwcaps[] = {
241+
{
242+
.name = "CRC32",
243+
.at_hwcap = AT_HWCAP,
244+
.hwcap_bit = HWCAP_CRC32,
245+
.cpuinfo = "crc32",
246+
.sigill_fn = crc32_sigill,
247+
},
236248
{
237249
.name = "CSSC",
238250
.at_hwcap = AT_HWCAP2,

0 commit comments

Comments
 (0)