[PATCH 03/10] MIPS: bmips: add macros for testing the current bmips CPU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Makes it easy to make code conditionally compiled for supported CPUs
without directly relying on #ifdefs.

Signed-off-by: Jonas Gorski <jogo@xxxxxxxxxxx>
---
 arch/mips/include/asm/bmips.h |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/mips/include/asm/bmips.h b/arch/mips/include/asm/bmips.h
index 87a253d..8906ac3 100644
--- a/arch/mips/include/asm/bmips.h
+++ b/arch/mips/include/asm/bmips.h
@@ -45,8 +45,19 @@
 #if !defined(__ASSEMBLY__)
 
 #include <linux/cpumask.h>
+#include <asm/cpu-features.h>
 #include <asm/r4kcache.h>
 
+#define cpu_is_bmips32()	(current_cpu_type() == CPU_BMIPS32)
+#define cpu_is_bmips3300()	(IS_ENABLED(CONFIG_CPU_BMIPS3300) && \
+				 current_cpu_type() == CPU_BMIPS3300)
+#define cpu_is_bmips4350()	(IS_ENABLED(CONFIG_CPU_BMIPS4350) && \
+				 current_cpu_type() == CPU_BMIPS4350)
+#define cpu_is_bmips4380()	(IS_ENABLED(CONFIG_CPU_BMIPS4380) && \
+				 current_cpu_type() == CPU_BMIPS4380)
+#define cpu_is_bmips5000()	(IS_ENABLED(CONFIG_CPU_BMIPS5000) && \
+				 current_cpu_type() == CPU_BMIPS5000)
+
 extern struct plat_smp_ops bmips_smp_ops;
 extern char bmips_reset_nmi_vec;
 extern char bmips_reset_nmi_vec_end;
-- 
1.7.10.4



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux