0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #include <linux/kernel.h>
0011 #include <linux/mmzone.h>
0012 #include <linux/cpumask.h>
0013 #include <linux/memblock.h>
0014 #include <linux/node.h>
0015 #include <asm/numa.h>
0016
0017 struct pglist_data *node_data[MAX_NUMNODES];
0018 EXPORT_SYMBOL(node_data);
0019
0020 void __init numa_setup(void)
0021 {
0022 int nid;
0023
0024 nodes_clear(node_possible_map);
0025 node_set(0, node_possible_map);
0026 node_set_online(0);
0027 for (nid = 0; nid < MAX_NUMNODES; nid++) {
0028 NODE_DATA(nid) = memblock_alloc(sizeof(pg_data_t), 8);
0029 if (!NODE_DATA(nid))
0030 panic("%s: Failed to allocate %zu bytes align=0x%x\n",
0031 __func__, sizeof(pg_data_t), 8);
0032 }
0033 NODE_DATA(0)->node_spanned_pages = memblock_end_of_DRAM() >> PAGE_SHIFT;
0034 NODE_DATA(0)->node_id = 0;
0035 }