#ifdef CONFIG_POWER4 
#ifdef CONFIG_PPC64 
static int __init add_bridge(struct device_node *dev){	int len;	struct pci_controller *hose;#ifdef CONFIG_PPC32	struct reg_property *addr;#endif	char *disp_name;	int *bus_range;	int primary = 1;	DBG("Adding PCI host bridge %s\n", dev->full_name);#ifdef CONFIG_PPC32	/* XXX fix this */	addr = (struct reg_property *) get_property(dev, "reg", &len);	if (addr == NULL || len < sizeof(*addr)) {		printk(KERN_WARNING "Can't use %s: no address\n",		       dev->full_name);		return -ENODEV;	}#endif	bus_range = (int *) get_property(dev, "bus-range", &len);	if (bus_range == NULL || len < 2 * sizeof(int)) {		printk(KERN_WARNING "Can't get bus-range for %s, assume bus 0\n",			       dev->full_name);	}	hose = pcibios_alloc_controller();	if (!hose)		return -ENOMEM;	hose->arch_data = dev;	hose->first_busno = bus_range ? bus_range[0] : 0;	hose->last_busno = bus_range ? bus_range[1] : 0xff;	disp_name = NULL;#ifdef CONFIG_POWER4	if (device_is_compatible(dev, "u3-agp")) {		setup_u3_agp(hose);		disp_name = "U3-AGP";		primary = 0;	} else if (device_is_compatible(dev, "u3-ht")) {		setup_u3_ht(hose);		disp_name = "U3-HT";		primary = 1;	}	printk(KERN_INFO "Found %s PCI host bridge.  Firmware bus number: %d->%d\n",		disp_name, hose->first_busno, hose->last_busno);#else	if (device_is_compatible(dev, "uni-north")) {		primary = setup_uninorth(hose, addr);		disp_name = "UniNorth";	} else if (strcmp(dev->name, "pci") == 0) {		/* XXX assume this is a mpc106 (grackle) */		setup_grackle(hose);		disp_name = "Grackle (MPC106)";	} else if (strcmp(dev->name, "bandit") == 0) {		setup_bandit(hose, addr);		disp_name = "Bandit";	} else if (strcmp(dev->name, "chaos") == 0) {		setup_chaos(hose, addr);		disp_name = "Chaos";		primary = 0;	}	printk(KERN_INFO "Found %s PCI host bridge at 0x%08lx. Firmware bus number: %d->%d\n",		disp_name, addr->address, hose->first_busno, hose->last_busno);#endif	DBG(" ->Hose at 0x%p, cfg_addr=0x%p,cfg_data=0x%p\n",		hose, hose->cfg_addr, hose->cfg_data);	/* Interpret the "ranges" property */	/* This also maps the I/O region and sets isa_io/mem_base */	pci_process_bridge_OF_ranges(hose, dev, primary);	/* Fixup "bus-range" OF property */	fixup_bus_range(dev);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b5166cc252190be80465f3b4f050e4a0310f71af/pci.c/buggy/arch/powerpc/platforms/powermac/pci.c