 /* form complete address */ 
sba_map_single(struct device *dev, void *addr, size_t size,	       enum dma_data_direction direction){	struct ioc *ioc;	unsigned long flags; 	dma_addr_t iovp;	dma_addr_t offset;	u64 *pdir_start;	int pide;	ioc = GET_IOC(dev);	/* save offset bits */	offset = ((dma_addr_t) (long) addr) & ~IOVP_MASK;	/* round up to nearest IOVP_SIZE */	size = (size + offset + ~IOVP_MASK) & IOVP_MASK;	spin_lock_irqsave(&ioc->res_lock, flags);#ifdef ASSERT_PDIR_SANITY	sba_check_pdir(ioc,"Check before sba_map_single()");#endif#ifdef SBA_COLLECT_STATS	ioc->msingle_calls++;	ioc->msingle_pages += size >> IOVP_SHIFT;#endif	pide = sba_alloc_range(ioc, size);	iovp = (dma_addr_t) pide << IOVP_SHIFT;	DBG_RUN("%s() 0x%p -> 0x%lx\n",		__FUNCTION__, addr, (long) iovp | offset);	pdir_start = &(ioc->pdir_base[pide]);	while (size > 0) {		sba_io_pdir_entry(pdir_start, KERNEL_SPACE, (unsigned long) addr, 0);		DBG_RUN("	pdir 0x%p %02x%02x%02x%02x%02x%02x%02x%02x\n",			pdir_start,			(u8) (((u8 *) pdir_start)[7]),			(u8) (((u8 *) pdir_start)[6]),			(u8) (((u8 *) pdir_start)[5]),			(u8) (((u8 *) pdir_start)[4]),			(u8) (((u8 *) pdir_start)[3]),			(u8) (((u8 *) pdir_start)[2]),			(u8) (((u8 *) pdir_start)[1]),			(u8) (((u8 *) pdir_start)[0])			);		addr += IOVP_SIZE;		size -= IOVP_SIZE;		pdir_start++;	}	/* form complete address */#ifdef ASSERT_PDIR_SANITY	sba_check_pdir(ioc,"Check after sba_map_single()");#endif	spin_unlock_irqrestore(&ioc->res_lock, flags);	return SBA_IOVA(ioc, iovp, offset, DEFAULT_DMA_HINT_REG);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/64908ad95c34f25849412d6d4735ac10f8fb6575/sba_iommu.c/buggy/drivers/parisc/sba_iommu.c