aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/ppc_asm.h
diff options
context:
space:
mode:
authorDiana Craciun <diana.craciun@nxp.com>2018-12-12 16:03:01 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2018-12-20 22:58:57 +1100
commit1cbf8990d79ff69da8ad09e8a3df014e1494462b (patch)
tree55e80dbb95860ce7a17abc25b46fd28a552fa7ce /arch/powerpc/include/asm/ppc_asm.h
parentpowerpc/fsl: Add infrastructure to fixup branch predictor flush (diff)
downloadlinux-dev-1cbf8990d79ff69da8ad09e8a3df014e1494462b.tar.xz
linux-dev-1cbf8990d79ff69da8ad09e8a3df014e1494462b.zip
powerpc/fsl: Add macro to flush the branch predictor
The BUCSR register can be used to invalidate the entries in the branch prediction mechanisms. Signed-off-by: Diana Craciun <diana.craciun@nxp.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/include/asm/ppc_asm.h')
-rw-r--r--arch/powerpc/include/asm/ppc_asm.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h
index 378432995eb7..e0637730a8e7 100644
--- a/arch/powerpc/include/asm/ppc_asm.h
+++ b/arch/powerpc/include/asm/ppc_asm.h
@@ -806,4 +806,14 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)
stringify_in_c(.long (_target) - . ;) \
stringify_in_c(.previous)
+#ifdef CONFIG_PPC_FSL_BOOK3E
+#define BTB_FLUSH(reg) \
+ lis reg,BUCSR_INIT@h; \
+ ori reg,reg,BUCSR_INIT@l; \
+ mtspr SPRN_BUCSR,reg; \
+ isync;
+#else
+#define BTB_FLUSH(reg)
+#endif /* CONFIG_PPC_FSL_BOOK3E */
+
#endif /* _ASM_POWERPC_PPC_ASM_H */