Path: blob/master/tools/perf/arch/arm64/tests/cpuid-match.c
26292 views
// SPDX-License-Identifier: GPL-2.01#include <linux/compiler.h>23#include "arch-tests.h"4#include "tests/tests.h"5#include "util/header.h"67int test__cpuid_match(struct test_suite *test __maybe_unused,8int subtest __maybe_unused)9{10/* midr with no leading zeros matches */11if (strcmp_cpuid_str("0x410fd0c0", "0x00000000410fd0c0"))12return -1;13/* Upper case matches */14if (strcmp_cpuid_str("0x410fd0c0", "0x00000000410FD0C0"))15return -1;16/* r0p0 = r0p0 matches */17if (strcmp_cpuid_str("0x00000000410fd480", "0x00000000410fd480"))18return -1;19/* r0p1 > r0p0 matches */20if (strcmp_cpuid_str("0x00000000410fd480", "0x00000000410fd481"))21return -1;22/* r1p0 > r0p0 matches*/23if (strcmp_cpuid_str("0x00000000410fd480", "0x00000000411fd480"))24return -1;25/* r0p0 < r0p1 doesn't match */26if (!strcmp_cpuid_str("0x00000000410fd481", "0x00000000410fd480"))27return -1;28/* r0p0 < r1p0 doesn't match */29if (!strcmp_cpuid_str("0x00000000411fd480", "0x00000000410fd480"))30return -1;31/* Different CPU doesn't match */32if (!strcmp_cpuid_str("0x00000000410fd4c0", "0x00000000430f0af0"))33return -1;3435return 0;36}373839