static void __init pbm_register_toplevel_resources(struct pci_controller_info *p, struct pci_pbm_info *pbm) 
static void pbm_register_toplevel_resources(struct pci_controller_info *p, struct pci_pbm_info *pbm) 
static void __init pbm_register_toplevel_resources(struct pci_controller_info *p,						   struct pci_pbm_info *pbm){	char *name = pbm->name;	unsigned long ibase = p->pbm_A.controller_regs + SABRE_IOSPACE;	unsigned long mbase = p->pbm_A.controller_regs + SABRE_MEMSPACE;	unsigned int devfn;	unsigned long first, last, i;	u8 *addr, map;	sprintf(name, "SABRE%d PBM%c",		p->index,		(pbm == &p->pbm_A ? 'A' : 'B'));	pbm->io_space.name = pbm->mem_space.name = name;	devfn = PCI_DEVFN(1, (pbm == &p->pbm_A) ? 0 : 1);	addr = sabre_pci_config_mkaddr(pbm, 0, devfn, APB_IO_ADDRESS_MAP);	map = 0;	pci_config_read8(addr, &map);	first = 8;	last = 0;	for (i = 0; i < 8; i++) {		if ((map & (1 << i)) != 0) {			if (first > i)				first = i;			if (last < i)				last = i;		}	}	pbm->io_space.start = ibase + (first << 21UL);	pbm->io_space.end   = ibase + (last << 21UL) + ((1 << 21UL) - 1);	pbm->io_space.flags = IORESOURCE_IO;	addr = sabre_pci_config_mkaddr(pbm, 0, devfn, APB_MEM_ADDRESS_MAP);	map = 0;	pci_config_read8(addr, &map);	first = 8;	last = 0;	for (i = 0; i < 8; i++) {		if ((map & (1 << i)) != 0) {			if (first > i)				first = i;			if (last < i)				last = i;		}	}	pbm->mem_space.start = mbase + (first << 29UL);	pbm->mem_space.end   = mbase + (last << 29UL) + ((1 << 29UL) - 1);	pbm->mem_space.flags = IORESOURCE_MEM;	if (request_resource(&ioport_resource, &pbm->io_space) < 0) {		prom_printf("Cannot register PBM-%c's IO space.\n",			    (pbm == &p->pbm_A ? 'A' : 'B'));		prom_halt();	}	if (request_resource(&iomem_resource, &pbm->mem_space) < 0) {		prom_printf("Cannot register PBM-%c's MEM space.\n",			    (pbm == &p->pbm_A ? 'A' : 'B'));		prom_halt();	}	/* Register legacy regions if this PBM covers that area. */	if (pbm->io_space.start == ibase &&	    pbm->mem_space.start == mbase)		pci_register_legacy_regions(&pbm->io_space,					    &pbm->mem_space);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/085ae41f66657a9655ce832b0a61832a06f0e1dc/pci_sabre.c/buggy/arch/sparc64/kernel/pci_sabre.c