Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b92a226e authored by Kevin Hao's avatar Kevin Hao Committed by Michael Ellerman
Browse files

powerpc: Move cpu_has_feature() to a separate file



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: default avatarKevin Hao <haokexin@gmail.com>
Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
[mpe: Rename to cpu_has_feature.h and flesh out change log]
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 905259e3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include <asm/book3s/64/pgtable.h>
#include <asm/bug.h>
#include <asm/processor.h>
#include <asm/cpu_has_feature.h>

/*
 * SLB
+1 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@

#include <linux/mm.h>
#include <asm/cputable.h>
#include <asm/cpu_has_feature.h>

/*
 * No cache flushing is required when address mappings are changed,
+20 −0
Original line number Diff line number Diff line
#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 */
+0 −11
Original line number Diff line number Diff line
@@ -577,17 +577,6 @@ enum {
};
#endif /* __powerpc64__ */

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__ */
+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ static inline void setup_cputime_one_jiffy(void) { }
#include <asm/div64.h>
#include <asm/time.h>
#include <asm/param.h>
#include <asm/cpu_has_feature.h>

typedef u64 __nocast cputime_t;
typedef u64 __nocast cputime64_t;
Loading