selftests/powerpc: Move TM helpers into tm.h
Move have_htm_nosc() into a new tm.h, and add a new helper, have_htm() which we'll use in the next patch. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
34
tools/testing/selftests/powerpc/tm/tm.h
Normal file
34
tools/testing/selftests/powerpc/tm/tm.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright 2015, Michael Ellerman, IBM Corp.
|
||||
* Licensed under GPLv2.
|
||||
*/
|
||||
|
||||
#ifndef _SELFTESTS_POWERPC_TM_TM_H
|
||||
#define _SELFTESTS_POWERPC_TM_TM_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <asm/cputable.h>
|
||||
|
||||
#include "../utils.h"
|
||||
|
||||
static inline bool have_htm(void)
|
||||
{
|
||||
#ifdef PPC_FEATURE2_HTM
|
||||
return have_hwcap2(PPC_FEATURE2_HTM);
|
||||
#else
|
||||
printf("PPC_FEATURE2_HTM not defined, can't check AT_HWCAP2\n");
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool have_htm_nosc(void)
|
||||
{
|
||||
#ifdef PPC_FEATURE2_HTM_NOSC
|
||||
return have_hwcap2(PPC_FEATURE2_HTM_NOSC);
|
||||
#else
|
||||
printf("PPC_FEATURE2_HTM_NOSC not defined, can't check AT_HWCAP2\n");
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* _SELFTESTS_POWERPC_TM_TM_H */
|
Reference in New Issue
Block a user