aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/mm/numa.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/ia64/mm/numa.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/ia64/mm/numa.c')
-rw-r--r--arch/ia64/mm/numa.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/arch/ia64/mm/numa.c b/arch/ia64/mm/numa.c
new file mode 100644
index 000000000000..77118bbf3d8b
--- /dev/null
+++ b/arch/ia64/mm/numa.c
@@ -0,0 +1,49 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * This file contains NUMA specific variables and functions which can
7 * be split away from DISCONTIGMEM and are used on NUMA machines with
8 * contiguous memory.
9 *
10 * 2002/08/07 Erich Focht <efocht@ess.nec.de>
11 */
12
13#include <linux/config.h>
14#include <linux/cpu.h>
15#include <linux/kernel.h>
16#include <linux/mm.h>
17#include <linux/node.h>
18#include <linux/init.h>
19#include <linux/bootmem.h>
20#include <asm/mmzone.h>
21#include <asm/numa.h>
22
23
24/*
25 * The following structures are usually initialized by ACPI or
26 * similar mechanisms and describe the NUMA characteristics of the machine.
27 */
28int num_node_memblks;
29struct node_memblk_s node_memblk[NR_NODE_MEMBLKS];
30struct node_cpuid_s node_cpuid[NR_CPUS];
31/*
32 * This is a matrix with "distances" between nodes, they should be
33 * proportional to the memory access latency ratios.
34 */
35u8 numa_slit[MAX_NUMNODES * MAX_NUMNODES];
36
37/* Identify which cnode a physical address resides on */
38int
39paddr_to_nid(unsigned long paddr)
40{
41 int i;
42
43 for (i = 0; i < num_node_memblks; i++)
44 if (paddr >= node_memblk[i].start_paddr &&
45 paddr < node_memblk[i].start_paddr + node_memblk[i].size)
46 break;
47
48 return (i < num_node_memblks) ? node_memblk[i].nid : (num_node_memblks ? -1 : 0);
49}