mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
We plan to use jump label for cpu_has_feature(). In order to implement this we need to include the linux/jump_label.h in asm/cputable.h. Unfortunately if we do that it leads to an include loop. The root of the problem seems to be that reg.h needs cputable.h (for CPU_FTRs), and then cputable.h via jump_label.h eventually pulls in hw_irq.h which needs reg.h (for MSR_EE). So move cpu_has_feature() to a separate file on its own. Signed-off-by: Kevin Hao <haokexin@gmail.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> [mpe: Rename to cpu_has_feature.h and flesh out change log] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
21 lines
467 B
C
21 lines
467 B
C
#ifndef __ASM_POWERPC_CPUFEATURES_H
|
|
#define __ASM_POWERPC_CPUFEATURES_H
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
#include <asm/cputable.h>
|
|
|
|
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);
|
|
}
|
|
|
|
#endif /* __ASSEMBLY__ */
|
|
#endif /* __ASM_POWERPC_CPUFEATURE_H */
|