Skip to content

Commit

Permalink
selftests/powerpc: Compile selftests against headers without AT_HWCAP2
Browse files Browse the repository at this point in the history
It might be nice to compile selftests against older kernels and
headers but which may not have HWCAP2.

Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Cyril Bur authored and Michael Ellerman committed Sep 23, 2016
1 parent f1a55ce commit 96c4470
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/testing/selftests/powerpc/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,17 @@ static inline bool have_hwcap(unsigned long ftr)
return ((unsigned long)get_auxv_entry(AT_HWCAP) & ftr) == ftr;
}

#ifdef AT_HWCAP2
static inline bool have_hwcap2(unsigned long ftr2)
{
return ((unsigned long)get_auxv_entry(AT_HWCAP2) & ftr2) == ftr2;
}
#else
static inline bool have_hwcap2(unsigned long ftr2)
{
return false;
}
#endif

/* Yes, this is evil */
#define FAIL_IF(x) \
Expand Down

0 comments on commit 96c4470

Please sign in to comment.