summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/cputhreads.h
diff options
context:
space:
mode:
authorchenhui zhao <chenhui.zhao@freescale.com>2015-12-24 08:39:57 +0800
committerScott Wood <oss@buserror.net>2016-03-04 23:44:02 -0600
commitebb9d30a6a74f4ced5b7d35446ebb6362a724393 (patch)
tree2efd7b3e75538b5550e273116adbba546fb859f4 /arch/powerpc/include/asm/cputhreads.h
parentd64716caf7724dbacd6d79249b90973bf6a9852a (diff)
downloadop-kernel-dev-ebb9d30a6a74f4ced5b7d35446ebb6362a724393.zip
op-kernel-dev-ebb9d30a6a74f4ced5b7d35446ebb6362a724393.tar.gz
powerpc/mm: any thread in one core can be the first to setup TLB1
On e6500, in the case of cpu hotplug, either thread in one core may be the first thread initilzing the TLB1. The subsequent threads must not setup it again. The code is derived from the comment of Scott Wood. Signed-off-by: Chenhui Zhao <chenhui.zhao@freescale.com> Signed-off-by: Scott Wood <oss@buserror.net>
Diffstat (limited to 'arch/powerpc/include/asm/cputhreads.h')
-rw-r--r--arch/powerpc/include/asm/cputhreads.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/cputhreads.h b/arch/powerpc/include/asm/cputhreads.h
index ba42e46..ea96231 100644
--- a/arch/powerpc/include/asm/cputhreads.h
+++ b/arch/powerpc/include/asm/cputhreads.h
@@ -94,6 +94,14 @@ static inline int cpu_last_thread_sibling(int cpu)
return cpu | (threads_per_core - 1);
}
+static inline u32 get_tensr(void)
+{
+#ifdef CONFIG_BOOKE
+ if (cpu_has_feature(CPU_FTR_SMT))
+ return mfspr(SPRN_TENSR);
+#endif
+ return 1;
+}
#endif /* _ASM_POWERPC_CPUTHREADS_H */
OpenPOWER on IntegriCloud