virq = virt_irq_create_mapping(irq[0]); 
static int __devinit finish_node_interrupts(struct device_node *np,					    unsigned long *mem_start,					    int measure_only){	unsigned int *ints;	int intlen, intrcells, intrcount;	int i, j, n;	unsigned int *irq, virq;	struct device_node *ic;	if (num_interrupt_controllers == 0) {		/*		 * Old machines just have a list of interrupt numbers		 * and no interrupt-controller nodes.		 */		ints = (unsigned int *) get_property(np, "AAPL,interrupts",						     &intlen);		/* XXX old interpret_pci_props looked in parent too */		/* XXX old interpret_macio_props looked for interrupts		   before AAPL,interrupts */		if (ints == NULL)			ints = (unsigned int *) get_property(np, "interrupts",							     &intlen);		if (ints == NULL)			return 0;		np->n_intrs = intlen / sizeof(unsigned int);		np->intrs = prom_alloc(np->n_intrs * sizeof(np->intrs[0]),				       mem_start);		if (!np->intrs)			return -ENOMEM;		if (measure_only)			return 0;		for (i = 0; i < np->n_intrs; ++i) {			np->intrs[i].line = *ints++;			np->intrs[i].sense = 1;		}		return 0;	}	ints = (unsigned int *) get_property(np, "interrupts", &intlen);	if (ints == NULL)		return 0;	intrcells = prom_n_intr_cells(np);	intlen /= intrcells * sizeof(unsigned int);	np->intrs = prom_alloc(intlen * sizeof(*(np->intrs)), mem_start);	if (!np->intrs)		return -ENOMEM;	if (measure_only)		return 0;	intrcount = 0;	for (i = 0; i < intlen; ++i, ints += intrcells) {		n = map_interrupt(&irq, &ic, np, ints, intrcells);		if (n <= 0)			continue;		/* don't map IRQ numbers under a cascaded 8259 controller */		if (ic && device_is_compatible(ic, "chrp,iic")) {			np->intrs[intrcount].line = irq[0];		} else {#ifdef CONFIG_PPC64			virq = virt_irq_create_mapping(irq[0]);			if (virq == NO_IRQ) {				printk(KERN_CRIT "Could not allocate interrupt"				       " number for %s\n", np->full_name);				continue;			}			virq = irq_offset_up(virq);#else			virq = irq[0];#endif			np->intrs[intrcount].line = virq;		}#ifdef CONFIG_PPC64		/* We offset irq numbers for the u3 MPIC by 128 in PowerMac */		if (systemcfg->platform == PLATFORM_POWERMAC && ic && ic->parent) {			char *name = get_property(ic->parent, "name", NULL);			if (name && !strcmp(name, "u3"))				np->intrs[intrcount].line += 128;			else if (!(name && !strcmp(name, "mac-io")))				/* ignore other cascaded controllers, such as				   the k2-sata-root */				break;		}#endif		np->intrs[intrcount].sense = 1;		if (n > 1)			np->intrs[intrcount].sense = irq[1];		if (n > 2) {			printk("hmmm, got %d intr cells for %s:", n,			       np->full_name);			for (j = 0; j < n; ++j)				printk(" %d", irq[j]);			printk("\n");		}		++intrcount;	}	np->n_intrs = intrcount;	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/6d0124fc06be40deafca043c73a8203c78bbfe45/prom.c/buggy/arch/powerpc/kernel/prom.c