debuggers.hg

view xen/arch/ia64/linux/numa.c @ 17977:11318234588e

[IA64] remove some #ifndef XEN using empty headerfiles.

move mm_numa.c from linux-xen to linux because now mm_numa.c is
identical to linux files.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Thu Jun 19 12:48:04 2008 +0900 (2008-06-19)
parents
children
line source
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 */
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>
24 /*
25 * The following structures are usually initialized by ACPI or
26 * similar mechanisms and describe the NUMA characteristics of the machine.
27 */
28 int num_node_memblks;
29 struct node_memblk_s node_memblk[NR_NODE_MEMBLKS];
30 struct 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 */
35 u8 numa_slit[MAX_NUMNODES * MAX_NUMNODES];
37 /* Identify which cnode a physical address resides on */
38 int
39 paddr_to_nid(unsigned long paddr)
40 {
41 int i;
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;
48 return (i < num_node_memblks) ? node_memblk[i].nid : (num_node_memblks ? -1 : 0);
49 }