]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - arch/mips/include/asm/mach-netlogic/multi-node.h
MIPS: Netlogic: Add cpu to node mapping for XLP9XX
[linux.git] / arch / mips / include / asm / mach-netlogic / multi-node.h
index df9869d13afda8b62a0d4621f56812ca8307fae8..9ed8dacdc37c5aa3bae8bbfc4e31cf5c6b51bed6 100644 (file)
 #endif
 #endif
 
-#define NLM_CORES_PER_NODE     8
 #define NLM_THREADS_PER_CORE   4
-#define NLM_CPUS_PER_NODE      (NLM_CORES_PER_NODE * NLM_THREADS_PER_CORE)
+#ifdef CONFIG_CPU_XLR
+#define nlm_cores_per_node()   8
+#else
+extern unsigned int xlp_cores_per_node;
+#define nlm_cores_per_node()   xlp_cores_per_node
+#endif
+
+#define nlm_threads_per_node() (nlm_cores_per_node() * NLM_THREADS_PER_CORE)
+#define nlm_cpuid_to_node(c)   ((c) / nlm_threads_per_node())
 
 struct nlm_soc_info {
        unsigned long   coremask;       /* cores enabled on the soc */