Linux-2.6.12-rc2
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / include / asm-ia64 / numa.h
blob3ae128fe08231a43e2e548e1105a0de0432b250a
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.
6 * This file contains NUMA specific prototypes and definitions.
8 * 2002/08/05 Erich Focht <efocht@ess.nec.de>
11 #ifndef _ASM_IA64_NUMA_H
12 #define _ASM_IA64_NUMA_H
14 #include <linux/config.h>
16 #ifdef CONFIG_NUMA
18 #include <linux/cache.h>
19 #include <linux/cpumask.h>
20 #include <linux/numa.h>
21 #include <linux/smp.h>
22 #include <linux/threads.h>
24 #include <asm/mmzone.h>
26 extern u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
27 extern cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
29 /* Stuff below this line could be architecture independent */
31 extern int num_node_memblks; /* total number of memory chunks */
34 * List of node memory chunks. Filled when parsing SRAT table to
35 * obtain information about memory nodes.
38 struct node_memblk_s {
39 unsigned long start_paddr;
40 unsigned long size;
41 int nid; /* which logical node contains this chunk? */
42 int bank; /* which mem bank on this node */
45 struct node_cpuid_s {
46 u16 phys_id; /* id << 8 | eid */
47 int nid; /* logical node containing this CPU */
50 extern struct node_memblk_s node_memblk[NR_NODE_MEMBLKS];
51 extern struct node_cpuid_s node_cpuid[NR_CPUS];
54 * ACPI 2.0 SLIT (System Locality Information Table)
55 * http://devresource.hp.com/devresource/Docs/TechPapers/IA64/slit.pdf
57 * This is a matrix with "distances" between nodes, they should be
58 * proportional to the memory access latency ratios.
61 extern u8 numa_slit[MAX_NUMNODES * MAX_NUMNODES];
62 #define node_distance(from,to) (numa_slit[(from) * num_online_nodes() + (to)])
64 extern int paddr_to_nid(unsigned long paddr);
66 #define local_nodeid (cpu_to_node_map[smp_processor_id()])
68 #else /* !CONFIG_NUMA */
70 #define paddr_to_nid(addr) 0
72 #endif /* CONFIG_NUMA */
74 #endif /* _ASM_IA64_NUMA_H */