x86-64, NUMA: Factor out memblk handling into numa_{add|register}_memblk()
[pandora-kernel.git] / arch / x86 / include / asm / numa_64.h
1 #ifndef _ASM_X86_NUMA_64_H
2 #define _ASM_X86_NUMA_64_H
3
4 #include <linux/nodemask.h>
5
6 struct bootnode {
7         u64 start;
8         u64 end;
9 };
10
11 extern int compute_hash_shift(struct bootnode *nodes, int numblks,
12                               int *nodeids);
13
14 #define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT))
15
16 extern int numa_off;
17
18 extern unsigned long numa_free_all_bootmem(void);
19 extern void setup_node_bootmem(int nodeid, unsigned long start,
20                                unsigned long end);
21
22 #ifdef CONFIG_NUMA
23 /*
24  * Too small node sizes may confuse the VM badly. Usually they
25  * result from BIOS bugs. So dont recognize nodes as standalone
26  * NUMA entities that have less than this amount of RAM listed:
27  */
28 #define NODE_MIN_SIZE (4*1024*1024)
29
30 extern nodemask_t cpu_nodes_parsed __initdata;
31 extern nodemask_t mem_nodes_parsed __initdata;
32 extern struct bootnode numa_nodes[MAX_NUMNODES] __initdata;
33
34 extern int __cpuinit numa_cpu_node(int cpu);
35 extern int __init numa_add_memblk(int nodeid, u64 start, u64 end);
36 extern int __init numa_register_memblks(void);
37
38 #ifdef CONFIG_NUMA_EMU
39 #define FAKE_NODE_MIN_SIZE      ((u64)32 << 20)
40 #define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL))
41 void numa_emu_cmdline(char *);
42 #endif /* CONFIG_NUMA_EMU */
43 #else
44 static inline int numa_cpu_node(int cpu)                { return NUMA_NO_NODE; }
45 #endif
46
47 #endif /* _ASM_X86_NUMA_64_H */