bridge->seg = seg; 
static void add_p2p_bridge(acpi_handle *handle, int seg, int bus, int dev, int fn){	struct acpiphp_bridge *bridge;	u8 tmp8;	u16 tmp16;	u64 base64, limit64;	u32 base, limit, base32u, limit32u;	bridge = kmalloc(sizeof(struct acpiphp_bridge), GFP_KERNEL);	if (bridge == NULL) {		err("out of memory\n");		return;	}	memset(bridge, 0, sizeof(struct acpiphp_bridge));	bridge->type = BRIDGE_TYPE_P2P;	bridge->handle = handle;	bridge->seg = seg;	bridge->pci_dev = pci_find_slot(bus, PCI_DEVFN(dev, fn));	if (!bridge->pci_dev) {		err("Can't get pci_dev\n");		kfree(bridge);		return;	}	bridge->pci_bus = bridge->pci_dev->subordinate;	if (!bridge->pci_bus) {		err("This is not a PCI-to-PCI bridge!\n");		kfree(bridge);		return;	}	spin_lock_init(&bridge->res_lock);	bridge->bus = bridge->pci_bus->number;	bridge->sub = bridge->pci_bus->subordinate;	/*	 * decode resources under this P2P bridge	 */	/* I/O resources */	pci_read_config_byte(bridge->pci_dev, PCI_IO_BASE, &tmp8);	base = tmp8;	pci_read_config_byte(bridge->pci_dev, PCI_IO_LIMIT, &tmp8);	limit = tmp8;	switch (base & PCI_IO_RANGE_TYPE_MASK) {	case PCI_IO_RANGE_TYPE_16:		base = (base << 8) & 0xf000;		limit = ((limit << 8) & 0xf000) + 0xfff;		bridge->io_head = acpiphp_make_resource((u64)base, limit - base + 1);		if (!bridge->io_head) {			err("out of memory\n");			kfree(bridge);			return;		}		dbg("16bit I/O range: %04x-%04x\n",		    (u32)bridge->io_head->base,		    (u32)(bridge->io_head->base + bridge->io_head->length - 1));		break;	case PCI_IO_RANGE_TYPE_32:		pci_read_config_word(bridge->pci_dev, PCI_IO_BASE_UPPER16, &tmp16);		base = ((u32)tmp16 << 16) | ((base << 8) & 0xf000);		pci_read_config_word(bridge->pci_dev, PCI_IO_LIMIT_UPPER16, &tmp16);		limit = (((u32)tmp16 << 16) | ((limit << 8) & 0xf000)) + 0xfff;		bridge->io_head = acpiphp_make_resource((u64)base, limit - base + 1);		if (!bridge->io_head) {			err("out of memory\n");			kfree(bridge);			return;		}		dbg("32bit I/O range: %08x-%08x\n",		    (u32)bridge->io_head->base,		    (u32)(bridge->io_head->base + bridge->io_head->length - 1));		break;	case 0x0f:		dbg("I/O space unsupported\n");		break;	default:		warn("Unknown I/O range type\n");	}	/* Memory resources (mandatory for P2P bridge) */	pci_read_config_word(bridge->pci_dev, PCI_MEMORY_BASE, &tmp16);	base = (tmp16 & 0xfff0) << 16;	pci_read_config_word(bridge->pci_dev, PCI_MEMORY_LIMIT, &tmp16);	limit = ((tmp16 & 0xfff0) << 16) | 0xfffff;	bridge->mem_head = acpiphp_make_resource((u64)base, limit - base + 1);	if (!bridge->mem_head) {		err("out of memory\n");		kfree(bridge);		return;	}	dbg("32bit Memory range: %08x-%08x\n",	    (u32)bridge->mem_head->base,	    (u32)(bridge->mem_head->base + bridge->mem_head->length-1));	/* Prefetchable Memory resources (optional) */	pci_read_config_word(bridge->pci_dev, PCI_PREF_MEMORY_BASE, &tmp16);	base = tmp16;	pci_read_config_word(bridge->pci_dev, PCI_PREF_MEMORY_LIMIT, &tmp16);	limit = tmp16;	switch (base & PCI_MEMORY_RANGE_TYPE_MASK) {	case PCI_PREF_RANGE_TYPE_32:		base = (base & 0xfff0) << 16;		limit = ((limit & 0xfff0) << 16) | 0xfffff;		bridge->p_mem_head = acpiphp_make_resource((u64)base, limit - base + 1);		if (!bridge->p_mem_head) {			err("out of memory\n");			kfree(bridge);			return;		}		dbg("32bit Prefetchable memory range: %08x-%08x\n",		    (u32)bridge->p_mem_head->base,		    (u32)(bridge->p_mem_head->base + bridge->p_mem_head->length - 1));		break;	case PCI_PREF_RANGE_TYPE_64:		pci_read_config_dword(bridge->pci_dev, PCI_PREF_BASE_UPPER32, &base32u);		pci_read_config_dword(bridge->pci_dev, PCI_PREF_LIMIT_UPPER32, &limit32u);		base64 = ((u64)base32u << 32) | ((base & 0xfff0) << 16);		limit64 = (((u64)limit32u << 32) | ((limit & 0xfff0) << 16)) + 0xfffff;		bridge->p_mem_head = acpiphp_make_resource(base64, limit64 - base64 + 1);		if (!bridge->p_mem_head) {			err("out of memory\n");			kfree(bridge);			return;		}		dbg("64bit Prefetchable memory range: %08x%08x-%08x%08x\n",		    (u32)(bridge->p_mem_head->base >> 32),		    (u32)(bridge->p_mem_head->base & 0xffffffff),		    (u32)((bridge->p_mem_head->base + bridge->p_mem_head->length - 1) >> 32),		    (u32)((bridge->p_mem_head->base + bridge->p_mem_head->length - 1) & 0xffffffff));		break;	case 0x0f:		break;	default:		warn("Unknown prefetchale memory type\n");	}	init_bridge_misc(bridge);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/42f49a6ae5dca90cd0594475502bf1c43ff1dc07/acpiphp_glue.c/clean/drivers/pci/hotplug/acpiphp_glue.c