xics_8259_pic.end = i8259_pic.end; 
void xics_init_IRQ(void){	int i;	unsigned long intr_size = 0;	struct device_node *np;	uint *ireg, ilen, indx = 0;	unsigned long intr_base = 0;	struct xics_interrupt_node {		unsigned long addr;		unsigned long size;	} intnodes[NR_CPUS];	ppc64_boot_msg(0x20, "XICS Init");	ibm_get_xive = rtas_token("ibm,get-xive");	ibm_set_xive = rtas_token("ibm,set-xive");	ibm_int_on  = rtas_token("ibm,int-on");	ibm_int_off = rtas_token("ibm,int-off");	np = of_find_node_by_type(NULL, "PowerPC-External-Interrupt-Presentation");	if (!np)		panic("xics_init_IRQ: can't find interrupt presentation");nextnode:	ireg = (uint *)get_property(np, "ibm,interrupt-server-ranges", NULL);	if (ireg) {		/*		 * set node starting index for this node		 */		indx = *ireg;	}	ireg = (uint *)get_property(np, "reg", &ilen);	if (!ireg)		panic("xics_init_IRQ: can't find interrupt reg property");	while (ilen) {		intnodes[indx].addr = (unsigned long)*ireg++ << 32;		ilen -= sizeof(uint);		intnodes[indx].addr |= *ireg++;		ilen -= sizeof(uint);		intnodes[indx].size = (unsigned long)*ireg++ << 32;		ilen -= sizeof(uint);		intnodes[indx].size |= *ireg++;		ilen -= sizeof(uint);		indx++;		if (indx >= NR_CPUS) break;	}	np = of_find_node_by_type(np, "PowerPC-External-Interrupt-Presentation");	if ((indx < NR_CPUS) && np) goto nextnode;	/* Find the server numbers for the boot cpu. */	for (np = of_find_node_by_type(NULL, "cpu");	     np;	     np = of_find_node_by_type(np, "cpu")) {		ireg = (uint *)get_property(np, "reg", &ilen);		if (ireg && ireg[0] == boot_cpuid_phys) {			ireg = (uint *)get_property(np, "ibm,ppc-interrupt-gserver#s",						    &ilen);			i = ilen / sizeof(int);			if (ireg && i > 0) {				default_server = ireg[0];				default_distrib_server = ireg[i-1]; /* take last element */			}			ireg = (uint *)get_property(np,					"ibm,interrupt-server#-size", NULL);			if (ireg)				interrupt_server_size = *ireg;			break;		}	}	of_node_put(np);	intr_base = intnodes[0].addr;	intr_size = intnodes[0].size;	np = of_find_node_by_type(NULL, "interrupt-controller");	if (!np) {		printk(KERN_WARNING "xics: no ISA interrupt controller\n");		xics_irq_8259_cascade_real = -1;		xics_irq_8259_cascade = -1;	} else {		ireg = (uint *) get_property(np, "interrupts", NULL);		if (!ireg)			panic("xics_init_IRQ: can't find ISA interrupts property");		xics_irq_8259_cascade_real = *ireg;		xics_irq_8259_cascade			= virt_irq_create_mapping(xics_irq_8259_cascade_real);		of_node_put(np);	}	if (systemcfg->platform == PLATFORM_PSERIES) {#ifdef CONFIG_SMP		for_each_cpu(i) {			int hard_id;			/* FIXME: Do this dynamically! --RR */			if (!cpu_present(i))				continue;			hard_id = get_hard_smp_processor_id(i);			xics_per_cpu[i] = ioremap(intnodes[hard_id].addr,						  intnodes[hard_id].size);		}#else		xics_per_cpu[0] = ioremap(intr_base, intr_size);#endif /* CONFIG_SMP */	} else if (systemcfg->platform == PLATFORM_PSERIES_LPAR) {		ops = &pSeriesLP_ops;	}	xics_8259_pic.enable = i8259_pic.enable;	xics_8259_pic.disable = i8259_pic.disable;	for (i = 0; i < 16; ++i)		get_irq_desc(i)->handler = &xics_8259_pic;	for (; i < NR_IRQS; ++i)		get_irq_desc(i)->handler = &xics_pic;	xics_setup_cpu();	ppc64_boot_msg(0x21, "XICS Done");}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/d4be4f37d9d2a5afc8e79a95beafbac4b83f20c5/xics.c/clean/arch/powerpc/platforms/pseries/xics.c