On 04/12/2010 09:23 PM, Benjamin Herrenschmidt wrote:
the whole function
#ifdef CONFIG_HAVE_LMB
u64 __init find_memory_core_early(int nid, u64 size, u64 align,
u64 goal, u64 limit)
{
int i;
/* Need to go over early_node_map to find out good range for node */
for_each_active_range_index_in_nid(i, nid) {
u64 addr;
u64 ei_start, ei_last;
ei_last = early_node_map[i].end_pfn;
ei_last <<= PAGE_SHIFT;
ei_start = early_node_map[i].start_pfn;
ei_start <<= PAGE_SHIFT;
addr = __lmb_find_area(ei_start, ei_last,
goal, limit, size, align);
if (addr == -1ULL)
continue;
return addr;
}
return -1ULL;
}
#endif
need to access early_node_map[], so leave the function here.
if you insist, could move it to lmb.c and use work_with_active_regions() around it.
YH
--