return (void __iomem *)pci_resource_start(pdev, PCI_ROM_RESOURCE); 
return (void __iomem *)pci_resource_start(pdev, PCI_ROM_RESOURCE); 
void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size){	struct resource *res = &pdev->resource[PCI_ROM_RESOURCE];	loff_t start;	void __iomem *rom;	void __iomem *image;	int last_image;	/* IORESOURCE_ROM_SHADOW only set on x86 */	if (res->flags & IORESOURCE_ROM_SHADOW) {		/* primary video rom always starts here */		start = (loff_t)0xC0000;		*size = 0x20000; /* cover C000:0 through E000:0 */	} else {		if (res->flags & IORESOURCE_ROM_COPY) {			*size = pci_resource_len(pdev, PCI_ROM_RESOURCE);			return (void __iomem *)pci_resource_start(pdev, PCI_ROM_RESOURCE);		} else {			/* assign the ROM an address if it doesn't have one */			if (res->parent == NULL)				pci_assign_resource(pdev, PCI_ROM_RESOURCE);			start = pci_resource_start(pdev, PCI_ROM_RESOURCE);			*size = pci_resource_len(pdev, PCI_ROM_RESOURCE);			if (*size == 0)				return NULL;			/* Enable ROM space decodes */			pci_enable_rom(pdev);		}	}	rom = ioremap(start, *size);	if (!rom) {		/* restore enable if ioremap fails */		if (!(res->flags & (IORESOURCE_ROM_ENABLE |				    IORESOURCE_ROM_SHADOW |				    IORESOURCE_ROM_COPY)))			pci_disable_rom(pdev);		return NULL;	}	/*	 * Try to find the true size of the ROM since sometimes the PCI window	 * size is much larger than the actual size of the ROM.	 * True size is important if the ROM is going to be copied.	 */	image = rom;	do {		void __iomem *pds;		/* Standard PCI ROMs start out with these bytes 55 AA */		if (readb(image) != 0x55)			break;		if (readb(image + 1) != 0xAA)			break;		/* get the PCI data structure and check its signature */		pds = image + readw(image + 24);		if (readb(pds) != 'P')			break;		if (readb(pds + 1) != 'C')			break;		if (readb(pds + 2) != 'I')			break;		if (readb(pds + 3) != 'R')			break;		last_image = readb(pds + 21) & 0x80;		/* this length is reliable */		image += readw(pds + 16) * 512;	} while (!last_image);	/* never return a size larger than the PCI resource window */	/* there are known ROMs that get the size wrong */	*size = min((size_t)(image - rom), *size);	return rom;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/8085ce084c0f0144c353963853f81486fc331120/rom.c/buggy/drivers/pci/rom.c