Commit 34dc8b27 authored by Michael Ellerman's avatar Michael Ellerman

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: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent ede8ef3f
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
#include <unistd.h> #include <unistd.h>
#include <sys/syscall.h> #include <sys/syscall.h>
#include <asm/tm.h> #include <asm/tm.h>
#include <asm/cputable.h>
#include <sys/time.h> #include <sys/time.h>
#include <stdlib.h> #include <stdlib.h>
#include "utils.h" #include "utils.h"
#include "tm.h"
extern int getppid_tm_active(void); extern int getppid_tm_active(void);
extern int getppid_tm_suspended(void); extern int getppid_tm_suspended(void);
...@@ -76,16 +76,6 @@ pid_t getppid_tm(bool suspend) ...@@ -76,16 +76,6 @@ pid_t getppid_tm(bool suspend)
exit(-1); exit(-1);
} }
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
}
int tm_syscall(void) int tm_syscall(void)
{ {
unsigned count = 0; unsigned count = 0;
......
/*
* 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 */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment