aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel/numa.c
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2005-07-06 21:18:10 -0400
committerTony Luck <tony.luck@intel.com>2005-07-06 21:18:10 -0400
commit8d7e35174d02ce76e910365acaaefc281a0b72a0 (patch)
tree4445375bbf8c08f8032c5a013374777931949285 /arch/ia64/kernel/numa.c
parent564601a5d12f93fdde04c6bc5b097b95e7752a46 (diff)
[IA64] fix generic/up builds
Jesse Barnes provided the original version of this patch months ago, but other changes kept conflicting with it, so it got deferred. Greg Edwards dug it out of obscurity just over a week ago, and almost immediately another conflicting patch appeared (Bob Picco's memory-less nodes). I've resolved the conflicts and got it running again. CONFIG_SGI_TIOCX is set to "y" in defconfig, which causes a Tiger to not boot (oops in tiocx_init). But that can be resolved later ... get this in now before it gets stale again. Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/kernel/numa.c')
-rw-r--r--arch/ia64/kernel/numa.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/arch/ia64/kernel/numa.c b/arch/ia64/kernel/numa.c
new file mode 100644
index 000000000000..a68ce6678092
--- /dev/null
+++ b/arch/ia64/kernel/numa.c
@@ -0,0 +1,57 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15 *
16 * ia64 kernel NUMA specific stuff
17 *
18 * Copyright (C) 2002 Erich Focht <efocht@ess.nec.de>
19 * Copyright (C) 2004 Silicon Graphics, Inc.
20 * Jesse Barnes <jbarnes@sgi.com>
21 */
22#include <linux/config.h>
23#include <linux/topology.h>
24#include <linux/module.h>
25#include <asm/processor.h>
26#include <asm/smp.h>
27
28u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
29EXPORT_SYMBOL(cpu_to_node_map);
30
31cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
32
33/**
34 * build_cpu_to_node_map - setup cpu to node and node to cpumask arrays
35 *
36 * Build cpu to node mapping and initialize the per node cpu masks using
37 * info from the node_cpuid array handed to us by ACPI.
38 */
39void __init build_cpu_to_node_map(void)
40{
41 int cpu, i, node;
42
43 for(node=0; node < MAX_NUMNODES; node++)
44 cpus_clear(node_to_cpu_mask[node]);
45
46 for(cpu = 0; cpu < NR_CPUS; ++cpu) {
47 node = -1;
48 for (i = 0; i < NR_CPUS; ++i)
49 if (cpu_physical_id(cpu) == node_cpuid[i].phys_id) {
50 node = node_cpuid[i].nid;
51 break;
52 }
53 cpu_to_node_map[cpu] = (node >= 0) ? node : 0;
54 if (node >= 0)
55 cpu_set(cpu, node_to_cpu_mask[node]);
56 }
57}