u8 pxm_to_nid_map[MAX_PXM_DOMAINS];/* _PXM to logical node ID map */ 
static int __init acpi20_parse_srat(struct acpi_table_srat *sratp){	u8 *start, *end, *p;	int i, j, nid;	u8 pxm_to_nid_map[MAX_PXM_DOMAINS];/* _PXM to logical node ID map */	u8 nid_to_pxm_map[MAX_NUMNODES];/* logical node ID to _PXM map */	start = (u8 *)(&(sratp->reserved) + 1);	/* skip header */	p = start;	end = (u8 *)sratp + sratp->header.length;	memset(pxm_bitmap, 0, sizeof(pxm_bitmap));	/* init proximity domain bitmap */	memset(node_memory_chunk, 0, sizeof(node_memory_chunk));	memset(zholes_size, 0, sizeof(zholes_size));	/* -1 in these maps means not available */	memset(pxm_to_nid_map, -1, sizeof(pxm_to_nid_map));	memset(nid_to_pxm_map, -1, sizeof(nid_to_pxm_map));	num_memory_chunks = 0;	while (p < end) {		switch (*p) {		case ACPI_SRAT_PROCESSOR_AFFINITY:			parse_cpu_affinity_structure(p);			break;		case ACPI_SRAT_MEMORY_AFFINITY:			parse_memory_affinity_structure(p);			break;		default:			printk("ACPI 2.0 SRAT: unknown entry skipped: type=0x%02X, len=%d\n", p[0], p[1]);			break;		}		p += p[1];		if (p[1] == 0) {			printk("acpi20_parse_srat: Entry length value is zero;"				" can't parse any further!\n");			break;		}	}	if (num_memory_chunks == 0) {		printk("could not finy any ACPI SRAT memory areas.\n");		goto out_fail;	}	/* Calculate total number of nodes in system from PXM bitmap and create	 * a set of sequential node IDs starting at zero.  (ACPI doesn't seem	 * to specify the range of _PXM values.)	 */	/*	 * MCD - we no longer HAVE to number nodes sequentially.  PXM domain	 * numbers could go as high as 256, and MAX_NUMNODES for i386 is typically	 * 32, so we will continue numbering them in this manner until MAX_NUMNODES	 * approaches MAX_PXM_DOMAINS for i386.	 */	nodes_clear(node_online_map);	for (i = 0; i < MAX_PXM_DOMAINS; i++) {		if (BMAP_TEST(pxm_bitmap, i)) {			nid = num_online_nodes();			pxm_to_nid_map[i] = nid;			nid_to_pxm_map[nid] = i;			node_set_online(nid);		}	}	BUG_ON(num_online_nodes() == 0);	/* set cnode id in memory chunk structure */	for (i = 0; i < num_memory_chunks; i++)		node_memory_chunk[i].nid = pxm_to_nid_map[node_memory_chunk[i].pxm];	printk("pxm bitmap: ");	for (i = 0; i < sizeof(pxm_bitmap); i++) {		printk("%02X ", pxm_bitmap[i]);	}	printk("\n");	printk("Number of logical nodes in system = %d\n", num_online_nodes());	printk("Number of memory chunks in system = %d\n", num_memory_chunks);	for (j = 0; j < num_memory_chunks; j++){		struct node_memory_chunk_s * chunk = &node_memory_chunk[j];		printk("chunk %d nid %d start_pfn %08lx end_pfn %08lx\n",		       j, chunk->nid, chunk->start_pfn, chunk->end_pfn);		node_read_chunk(chunk->nid, chunk);	} 	for_each_online_node(nid) {		unsigned long start = node_start_pfn[nid];		unsigned long end = node_end_pfn[nid];		memory_present(nid, start, end);		node_remap_size[nid] = node_memmap_size_bytes(nid, start, end);	}	return 1;out_fail:	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/69e1a33f62eff9b228a8cc2c3e4429dbee8966c9/srat.c/buggy/arch/i386/kernel/srat.c