ia64/xen-unstable

view xen/include/asm-x86/numa.h @ 19848:5839491bbf20

[IA64] replace MAX_VCPUS with d->max_vcpus where necessary.

don't use MAX_VCPUS, and use vcpu::max_vcpus.
The changeset of 2f9e1348aa98 introduced max_vcpus to allow more vcpus
per guest. This patch is ia64 counter part.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Mon Jun 29 11:26:05 2009 +0900 (2009-06-29)
parents 89e50c449307
children
line source
1 #ifndef _ASM_X8664_NUMA_H
2 #define _ASM_X8664_NUMA_H 1
4 #include <xen/cpumask.h>
6 #define NODES_SHIFT 6
8 extern int srat_rev;
10 extern unsigned char cpu_to_node[];
11 extern cpumask_t node_to_cpumask[];
13 #define cpu_to_node(cpu) (cpu_to_node[cpu])
14 #define parent_node(node) (node)
15 #define node_to_first_cpu(node) (__ffs(node_to_cpumask[node]))
16 #define node_to_cpumask(node) (node_to_cpumask[node])
18 struct node {
19 u64 start,end;
20 };
22 extern int compute_hash_shift(struct node *nodes, int numnodes);
23 extern int pxm_to_node(int nid);
25 #define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT))
26 #define VIRTUAL_BUG_ON(x)
27 #define NODEMAPSIZE 0xfff
29 extern void numa_add_cpu(int cpu);
30 extern void numa_init_array(void);
31 extern int numa_off;
33 extern void numa_set_node(int cpu, int node);
35 extern void setup_node_bootmem(int nodeid, u64 start, u64 end);
36 extern unsigned char apicid_to_node[256];
37 #ifdef CONFIG_NUMA
38 extern void __init init_cpu_to_node(void);
40 static inline void clear_node_cpumask(int cpu)
41 {
42 cpu_clear(cpu, node_to_cpumask[cpu_to_node(cpu)]);
43 }
45 /* Simple perfect hash to map physical addresses to node numbers */
46 extern int memnode_shift;
47 extern u8 memnodemap[NODEMAPSIZE];
49 struct node_data {
50 unsigned long node_start_pfn;
51 unsigned long node_spanned_pages;
52 unsigned int node_id;
53 };
55 extern struct node_data node_data[];
57 static inline __attribute__((pure)) int phys_to_nid(paddr_t addr)
58 {
59 unsigned nid;
60 VIRTUAL_BUG_ON((addr >> memnode_shift) >= NODEMAPSIZE);
61 nid = memnodemap[addr >> memnode_shift];
62 VIRTUAL_BUG_ON(nid >= MAX_NUMNODES || !node_data[nid]);
63 return nid;
64 }
66 #define NODE_DATA(nid) (&(node_data[nid]))
68 #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
69 #define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \
70 NODE_DATA(nid)->node_spanned_pages)
73 #else
74 #define init_cpu_to_node() do {} while (0)
75 #define clear_node_cpumask(cpu) do {} while (0)
76 #endif
79 #endif