diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h index 7bb87017d9dbdbcc7e7d691e713baf76f3694073..3d8dc9a7831d51cf9fbda0fb9235361ad84390bd 100644 --- a/arch/powerpc/include/asm/cputable.h +++ b/arch/powerpc/include/asm/cputable.h @@ -577,12 +577,17 @@ enum { }; #endif /* __powerpc64__ */ -static inline bool cpu_has_feature(unsigned long feature) +static inline bool early_cpu_has_feature(unsigned long feature) { return !!((CPU_FTRS_ALWAYS & feature) || (CPU_FTRS_POSSIBLE & cur_cpu_spec->cpu_features & feature)); } +static inline bool cpu_has_feature(unsigned long feature) +{ + return early_cpu_has_feature(feature); +} + #define HBP_NUM 1 #endif /* !__ASSEMBLY__ */ diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h index f413b3213a3bfbf5bb0491986fc3e94817c37259..08b4c06604d6fe53e0999e1d1a21f76e26831d2b 100644 --- a/arch/powerpc/include/asm/mmu.h +++ b/arch/powerpc/include/asm/mmu.h @@ -135,11 +135,16 @@ enum { 0, }; -static inline bool mmu_has_feature(unsigned long feature) +static inline bool early_mmu_has_feature(unsigned long feature) { return !!(MMU_FTRS_POSSIBLE & cur_cpu_spec->mmu_features & feature); } +static inline bool mmu_has_feature(unsigned long feature) +{ + return early_mmu_has_feature(feature); +} + static inline void mmu_clear_feature(unsigned long feature) { cur_cpu_spec->mmu_features &= ~feature; @@ -168,11 +173,21 @@ static inline bool radix_enabled(void) { return mmu_has_feature(MMU_FTR_TYPE_RADIX); } + +static inline bool early_radix_enabled(void) +{ + return early_mmu_has_feature(MMU_FTR_TYPE_RADIX); +} #else static inline bool radix_enabled(void) { return false; } + +static inline bool early_radix_enabled(void) +{ + return false; +} #endif #endif /* !__ASSEMBLY__ */