selftests/powerpc: Add have_hwcap2() helper

We already do this twice and want to add another so add a helper.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
Michael Ellerman
2015-11-24 13:05:39 +11:00
parent fcb45ec074
commit ede8ef3f82
3 changed files with 8 additions and 4 deletions

View File

@@ -13,7 +13,6 @@
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <linux/auxvec.h>
#include "trace.h"
#include "reg.h"
@@ -324,7 +323,7 @@ bool ebb_is_supported(void)
{
#ifdef PPC_FEATURE2_EBB
/* EBB requires at least POWER8 */
return ((long)get_auxv_entry(AT_HWCAP2) & PPC_FEATURE2_EBB);
return have_hwcap2(PPC_FEATURE2_EBB);
#else
return false;
#endif