hp->io_pdir = phys_to_virt(readq(hp->ioc_regs+HP_ZX1_PDIR_BASE)); 
hp->io_pdir = gart_to_virt(readq(hp->ioc_regs+HP_ZX1_PDIR_BASE)); 
static int __init hp_zx1_ioc_shared(void){	struct _hp_private *hp = &hp_private;	printk(KERN_INFO PFX "HP ZX1 IOC: IOPDIR shared with sba_iommu\n");	/*	 * IOC already configured by sba_iommu module; just use	 * its setup.  We assume:	 * 	- IOVA space is 1Gb in size	 * 	- first 512Mb is IOMMU, second 512Mb is GART	 */	hp->io_tlb_ps = readq(hp->ioc_regs+HP_ZX1_TCNFG);	switch (hp->io_tlb_ps) {		case 0: hp->io_tlb_shift = 12; break;		case 1: hp->io_tlb_shift = 13; break;		case 2: hp->io_tlb_shift = 14; break;		case 3: hp->io_tlb_shift = 16; break;		default:			printk(KERN_ERR PFX "Invalid IOTLB page size "			       "configuration 0x%x\n", hp->io_tlb_ps);			hp->gatt = NULL;			hp->gatt_entries = 0;			return -ENODEV;	}	hp->io_page_size = 1 << hp->io_tlb_shift;	hp->io_pages_per_kpage = PAGE_SIZE / hp->io_page_size;	hp->iova_base = readq(hp->ioc_regs+HP_ZX1_IBASE) & ~0x1;	hp->gart_base = hp->iova_base + HP_ZX1_IOVA_SIZE - HP_ZX1_GART_SIZE;	hp->gart_size = HP_ZX1_GART_SIZE;	hp->gatt_entries = hp->gart_size / hp->io_page_size;	hp->io_pdir = phys_to_virt(readq(hp->ioc_regs+HP_ZX1_PDIR_BASE));	hp->gatt = &hp->io_pdir[HP_ZX1_IOVA_TO_PDIR(hp->gart_base)];	if (hp->gatt[0] != HP_ZX1_SBA_IOMMU_COOKIE) {		/* Normal case when no AGP device in system */	    	hp->gatt = NULL;		hp->gatt_entries = 0;		printk(KERN_ERR PFX "No reserved IO PDIR entry found; "		       "GART disabled\n");		return -ENODEV;	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/07eee78ea8ba2d0b7b20551c35a3e7dd158d50bb/hp-agp.c/buggy/drivers/char/agp/hp-agp.c