MIPS: smp-cps: function to determine whether CPS SMP is in use
authorPaul Burton <paul.burton@imgtec.com>
Fri, 14 Mar 2014 16:06:16 +0000 (16:06 +0000)
committerPaul Burton <paul.burton@imgtec.com>
Wed, 28 May 2014 15:20:29 +0000 (16:20 +0100)
The core power down state for cpuidle will require that the CPS SMP
implementation is in use. This patch provides a mips_cps_smp_in_use
function which determines whether or not the CPS SMP implementation is
currently in use.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
arch/mips/include/asm/smp-cps.h
arch/mips/kernel/smp-cps.c

index d49279e92eb5322e5193bd706eb395c7f117af98..324df2c835ac5240030abecfb3642aeb9ae8a2dd 100644 (file)
@@ -31,6 +31,8 @@ extern void mips_cps_core_init(void);
 
 extern struct vpe_boot_config *mips_cps_boot_vpes(void);
 
+extern bool mips_cps_smp_in_use(void);
+
 #else /* __ASSEMBLY__ */
 
 .extern mips_cps_bootcfg;
index af90e82f94bfb6c1a7cf4b3b616d3d5709bb662a..c7879fbe9f5b8b4234ae2471d7a135e8dfe68cb9 100644 (file)
@@ -260,6 +260,12 @@ static struct plat_smp_ops cps_smp_ops = {
        .cpus_done              = cps_cpus_done,
 };
 
+bool mips_cps_smp_in_use(void)
+{
+       extern struct plat_smp_ops *mp_ops;
+       return mp_ops == &cps_smp_ops;
+}
+
 int register_cps_smp_ops(void)
 {
        if (!mips_cm_present()) {