]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
powerpc: Move cpu_has_feature() to a separate file
authorKevin Hao <haokexin@gmail.com>
Sat, 23 Jul 2016 09:12:40 +0000 (14:42 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 1 Aug 2016 01:15:03 +0000 (11:15 +1000)
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>
18 files changed:
arch/powerpc/include/asm/book3s/64/mmu-hash.h
arch/powerpc/include/asm/cacheflush.h
arch/powerpc/include/asm/cpu_has_feature.h [new file with mode: 0644]
arch/powerpc/include/asm/cputable.h
arch/powerpc/include/asm/cputime.h
arch/powerpc/include/asm/dbell.h
arch/powerpc/include/asm/dcr-native.h
arch/powerpc/include/asm/mman.h
arch/powerpc/include/asm/time.h
arch/powerpc/include/asm/xor.h
arch/powerpc/kernel/align.c
arch/powerpc/kernel/irq.c
arch/powerpc/kernel/process.c
arch/powerpc/kernel/setup-common.c
arch/powerpc/kernel/setup_32.c
arch/powerpc/kernel/smp.c
arch/powerpc/platforms/cell/pervasive.c
arch/powerpc/xmon/ppc-dis.c

index 5eaf86ac143d943d37e3f58ef725b4dbcccb1d02..032e9f0bc7084099f031fe37a43e2846103be095 100644 (file)
@@ -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
index 69fb16d7a8117a9509120ba81991075e19de104d..b77f0364df94059982c709403d9d5ba3affd0b9c 100644 (file)
@@ -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,
diff --git a/arch/powerpc/include/asm/cpu_has_feature.h b/arch/powerpc/include/asm/cpu_has_feature.h
new file mode 100644 (file)
index 0000000..c935c58
--- /dev/null
@@ -0,0 +1,20 @@
+#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 */
index 3d8dc9a7831d51cf9fbda0fb9235361ad84390bd..92961bcfbe3fb38ecb6952da3b6425211b3ba2de 100644 (file)
@@ -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__ */
index 2dfd4fc41f3e822496a1a118ac8d1f26b21b72b4..4f60db074725c7aed926fb9903b416d725abf51e 100644 (file)
@@ -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;
index 5fa6b20eba10a5fd34939f0ee2313413ff285aa6..378167377065a01b3f98df459d82e75277b1d6fe 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/threads.h>
 
 #include <asm/ppc-opcode.h>
+#include <asm/cpu_has_feature.h>
 
 #define PPC_DBELL_MSG_BRDCAST  (0x04000000)
 #define PPC_DBELL_TYPE(x)      (((x) & 0xf) << (63-36))
index 4efc11dacb9805013944790c6767d9c1d27c5616..4a2beef7427721eab0129a28696182047c659687 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <linux/spinlock.h>
 #include <asm/cputable.h>
+#include <asm/cpu_has_feature.h>
 
 typedef struct {
        unsigned int base;
index 2563c435a4b166593e71812086baa791a01de43b..ef2d9ac1bc5233dc72ee3e1ee480f5b173f5b20f 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <asm/cputable.h>
 #include <linux/mm.h>
+#include <asm/cpu_has_feature.h>
 
 /*
  * This file is included by linux/mman.h, so we can't use cacl_vm_prot_bits()
index cbbeaf0a6597203e1262315a689987464ca61777..b240666b7bc1e9e11fc183183cbe37ed56de51e2 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/percpu.h>
 
 #include <asm/processor.h>
+#include <asm/cpu_has_feature.h>
 
 /* time.c */
 extern unsigned long tb_ticks_per_jiffy;
index 0abb97f3be106700e224fbcc2c37d7ee783f3a72..a36c2069d8ed55d615d0687bcc3577d85f91a93c 100644 (file)
@@ -23,6 +23,7 @@
 #ifdef CONFIG_ALTIVEC
 
 #include <asm/cputable.h>
+#include <asm/cpu_has_feature.h>
 
 void xor_altivec_2(unsigned long bytes, unsigned long *v1_in,
                   unsigned long *v2_in);
index c7097f933114c0fca94453b2ae6350217d50d4e7..033f3385fa49496d1d2de6837be081f33c3c357e 100644 (file)
@@ -26,6 +26,7 @@
 #include <asm/emulated_ops.h>
 #include <asm/switch_to.h>
 #include <asm/disassemble.h>
+#include <asm/cpu_has_feature.h>
 
 struct aligninfo {
        unsigned char len;
index ac910d9982df8f70fd12fe7f9c9c5619eb4adf77..08887cf2b20ee4a49d8ad88f4a6c00b1a722d974 100644 (file)
@@ -75,6 +75,7 @@
 #endif
 #define CREATE_TRACE_POINTS
 #include <asm/trace.h>
+#include <asm/cpu_has_feature.h>
 
 DEFINE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
 EXPORT_PER_CPU_SYMBOL(irq_stat);
index a8cca88e972f2abb371d869cc26b5d2a11fcee70..9ee2623e0f674977ee8e8f07bbfb1297a2f05dc8 100644 (file)
@@ -58,6 +58,7 @@
 #include <asm/code-patching.h>
 #include <asm/exec.h>
 #include <asm/livepatch.h>
+#include <asm/cpu_has_feature.h>
 
 #include <linux/kprobes.h>
 #include <linux/kdebug.h>
index 714b4ba7ab86e637dbc695879e372ea32be06c68..dba265c586df010fea218aa2c3d54102c5dbb708 100644 (file)
@@ -66,6 +66,7 @@
 #include <asm/hugetlb.h>
 #include <asm/livepatch.h>
 #include <asm/mmu_context.h>
+#include <asm/cpu_has_feature.h>
 
 #include "setup.h"
 
index 00f57754407ec2bb56177dc0d77619e7214a78ff..c3e861df4b203ce5be8e0e9f0fb8f4e236d41cd5 100644 (file)
@@ -37,6 +37,7 @@
 #include <asm/serial.h>
 #include <asm/udbg.h>
 #include <asm/code-patching.h>
+#include <asm/cpu_has_feature.h>
 
 #define DBG(fmt...)
 
index 5a1f015ea9f36bfea7e55040699eb2acfa237269..25a39052bf6b5653c3ab0317298864a2873fd911 100644 (file)
@@ -55,6 +55,7 @@
 #include <asm/debug.h>
 #include <asm/kexec.h>
 #include <asm/asm-prototypes.h>
+#include <asm/cpu_has_feature.h>
 
 #ifdef DEBUG
 #include <asm/udbg.h>
index d17e98bc0c10d3ff0469cfa8af873f08d57abded..e7d075077cb045399cb90a65547cb2a13649a86f 100644 (file)
@@ -35,6 +35,7 @@
 #include <asm/pgtable.h>
 #include <asm/reg.h>
 #include <asm/cell-regs.h>
+#include <asm/cpu_has_feature.h>
 
 #include "pervasive.h"
 
index 89098f320ad570577328ff42ba4e426a5d22d37f..ee98917341496905876dadc6e51cdfd4b9ced815 100644 (file)
@@ -20,6 +20,7 @@ along with this file; see the file COPYING.  If not, write to the Free
 Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #include <asm/cputable.h>
+#include <asm/cpu_has_feature.h>
 #include "nonstdio.h"
 #include "ansidecl.h"
 #include "ppc.h"