亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ccio-dma.c

?? 一個(gè)2.4.21版本的嵌入式linux內(nèi)核
?? C
?? 第 1 頁 / 共 4 頁
字號(hào):
		);		/*		** Look for the start of a new DMA stream		*/		if(sg_dma_address(startsg) & PIDE_FLAG) {			u32 pide = sg_dma_address(startsg) & ~PIDE_FLAG;			dma_offset = (unsigned long) pide & ~IOVP_MASK;			sg_dma_address(startsg) = 0;			dma_sg++;			sg_dma_address(dma_sg) = pide;			pdirp = &(ioc->pdir_base[pide >> IOVP_SHIFT]);			n_mappings++;		}		/*		** Look for a VCONTIG chunk		*/		if (cnt) {			unsigned long vaddr = (unsigned long)startsg->address;			ASSERT(pdirp);			/* Since multiple Vcontig blocks could make up			** one DMA stream, *add* cnt to dma_len.			*/			sg_dma_len(dma_sg) += cnt;			cnt += dma_offset;			dma_offset=0;	/* only want offset on first chunk */			cnt = ROUNDUP(cnt, IOVP_SIZE);#ifdef CONFIG_PROC_FS			ioc->msg_pages += cnt >> IOVP_SHIFT;#endif			do {				ccio_io_pdir_entry(pdirp, KERNEL_SPACE, 						   (void *)vaddr, hint);				vaddr += IOVP_SIZE;				cnt -= IOVP_SIZE;				pdirp++;			} while (cnt > 0);		}		startsg++;	}	return(n_mappings);}/*** First pass is to walk the SG list and determine where the breaks are** in the DMA stream. Allocates PDIR entries but does not fill them.** Returns the number of DMA chunks.**** Doing the fill seperate from the coalescing/allocation keeps the** code simpler. Future enhancement could make one pass through** the sglist do both.*/static CCIO_INLINE intccio_coalesce_chunks(struct ioc *ioc, struct scatterlist *startsg, int nents){	struct scatterlist *vcontig_sg;    /* VCONTIG chunk head */	unsigned long vcontig_len;         /* len of VCONTIG chunk */	unsigned long vcontig_end;	struct scatterlist *dma_sg;        /* next DMA stream head */	unsigned long dma_offset, dma_len; /* start/len of DMA stream */	int n_mappings = 0;	while (nents > 0) {		/*		** Prepare for first/next DMA stream		*/		dma_sg = vcontig_sg = startsg;		dma_len = vcontig_len = vcontig_end = startsg->length;		vcontig_end += (unsigned long) startsg->address;		dma_offset = (unsigned long) startsg->address & ~IOVP_MASK;		/* PARANOID: clear entries */		sg_dma_address(startsg) = 0;		sg_dma_len(startsg) = 0;		/*		** This loop terminates one iteration "early" since		** it's always looking one "ahead".		*/		while(--nents > 0) {			unsigned long startsg_end;			startsg++;			startsg_end = (unsigned long)startsg->address + 				startsg->length;			/* PARANOID: clear entries */			sg_dma_address(startsg) = 0;			sg_dma_len(startsg) = 0;			/*			** First make sure current dma stream won't			** exceed DMA_CHUNK_SIZE if we coalesce the			** next entry.			*/   			if(ROUNDUP(dma_len + dma_offset + startsg->length,				   IOVP_SIZE) > DMA_CHUNK_SIZE)				break;			/*			** Append the next transaction?			*/			if(vcontig_end == (unsigned long) startsg->address) {				vcontig_len += startsg->length;				vcontig_end += startsg->length;				dma_len     += startsg->length;				continue;			}			/*			** Not virtually contigous.			** Terminate prev chunk.			** Start a new chunk.			**			** Once we start a new VCONTIG chunk, dma_offset			** can't change. And we need the offset from the first			** chunk - not the last one. Ergo Successive chunks			** must start on page boundaries and dove tail			** with it's predecessor.			*/			sg_dma_len(vcontig_sg) = vcontig_len;			vcontig_sg = startsg;			vcontig_len = startsg->length;			break;		}		/*		** End of DMA Stream		** Terminate last VCONTIG block.		** Allocate space for DMA stream.		*/		sg_dma_len(vcontig_sg) = vcontig_len;		dma_len = ROUNDUP(dma_len + dma_offset, IOVP_SIZE);		sg_dma_address(dma_sg) =			PIDE_FLAG 			| (ccio_alloc_range(ioc, (dma_len >> IOVP_SHIFT)) << IOVP_SHIFT)			| dma_offset;		n_mappings++;	}	return n_mappings;}/** * ccio_map_sg - Map the scatter/gather list into the IOMMU. * @dev: The PCI device. * @sglist: The scatter/gather list to be mapped in the IOMMU. * @nents: The number of entries in the scatter/gather list. * @direction: The direction of the DMA transaction (to/from device). * * This function implements the pci_map_sg function. */static intccio_map_sg(struct pci_dev *dev, struct scatterlist *sglist, int nents, 	    int direction){	struct ioc *ioc;	int coalesced, filled = 0;	unsigned long flags;	unsigned long hint = hint_lookup[direction];		ASSERT(dev);	ASSERT(dev->sysdata);	ASSERT(HBA_DATA(dev->sysdata)->iommu);	ioc = GET_IOC(dev);		DBG_RUN_SG("%s() START %d entries\n", __FUNCTION__, nents);	/* Fast path single entry scatterlists. */	if(nents == 1) {		sg_dma_address(sglist)= ccio_map_single(dev, sglist->address,							sglist->length, 							direction);		sg_dma_len(sglist)= sglist->length;		return 1;	}		spin_lock_irqsave(&ioc->res_lock, flags);#ifdef CONFIG_PROC_FS	ioc->msg_calls++;#endif	/*	** First coalesce the chunks and allocate I/O pdir space	**	** If this is one DMA stream, we can properly map using the	** correct virtual address associated with each DMA page.	** w/o this association, we wouldn't have coherent DMA!	** Access to the virtual address is what forces a two pass algorithm.	*/	coalesced = ccio_coalesce_chunks(ioc, sglist, nents);	/*	** Program the I/O Pdir	**	** map the virtual addresses to the I/O Pdir	** o dma_address will contain the pdir index	** o dma_len will contain the number of bytes to map 	** o address contains the virtual address.	*/	filled = ccio_fill_pdir(ioc, sglist, nents, hint);	spin_unlock_irqrestore(&ioc->res_lock, flags);	ASSERT(coalesced == filled);	DBG_RUN_SG("%s() DONE %d mappings\n", __FUNCTION__, filled);	return filled;}/** * ccio_unmap_sg - Unmap the scatter/gather list from the IOMMU. * @dev: The PCI device. * @sglist: The scatter/gather list to be unmapped from the IOMMU. * @nents: The number of entries in the scatter/gather list. * @direction: The direction of the DMA transaction (to/from device). * * This function implements the pci_unmap_sg function. */static void ccio_unmap_sg(struct pci_dev *dev, struct scatterlist *sglist, int nents, 	      int direction){	struct ioc *ioc;	ASSERT(dev);	ASSERT(dev->sysdata);	ASSERT(HBA_DATA(dev->sysdata)->iommu);	ioc = GET_IOC(dev);	DBG_RUN_SG("%s() START %d entries,  %p,%x\n",		__FUNCTION__, nents, sglist->address, sglist->length);#ifdef CONFIG_PROC_FS	ioc->usg_calls++;#endif	while(sg_dma_len(sglist) && nents--) {#ifdef CONFIG_PROC_FS		ioc->usg_pages += sg_dma_len(sglist) >> PAGE_SHIFT;#endif		ccio_unmap_single(dev, sg_dma_address(sglist),				  sg_dma_len(sglist), direction);		++sglist;	}	DBG_RUN_SG("%s() DONE (nents %d)\n", __FUNCTION__, nents);}static struct pci_dma_ops ccio_ops = {	ccio_dma_supported,	ccio_alloc_consistent,	ccio_free_consistent,	ccio_map_single,	ccio_unmap_single,	ccio_map_sg,	ccio_unmap_sg,	NULL,                   /* dma_sync_single : NOP for U2/Uturn */	NULL,                   /* dma_sync_sg     : ditto */};#ifdef CONFIG_PROC_FSstatic int proc_append(char *src, int len, char **dst, off_t *offset, int *max){	if (len < *offset) {		*offset -= len;		return 0;	}	if (*offset > 0) {		src += *offset;		len -= *offset;		*offset = 0;	}	if (len > *max) {		len = *max;	}	memcpy(*dst, src, len);	*dst += len;	*max -= len;	return (*max == 0);}static int ccio_proc_info(char *buf, char **start, off_t offset, int count,			  int *eof, void *data){	int max = count;	char tmp[80]; /* width of an ANSI-standard terminal */	struct ioc *ioc = ioc_list;	while (ioc != NULL) {		unsigned int total_pages = ioc->res_size << 3;		unsigned long avg = 0, min, max;		int j, len;		len = sprintf(tmp, "%s\n", ioc->name);		if (proc_append(tmp, len, &buf, &offset, &count))			break;				len = sprintf(tmp, "Cujo 2.0 bug    : %s\n",			      (ioc->cujo20_bug ? "yes" : "no"));		if (proc_append(tmp, len, &buf, &offset, &count))			break;				len = sprintf(tmp, "IO PDIR size    : %d bytes (%d entries)\n",			      total_pages * 8, total_pages);		if (proc_append(tmp, len, &buf, &offset, &count))			break;				len = sprintf(tmp, "IO PDIR entries : %ld free  %ld used (%d%%)\n",			      total_pages - ioc->used_pages, ioc->used_pages,			      (int)(ioc->used_pages * 100 / total_pages));		if (proc_append(tmp, len, &buf, &offset, &count))			break;				len = sprintf(tmp, "Resource bitmap : %d bytes (%d pages)\n", 			ioc->res_size, total_pages);		if (proc_append(tmp, len, &buf, &offset, &count))			break;				min = max = ioc->avg_search[0];		for(j = 0; j < CCIO_SEARCH_SAMPLE; ++j) {			avg += ioc->avg_search[j];			if(ioc->avg_search[j] > max) 				max = ioc->avg_search[j];			if(ioc->avg_search[j] < min) 				min = ioc->avg_search[j];		}		avg /= CCIO_SEARCH_SAMPLE;		len = sprintf(tmp, "  Bitmap search : %ld/%ld/%ld (min/avg/max CPU Cycles)\n",			      min, avg, max);		if (proc_append(tmp, len, &buf, &offset, &count))			break;		len = sprintf(tmp, "pci_map_single(): %8ld calls  %8ld pages (avg %d/1000)\n",			      ioc->msingle_calls, ioc->msingle_pages,			      (int)((ioc->msingle_pages * 1000)/ioc->msingle_calls));		if (proc_append(tmp, len, &buf, &offset, &count))			break;				/* KLUGE - unmap_sg calls unmap_single for each mapped page */		min = ioc->usingle_calls - ioc->usg_calls;		max = ioc->usingle_pages - ioc->usg_pages;		len = sprintf(tmp, "pci_unmap_single: %8ld calls  %8ld pages (avg %d/1000)\n",			      min, max, (int)((max * 1000)/min));		if (proc_append(tmp, len, &buf, &offset, &count))			break; 		len = sprintf(tmp, "pci_map_sg()    : %8ld calls  %8ld pages (avg %d/1000)\n",			      ioc->msg_calls, ioc->msg_pages,			      (int)((ioc->msg_pages * 1000)/ioc->msg_calls));		if (proc_append(tmp, len, &buf, &offset, &count))			break;		len = sprintf(tmp, "pci_unmap_sg()  : %8ld calls  %8ld pages (avg %d/1000)\n\n\n",			      ioc->usg_calls, ioc->usg_pages,			      (int)((ioc->usg_pages * 1000)/ioc->usg_calls));		if (proc_append(tmp, len, &buf, &offset, &count))			break;		ioc = ioc->next;	}	if (count == 0) {		*eof = 1;	}	return (max - count);}static int ccio_resource_map(char *buf, char **start, off_t offset, int len,			     int *eof, void *data){	struct ioc *ioc = ioc_list;	buf[0] = '\0';	while (ioc != NULL) {		u32 *res_ptr = (u32 *)ioc->res_map;		int j;		for (j = 0; j < (ioc->res_size / sizeof(u32)); j++) {			if ((j & 7) == 0)				strcat(buf,"\n   ");			sprintf(buf, "%s %08x", buf, *res_ptr);			res_ptr++;		}		strcat(buf, "\n\n");		ioc = ioc->next;		break; /* XXX - remove me */	}	return strlen(buf);}#endif/** * ccio_find_ioc - Find the ioc in the ioc_list * @hw_path: The hardware path of the ioc. *

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久av资源网| 国产成人精品一区二区三区四区 | 欧美怡红院视频| 日韩不卡一区二区三区| 91精品在线麻豆| 成人av免费观看| 日本aⅴ亚洲精品中文乱码| 欧美国产综合色视频| 欧美久久久久免费| av网站一区二区三区| 久久精品国产精品亚洲精品| 夜夜爽夜夜爽精品视频| 美国三级日本三级久久99| 国产亚洲欧美中文| 日本一区二区三区久久久久久久久不| 久久综合一区二区| 国产精品无码永久免费888| 久久久精品影视| 亚洲丝袜制服诱惑| 亚洲精品国产高清久久伦理二区| 一区二区在线看| 三级久久三级久久| 韩国成人精品a∨在线观看| 欧美精品123区| 日韩欧美资源站| 国产人成一区二区三区影院| 中文字幕中文在线不卡住| 一区二区三区四区国产精品| 亚洲成人高清在线| 加勒比av一区二区| 91在线无精精品入口| 日本丶国产丶欧美色综合| 欧美精品日韩一区| 久久久精品tv| 一区二区三区四区蜜桃| 美女网站色91| 91丨porny丨户外露出| 欧美精品乱码久久久久久按摩| 日韩一区和二区| 国产精品第五页| 免费看黄色91| 99re6这里只有精品视频在线观看| 欧美视频在线播放| 国产视频一区二区在线观看| 一区二区三区日本| 精品无码三级在线观看视频| heyzo一本久久综合| 欧美另类videos死尸| 久久久久久久久岛国免费| 一区二区三区四区蜜桃| 久久99精品久久久久久| 91蜜桃网址入口| 久久综合九色综合欧美98| 亚洲激情成人在线| 国产白丝精品91爽爽久久| 欧美色网站导航| 国产精品免费视频一区| 青青青伊人色综合久久| 99久久精品免费看国产| www国产精品av| 午夜视频在线观看一区二区| 风间由美性色一区二区三区| 制服丝袜亚洲精品中文字幕| 中文字幕在线观看不卡| 免费成人在线观看视频| 色视频一区二区| 国产日本欧美一区二区| 喷水一区二区三区| 欧美性三三影院| 国产精品久线观看视频| 国内精品伊人久久久久影院对白| 欧美日韩综合在线| 日韩毛片在线免费观看| 国产精品一品二品| 欧美一级一区二区| 婷婷综合五月天| 欧美图片一区二区三区| 亚洲婷婷国产精品电影人久久| 国产精品亚洲综合一区在线观看| 91精品福利在线一区二区三区 | 成人免费黄色大片| 精品日韩欧美一区二区| 亚洲大型综合色站| 91精彩视频在线| 亚洲视频小说图片| 成人美女视频在线观看18| 久久夜色精品一区| 九九精品视频在线看| 欧美一区二区黄| 亚洲国产成人porn| 欧美日韩一区二区三区四区 | 99国产精品久久| 久久女同性恋中文字幕| 久久精品国内一区二区三区| 666欧美在线视频| 亚欧色一区w666天堂| 欧美私模裸体表演在线观看| 一区二区久久久| 色婷婷综合久久久中文字幕| 国产精品护士白丝一区av| 成人性视频网站| 国产精品你懂的在线| 不卡av电影在线播放| 欧美激情中文字幕一区二区| 国产一区91精品张津瑜| 欧美精品一区二区三区高清aⅴ | 欧美日韩www| 午夜精品免费在线| 3atv在线一区二区三区| 男男成人高潮片免费网站| 欧美久久久久久久久久| 青娱乐精品视频| 2023国产一二三区日本精品2022| 韩国三级在线一区| 中文字幕不卡在线观看| av午夜一区麻豆| 性久久久久久久久久久久| 在线91免费看| 经典三级视频一区| 国产精品视频看| 一本色道久久加勒比精品| 亚洲一区二区在线播放相泽| 欧美精选一区二区| 国产一区二区三区免费观看 | 国产成人h网站| 中文字幕在线免费不卡| 欧美色视频一区| 国产最新精品免费| 成人免费一区二区三区视频 | 亚洲精品v日韩精品| 6080yy午夜一二三区久久| 久久国产精品99久久人人澡| 亚洲国产精品黑人久久久| 91麻豆免费看片| 麻豆精品一二三| 国产精品国模大尺度视频| 欧美性色黄大片| 国产一区二区福利| 亚洲素人一区二区| 日韩欧美综合一区| 不卡av电影在线播放| 日本女人一区二区三区| 国产精品久久久久影视| 欧美三级在线视频| 黄色日韩三级电影| 有坂深雪av一区二区精品| 日韩欧美国产一区二区三区| 本田岬高潮一区二区三区| 视频一区免费在线观看| 国产欧美日韩麻豆91| 欧美日本在线视频| 成人高清在线视频| 免费的成人av| 一区二区三区日本| 国产视频在线观看一区二区三区| 欧美日韩一区二区在线观看视频 | 欧美在线不卡视频| 韩国精品免费视频| 亚洲成人第一页| 中文字幕欧美区| 7777精品伊人久久久大香线蕉的| 国产**成人网毛片九色| 日韩精品免费专区| 亚洲精品videosex极品| 国产亚洲成年网址在线观看| 欧美精品自拍偷拍| 91在线精品一区二区| 激情成人午夜视频| 午夜一区二区三区在线观看| 国产精品久99| 26uuu另类欧美亚洲曰本| 欧美视频在线一区| 91视视频在线直接观看在线看网页在线看| 青青草国产精品亚洲专区无| 亚洲美女屁股眼交3| 国产天堂亚洲国产碰碰| 日韩女优电影在线观看| 欧美日韩一本到| 91蜜桃婷婷狠狠久久综合9色| 国产精品一区免费视频| 麻豆国产91在线播放| 三级久久三级久久久| 亚洲国产视频一区| 亚洲精品ww久久久久久p站| 国产农村妇女精品| 久久亚洲一区二区三区明星换脸 | 国产精品午夜电影| 精品99999| 欧美成人a∨高清免费观看| 欧美无砖砖区免费| 欧美亚洲丝袜传媒另类| 99精品热视频| 99久久免费国产| 99久久久国产精品免费蜜臀| 成人免费毛片片v| 国产成人免费网站| 国产精品一二二区| 国产乱人伦偷精品视频免下载| 精品在线你懂的| 国产一区二区在线观看免费|