aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch/powerpc/include/asm/mmu.h
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2016-07-27 13:37:58 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2016-08-01 11:14:59 +1000
commitbab4c8de6289b4615c21ddf0400397d03ce1863c (patch)
tree5f30b809c190cbf45679a91178b4185d553ee894 /arch/powerpc/include/asm/mmu.h
parentpowerpc/kernel: Convert cpu_has_feature() to returning bool (diff)
downloadwireguard-linux-bab4c8de6289b4615c21ddf0400397d03ce1863c.tar.xz
wireguard-linux-bab4c8de6289b4615c21ddf0400397d03ce1863c.zip
powerpc/mm: Define radix_enabled() in one place & use static inline
Currently we have radix_enabled() three times, twice in asm/book3s/64/mmu.h and then a fallback in asm/mmu.h. Consolidate them in asm/mmu.h. While we're at it convert them to be static inlines, and change the fallback case to returning a bool, like mmu_has_feature(). Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/include/asm/mmu.h')
-rw-r--r--arch/powerpc/include/asm/mmu.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h
index eb942a446969..f413b3213a3b 100644
--- a/arch/powerpc/include/asm/mmu.h
+++ b/arch/powerpc/include/asm/mmu.h
@@ -163,6 +163,18 @@ static inline void assert_pte_locked(struct mm_struct *mm, unsigned long addr)
}
#endif /* !CONFIG_DEBUG_VM */
+#ifdef CONFIG_PPC_RADIX_MMU
+static inline bool radix_enabled(void)
+{
+ return mmu_has_feature(MMU_FTR_TYPE_RADIX);
+}
+#else
+static inline bool radix_enabled(void)
+{
+ return false;
+}
+#endif
+
#endif /* !__ASSEMBLY__ */
/* The kernel use the constants below to index in the page sizes array.
@@ -230,9 +242,5 @@ static inline void mmu_early_init_devtree(void) { }
# include <asm/mmu-8xx.h>
#endif
-#ifndef radix_enabled
-#define radix_enabled() (0)
-#endif
-
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_MMU_H_ */