int segment = 0; 
int segment = pci_domain_nr(dev->bus); 
void sn_pci_fixup_slot(struct pci_dev *dev){	int idx;	int segment = 0;	int status = 0;	struct pcibus_bussoft *bs; 	struct pci_bus *host_pci_bus; 	struct pci_dev *host_pci_dev; 	struct sn_irq_info *sn_irq_info; 	unsigned long size; 	unsigned int bus_no, devfn;	pci_dev_get(dev); /* for the sysdata pointer */	dev->sysdata = kmalloc(sizeof(struct pcidev_info), GFP_KERNEL);	if (SN_PCIDEV_INFO(dev) <= 0)		BUG();		/* Cannot afford to run out of memory */	memset(SN_PCIDEV_INFO(dev), 0, sizeof(struct pcidev_info));	sn_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_KERNEL);	if (sn_irq_info <= 0)		BUG();		/* Cannot afford to run out of memory */	memset(sn_irq_info, 0, sizeof(struct sn_irq_info));	/* Call to retrieve pci device information needed by kernel. */	status = sal_get_pcidev_info((u64) segment, (u64) dev->bus->number, 				     dev->devfn,				     (u64) __pa(SN_PCIDEV_INFO(dev)),				     (u64) __pa(sn_irq_info));	if (status)		BUG(); /* Cannot get platform pci device information */	/* Copy over PIO Mapped Addresses */	for (idx = 0; idx <= PCI_ROM_RESOURCE; idx++) {		unsigned long start, end, addr;		if (!SN_PCIDEV_INFO(dev)->pdi_pio_mapped_addr[idx])			continue;		start = dev->resource[idx].start;		end = dev->resource[idx].end;		size = end - start;		addr = SN_PCIDEV_INFO(dev)->pdi_pio_mapped_addr[idx];		addr = ((addr << 4) >> 4) | __IA64_UNCACHED_OFFSET;		dev->resource[idx].start = addr;		dev->resource[idx].end = addr + size;		if (dev->resource[idx].flags & IORESOURCE_IO)			dev->resource[idx].parent = &ioport_resource;		else			dev->resource[idx].parent = &iomem_resource;	}	/*	 * Using the PROMs values for the PCI host bus, get the Linux 	 * PCI host_pci_dev struct and set up host bus linkages 	 */ 	bus_no = SN_PCIDEV_INFO(dev)->pdi_slot_host_handle >> 32; 	devfn = SN_PCIDEV_INFO(dev)->pdi_slot_host_handle & 0xffffffff; 	host_pci_bus = pci_find_bus(pci_domain_nr(dev->bus), bus_no); 	host_pci_dev = pci_get_slot(host_pci_bus, devfn);	SN_PCIDEV_INFO(dev)->host_pci_dev = host_pci_dev;	SN_PCIDEV_INFO(dev)->pdi_host_pcidev_info =	    					SN_PCIDEV_INFO(host_pci_dev);	SN_PCIDEV_INFO(dev)->pdi_linux_pcidev = dev;	bs = SN_PCIBUS_BUSSOFT(dev->bus);	SN_PCIDEV_INFO(dev)->pdi_pcibus_info = bs;	if (bs && bs->bs_asic_type < PCIIO_ASIC_MAX_TYPES) {		SN_PCIDEV_BUSPROVIDER(dev) = sn_pci_provider[bs->bs_asic_type];	} else {		SN_PCIDEV_BUSPROVIDER(dev) = &sn_pci_default_provider;	}	/* Only set up IRQ stuff if this device has a host bus context */	if (bs && sn_irq_info->irq_irq) {		SN_PCIDEV_INFO(dev)->pdi_sn_irq_info = sn_irq_info;		dev->irq = SN_PCIDEV_INFO(dev)->pdi_sn_irq_info->irq_irq;		sn_irq_fixup(dev, sn_irq_info);	} else {		SN_PCIDEV_INFO(dev)->pdi_sn_irq_info = NULL;		kfree(sn_irq_info);	}}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/674c6479b7bdc78528ea83dd43897e3161558b8b/io_init.c/buggy/arch/ia64/sn/kernel/io_init.c