summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/powerpc/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/powerpc/utils.h')
-rw-r--r--tools/testing/selftests/powerpc/utils.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/powerpc/utils.h b/tools/testing/selftests/powerpc/utils.h
index a985cfaa5..fbd33e52e 100644
--- a/tools/testing/selftests/powerpc/utils.h
+++ b/tools/testing/selftests/powerpc/utils.h
@@ -27,6 +27,11 @@ int test_harness(int (test_function)(void), char *name);
extern void *get_auxv_entry(int type);
int pick_online_cpu(void);
+static inline bool have_hwcap(unsigned long ftr)
+{
+ return ((unsigned long)get_auxv_entry(AT_HWCAP) & ftr) == ftr;
+}
+
static inline bool have_hwcap2(unsigned long ftr2)
{
return ((unsigned long)get_auxv_entry(AT_HWCAP2) & ftr2) == ftr2;