start = _ALIGN_DOWN(start, MEMORY_INCREMENT); size = _ALIGN_UP(size, MEMORY_INCREMENT);  
static int __init parse_numa_properties(void){	struct device_node *cpu = NULL;	struct device_node *memory = NULL;	int addr_cells, size_cells;	int max_domain = 0;	long entries = lmb_end_of_DRAM() >> MEMORY_INCREMENT_SHIFT;	unsigned long i;	if (numa_enabled == 0) {		printk(KERN_WARNING "NUMA disabled by user\n");		return -1;	}	numa_memory_lookup_table =		(char *)abs_to_virt(lmb_alloc(entries * sizeof(char), 1));	memset(numa_memory_lookup_table, 0, entries * sizeof(char));	for (i = 0; i < entries ; i++)		numa_memory_lookup_table[i] = ARRAY_INITIALISER;	min_common_depth = find_min_common_depth();	dbg("NUMA associativity depth for CPU/Memory: %d\n", min_common_depth);	if (min_common_depth < 0)		return min_common_depth;	max_domain = numa_setup_cpu(boot_cpuid);	/*	 * Even though we connect cpus to numa domains later in SMP init,	 * we need to know the maximum node id now. This is because each	 * node id must have NODE_DATA etc backing it.	 * As a result of hotplug we could still have cpus appear later on	 * with larger node ids. In that case we force the cpu into node 0.	 */	for_each_cpu(i) {		int numa_domain;		cpu = find_cpu_node(i);		if (cpu) {			numa_domain = of_node_numa_domain(cpu);			of_node_put(cpu);			if (numa_domain < MAX_NUMNODES &&			    max_domain < numa_domain)				max_domain = numa_domain;		}	}	addr_cells = get_mem_addr_cells();	size_cells = get_mem_size_cells();	memory = NULL;	while ((memory = of_find_node_by_type(memory, "memory")) != NULL) {		unsigned long start;		unsigned long size;		int numa_domain;		int ranges;		unsigned int *memcell_buf;		unsigned int len;		memcell_buf = (unsigned int *)get_property(memory, "reg", &len);		if (!memcell_buf || len <= 0)			continue;		ranges = memory->n_addrs;new_range:		/* these are order-sensitive, and modify the buffer pointer */		start = read_n_cells(addr_cells, &memcell_buf);		size = read_n_cells(size_cells, &memcell_buf);		start = _ALIGN_DOWN(start, MEMORY_INCREMENT);		size = _ALIGN_UP(size, MEMORY_INCREMENT);		numa_domain = of_node_numa_domain(memory);		if (numa_domain >= MAX_NUMNODES) {			if (numa_domain != 0xffff)				printk(KERN_ERR "WARNING: memory at %lx maps "				       "to invalid NUMA node %d\n", start,				       numa_domain);			numa_domain = 0;		}		if (max_domain < numa_domain)			max_domain = numa_domain;		if (! (size = numa_enforce_memory_limit(start, size))) {			if (--ranges)				goto new_range;			else				continue;		}		/*		 * Initialize new node struct, or add to an existing one.		 */		if (init_node_data[numa_domain].node_end_pfn) {			if ((start / PAGE_SIZE) <			    init_node_data[numa_domain].node_start_pfn)				init_node_data[numa_domain].node_start_pfn =					start / PAGE_SIZE;			if (((start / PAGE_SIZE) + (size / PAGE_SIZE)) >			    init_node_data[numa_domain].node_end_pfn)				init_node_data[numa_domain].node_end_pfn =					(start / PAGE_SIZE) +					(size / PAGE_SIZE);			init_node_data[numa_domain].node_present_pages +=				size / PAGE_SIZE;		} else {			node_set_online(numa_domain);			init_node_data[numa_domain].node_start_pfn =				start / PAGE_SIZE;			init_node_data[numa_domain].node_end_pfn =				init_node_data[numa_domain].node_start_pfn +				size / PAGE_SIZE;			init_node_data[numa_domain].node_present_pages =				size / PAGE_SIZE;		}		for (i = start ; i < (start+size); i += MEMORY_INCREMENT)			numa_memory_lookup_table[i >> MEMORY_INCREMENT_SHIFT] =				numa_domain;		if (--ranges)			goto new_range;	}	for (i = 0; i <= max_domain; i++)		node_set_online(i);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/45fb6cea09443b2066016f895937f9c2647a1507/numa.c/clean/arch/powerpc/mm/numa.c