summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/mips64/sgi-ip27/ip27-init.c32
-rw-r--r--arch/mips64/sgi-ip27/ip27-klconfig.c13
2 files changed, 32 insertions, 13 deletions
diff --git a/arch/mips64/sgi-ip27/ip27-init.c b/arch/mips64/sgi-ip27/ip27-init.c
index 1c4caad15..64b4d5236 100644
--- a/arch/mips64/sgi-ip27/ip27-init.c
+++ b/arch/mips64/sgi-ip27/ip27-init.c
@@ -15,6 +15,8 @@
#include <asm/processor.h>
#include <asm/sn/launch.h>
+#define CPU_NONE (cpuid_t)-1
+
#define CPUMASK_CLRALL(p) (p) = 0
#define CPUMASK_SETB(p, bit) (p) |= 1 << (bit)
#define CPUMASK_CLRB(p, bit) (p) &= ~(1ULL << (bit))
@@ -144,6 +146,35 @@ cpuid_t cpu_node_probe(cpumask_t *boot_cpumask, int *numnodes)
return(highest + 1);
}
+void alloc_cpupda(int i)
+{
+ cnodeid_t node;
+ nasid_t nasid;
+
+ node = get_cpu_cnode(i);
+ nasid = COMPACT_TO_NASID_NODEID(node);
+
+ cputonasid(i) = nasid;
+ cputocnode(i) = node;
+ cputoslice(i) = get_cpu_slice(i);
+}
+
+int cpu_enabled(cpuid_t cpu)
+{
+ if (cpu == CPU_NONE)
+ return 0;
+ return (CPUMASK_TSTB(boot_cpumask, cpu) != 0);
+}
+
+void initpdas(void)
+{
+ cpuid_t i;
+
+ for (i = 0; i < maxcpus; i++)
+ if (cpu_enabled(i))
+ alloc_cpupda(i);
+}
+
void mlreset (void)
{
int i;
@@ -156,6 +187,7 @@ void mlreset (void)
*/
CPUMASK_CLRALL(boot_cpumask);
maxcpus = cpu_node_probe(&boot_cpumask, &numnodes);
+ initpdas();
gen_region_mask(&region_mask, numnodes);
diff --git a/arch/mips64/sgi-ip27/ip27-klconfig.c b/arch/mips64/sgi-ip27/ip27-klconfig.c
index e1ca1e19a..fac7c9dfa 100644
--- a/arch/mips64/sgi-ip27/ip27-klconfig.c
+++ b/arch/mips64/sgi-ip27/ip27-klconfig.c
@@ -121,16 +121,3 @@ int get_cpu_slice(cpuid_t cpu)
return -1;
return acpu->cpu_info.physid;
}
-
-void alloc_cpupda(int i)
-{
- cnodeid_t node;
- nasid_t nasid;
-
- node = get_cpu_cnode(i);
- nasid = COMPACT_TO_NASID_NODEID(node);
-
- cputonasid(i) = nasid;
- cputocnode(i) = node;
- cputoslice(i) = get_cpu_slice(i);
-}