#include <linux/nodemask.h>
#include <linux/cpu.h>
#include <linux/notifier.h>
+#include <linux/lmb.h>
+#include <linux/of.h>
#include <asm/sparsemem.h>
-#include <asm/lmb.h>
+#include <asm/prom.h>
#include <asm/system.h>
#include <asm/smp.h>
{
unsigned long long mem;
char *p = cmdline;
- static unsigned int fake_nid = 0;
- static unsigned long long curr_boundary = 0;
+ static unsigned int fake_nid;
+ static unsigned long long curr_boundary;
- *nid = fake_nid;
+ /*
+ * Modify node id, iff we started creating NUMA nodes
+ * We want to continue from where we left of the last time
+ */
+ if (fake_nid)
+ *nid = fake_nid;
+ /*
+ * In case there are no more arguments to parse, the
+ * node_id should be the same as the last fake node id
+ * (we've handled this above).
+ */
if (!p)
return 0;
nid = default_nid;
}
+ fake_numa_create_new_node(((start + lmb_size) >> PAGE_SHIFT),
+ &nid);
+ node_set_online(nid);
+
size = numa_enforce_memory_limit(start, lmb_size);
if (!size)
continue;
- fake_numa_create_new_node(((start + size) >> PAGE_SHIFT), &nid);
- node_set_online(nid);
-
add_active_range(nid, start >> PAGE_SHIFT,
(start >> PAGE_SHIFT) + (size >> PAGE_SHIFT));
}
if (nid < 0)
nid = default_nid;
+ fake_numa_create_new_node(((start + size) >> PAGE_SHIFT), &nid);
+ node_set_online(nid);
+
if (!(size = numa_enforce_memory_limit(start, size))) {
if (--ranges)
goto new_range;
continue;
}
- fake_numa_create_new_node(((start + size) >> PAGE_SHIFT), &nid);
- node_set_online(nid);
-
add_active_range(nid, start >> PAGE_SHIFT,
(start >> PAGE_SHIFT) + (size >> PAGE_SHIFT));
dbg("reserve_bootmem %lx %lx\n", physbase,
size);
reserve_bootmem_node(NODE_DATA(nid), physbase,
- size);
+ size, BOOTMEM_DEFAULT);
}
}