Revert to Fedora kernel-2.6.17-1.2187_FC5 patched with vs2.0.2.1; there are too many...
[linux-2.6.git] / arch / mips / mips-boards / sim / sim_smp.c
index cb47863..b7084e7 100644 (file)
@@ -18,6 +18,7 @@
 /*
  * Simulator Platform-specific hooks for SMP operation
  */
+#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/cpumask.h>
@@ -49,6 +50,27 @@ void core_send_ipi(int cpu, unsigned int action)
 
 }
 
+/*
+ * Detect available CPUs/VPEs/TCs and populate phys_cpu_present_map
+ */
+
+void __init prom_build_cpu_map(void)
+{
+#ifdef CONFIG_MIPS_MT_SMTC
+       int nextslot;
+
+       /*
+        * As of November, 2004, MIPSsim only simulates one core
+        * at a time.  However, that core may be a MIPS MT core
+        * with multiple virtual processors and thread contexts.
+        */
+
+       if (read_c0_config3() & (1<<2)) {
+               nextslot = mipsmt_build_cpu_map(1);
+       }
+#endif /* CONFIG_MIPS_MT_SMTC */
+}
+
 /*
  * Platform "CPU" startup hook
  */