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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ccio-dma.c

?? MIZI Research, Inc.發布的嵌入式Linux內核源碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
	unsigned long flags;	struct ccio_device *ioa = ccio_list;	spin_lock_irqsave(&ioa->ccio_lock, flags);	ccio_free_size += get_order(size);	spin_unlock_irqrestore(&ioa->ccio_lock, flags);	ccio_unmap_single(hwdev, dma_handle, size, 0);	free_pages((unsigned long) vaddr, get_order(size));}static int ccio_map_sg(struct pci_dev *dev, struct scatterlist *sglist, int nents, int direction){	int tmp = nents;	DBG_RUN(KERN_WARNING __FUNCTION__ " START\n");        /* KISS: map each buffer seperately. */	while (nents) {		sg_dma_address(sglist) = ccio_map_single(dev, sglist->address, sglist->length, direction);		sg_dma_len(sglist) = sglist->length;		nents--;		sglist++;	}	DBG_RUN(KERN_WARNING __FUNCTION__ " DONE\n");	return tmp;}static void ccio_unmap_sg(struct pci_dev *dev, struct scatterlist *sglist, int nents, int direction){	DBG_RUN(KERN_WARNING __FUNCTION__ " : unmapping %d entries\n", nents);	while (nents) {		ccio_unmap_single(dev, sg_dma_address(sglist), sg_dma_len(sglist), direction);		nents--;		sglist++;	}	return;}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 */};#if 0/* GRANT -  is this needed for U2 or not? *//*** Get the size of the I/O TLB for this I/O MMU.**** If spa_shift is non-zero (ie probably U2),** then calculate the I/O TLB size using spa_shift.**** Otherwise we are supposed to get the IODC entry point ENTRY TLB** and execute it. However, both U2 and Uturn firmware supplies spa_shift.** I think only Java (K/D/R-class too?) systems don't do this.*/static intccio_get_iotlb_size(struct hp_device *d){	if(d->spa_shift == 0) {		panic(__FUNCTION__ ": Can't determine I/O TLB size.\n");	}	return(1 << d->spa_shift);}#else/* Uturn supports 256 TLB entries */#define CCIO_CHAINID_SHIFT	8#define CCIO_CHAINID_MASK	0xff#endif /* 0 *//*** Figure out how big the I/O PDIR should be and alloc it.** Also sets variables which depend on pdir size.*/static voidccio_alloc_pdir(struct ccio_device *ioa){	extern unsigned long mem_max;          /* arch.../setup.c */	u32 iova_space_size = 0;	void * pdir_base;	int pdir_size, iov_order;	/*	** Determine IOVA Space size from memory size.	** Using "mem_max" is a kluge.	**	** Ideally, PCI drivers would register the maximum number	** of DMA they can have outstanding for each device they	** own.  Next best thing would be to guess how much DMA	** can be outstanding based on PCI Class/sub-class. Both	** methods still require some "extra" to support PCI	** Hot-Plug/Removal of PCI cards. (aka PCI OLARD).	*/	/* limit IOVA space size to 1MB-1GB */	if (mem_max < (ccio_mem_ratio*1024*1024)) {		iova_space_size = 1024*1024;#ifdef __LP64__	} else if (mem_max > (ccio_mem_ratio*512*1024*1024)) {		iova_space_size = 512*1024*1024;#endif	} else {		iova_space_size = (u32) (mem_max/ccio_mem_ratio);	}	/*	** iova space must be log2() in size.	** thus, pdir/res_map will also be log2().	*/	/* We could use larger page sizes in order to *decrease* the number	** of mappings needed.  (ie 8k pages means 1/2 the mappings).        **	** Note: Grant Grunder says "Using 8k I/O pages isn't trivial either	**   since the pages must also be physically contiguous - typically	**   this is the case under linux."	*/	iov_order = get_order(iova_space_size);	ASSERT(iov_order <= (30 - IOVP_SHIFT));   /* iova_space_size <= 1GB */	ASSERT(iov_order >= (20 - IOVP_SHIFT));   /* iova_space_size >= 1MB */	iova_space_size = 1 << (iov_order + IOVP_SHIFT);	ioa->pdir_size = pdir_size = (iova_space_size/IOVP_SIZE) * sizeof(u64);	ASSERT(pdir_size < 4*1024*1024);   /* max pdir size < 4MB */	/* Verify it's a power of two */	ASSERT((1 << get_order(pdir_size)) == (pdir_size >> PAGE_SHIFT));	DBG_INIT(__FUNCTION__ " hpa 0x%p mem %dMB IOV %dMB (%d bits)\n    PDIR size 0x%0x",		ioa->ccio_hpa, (int) (mem_max>>20), iova_space_size>>20,		iov_order + PAGE_SHIFT, pdir_size);	ioa->pdir_base =	pdir_base = (void *) __get_free_pages(GFP_KERNEL, get_order(pdir_size));	if (NULL == pdir_base)	{		panic(__FILE__ ":" __FUNCTION__ "() could not allocate I/O Page Table\n");	}	memset(pdir_base, 0, pdir_size);	ASSERT((((unsigned long) pdir_base) & PAGE_MASK) == (unsigned long) pdir_base);	DBG_INIT(" base %p", pdir_base);	/*	** Chainid is the upper most bits of an IOVP used to determine	** which TLB entry an IOVP will use.	*/	ioa->chainid_shift = get_order(iova_space_size)+PAGE_SHIFT-CCIO_CHAINID_SHIFT;	DBG_INIT(" chainid_shift 0x%x\n", ioa->chainid_shift);}static voidccio_hw_init(struct ccio_device *ioa){	int i;	/*	** Initialize IOA hardware	*/	WRITE_U32(CCIO_CHAINID_MASK << ioa->chainid_shift, &ioa->ccio_hpa->io_chain_id_mask);	WRITE_U32(virt_to_phys(ioa->pdir_base), &ioa->ccio_hpa->io_pdir_base);	/*	** Go to "Virtual Mode"	*/	WRITE_U32(IOA_NORMAL_MODE, &ioa->ccio_hpa->io_control);	/*	** Initialize all I/O TLB entries to 0 (Valid bit off).	*/	WRITE_U32(0, &ioa->ccio_hpa->io_tlb_entry_m);	WRITE_U32(0, &ioa->ccio_hpa->io_tlb_entry_l);	for (i = 1 << CCIO_CHAINID_SHIFT; i ; i--) {		WRITE_U32((CMD_TLB_DIRECT_WRITE | (i << ioa->chainid_shift)),					&ioa->ccio_hpa->io_command);	}}static voidccio_resmap_init(struct ccio_device *ioa){	u32 res_size;	/*	** Ok...we do more than just init resource map	*/	ioa->ccio_lock = SPIN_LOCK_UNLOCKED;	ioa->res_hint = 16;    /* next available IOVP - circular search */	/* resource map size dictated by pdir_size */	res_size = ioa->pdir_size/sizeof(u64); /* entries */	res_size >>= 3;	/* convert bit count to byte count */	DBG_INIT(__FUNCTION__ "() res_size 0x%x\n", res_size);	ioa->res_size = res_size;	ioa->res_map = (char *) __get_free_pages(GFP_KERNEL, get_order(res_size));	if (NULL == ioa->res_map)	{		panic(__FILE__ ":" __FUNCTION__ "() could not allocate resource map\n");	}	memset(ioa->res_map, 0, res_size);}/* CUJO20 KLUDGE start */static struct {		u16 hversion;		u8  spa;		u8  type;		u32     foo[3];	/* 16 bytes total */} cujo_iodc __attribute__ ((aligned (64)));static unsigned long cujo_result[32] __attribute__ ((aligned (16))) = {0,0,0,0};/*** CUJO 2.0 incorrectly decodes a memory access for specific** pages (every page at specific iotlb locations dependent** upon where the cujo is flexed - diff on raven/firehawk.** resulting in an hpmc and/or silent data corruption.** Workaround is to prevent use of those I/O TLB entries** by marking the suspect bitmap range entries as busy.*/static voidccio_cujo20_hack(struct ccio_device *ioa){	unsigned long status;	unsigned int idx;	u8 *res_ptr = ioa->res_map;	u32 iovp=0x0;	unsigned long mask;	status = pdc_iodc_read( &cujo_result, (void *) CUJO_RAVEN_LOC, 0, &cujo_iodc, 16);	if (status == 0) {		if (cujo_iodc.hversion==CUJO_20_BADHVERS)			iovp = CUJO_20_BADPAGE1;	} else {		status = pdc_iodc_read( &cujo_result, (void *) CUJO_FIREHAWK_LOC, 0, &cujo_iodc, 16);		if (status == 0) {			if (cujo_iodc.hversion==CUJO_20_BADHVERS)				iovp = CUJO_20_BADPAGE2;		} else {			/* not a defective system */			return;		}	}	printk(MODULE_NAME ": Cujo 2.0 bug needs a work around\n");	ccio_cujo_bug = 1;	/*	** mark bit entries that match "bad page"	*/	idx = PDIR_INDEX(iovp)>>3;	mask = 0xff;		while(idx * sizeof(u8) < ioa->res_size) {		res_ptr[idx] |= mask;		idx += (PDIR_INDEX(CUJO_20_STEP)>>3);		ccio_used_pages += 8;		ccio_used_bytes += 1;	}}/* CUJO20 KLUDGE end */#ifdef CONFIG_PROC_FSstatic int ccio_proc_info(char *buf, char **start, off_t offset, int len){	unsigned long i = 0;	struct ccio_device *ioa = ccio_list;	unsigned long *res_ptr = (unsigned long *)ioa->res_map;	unsigned long total_pages = ioa->res_size << 3;            /* 8 bits per byte */	sprintf(buf, "%s\nCujo 2.0 bug    : %s\n",		parisc_getHWdescription(ioa->iodc->hw_type, ioa->iodc->hversion,					ioa->iodc->sversion),		(ccio_cujo_bug ? "yes" : "no"));	sprintf(buf, "%sIO pdir size    : %d bytes (%d entries)\n",		buf, ((ioa->res_size << 3) * sizeof(u64)), /* 8 bits per byte */		ioa->res_size << 3);                       /* 8 bits per byte */		sprintf(buf, "%sResource bitmap : %d bytes (%d pages)\n", 		buf, ioa->res_size, ioa->res_size << 3);   /* 8 bits per byte */	strcat(buf,  "     	  total:    free:    used:   % used:\n");	sprintf(buf, "%sblocks  %8d %8ld %8ld %8ld%%\n", buf, ioa->res_size,		ioa->res_size - ccio_used_bytes, ccio_used_bytes,		(ccio_used_bytes * 100) / ioa->res_size);	sprintf(buf, "%spages   %8ld %8ld %8ld %8ld%%\n", buf, total_pages,		total_pages - ccio_used_pages, ccio_used_pages,		(ccio_used_pages * 100 / total_pages));	sprintf(buf, "%sconsistent       %8ld %8ld\n", buf,		ccio_alloc_size, ccio_free_size); 	strcat(buf, "\nResource bitmap:\n");	for(; i < (ioa->res_size / sizeof(unsigned long)); ++i, ++res_ptr)		len += sprintf(buf, "%s%08lx ", buf, *res_ptr);	strcat(buf, "\n");	return strlen(buf);}#endif/*** Determine if ccio should claim this chip (return 0) or not (return 1).** If so, initialize the chip and tell other partners in crime they** have work to do.*/static intccio_driver_callback(struct hp_device *d, struct pa_iodc_driver *dri){	struct ccio_device *ioa;	printk("%s found %s at 0x%p\n", dri->name, dri->version, d->hpa);	if (ccio_list) {		printk(MODULE_NAME ": already initialized one device\n");		return(0);	}	ioa = kmalloc(sizeof(struct ccio_device), GFP_KERNEL);	if (NULL == ioa)	{		printk(MODULE_NAME " - couldn't alloc ccio_device\n");		return(1);	}	memset(ioa, 0, sizeof(struct ccio_device));	/*	** ccio list is used mainly as a kluge to support a single instance. 	** Eventually, with core dumps, it'll be useful for debugging.	*/	ccio_list = ioa;	ioa->iodc = d;#if 1/* KLUGE: determine IOA hpa based on GSC port value.** Needed until we have a PA bus walk. Can only discover IOA via** walking the architected PA MMIO space as described by the I/O ACD.** "Legacy" PA Firmware only tells us about unarchitected devices** that can't be detected by PA/EISA/PCI bus walks.*/	switch((long) d->hpa) {	case 0xf3fbf000L:       /* C110 IOA0 LBC (aka GSC port) */		/* ccio_hpa same as C200 IOA0 */	case 0xf203f000L:       /* C180/C200/240/C360 IOA0 LBC (aka GSC port) */		ioa->ccio_hpa = (struct ioa_registers *) 0xfff88000L;		break;	case 0xf103f000L:       /* C180/C200/240/C360 IOA1 LBC (aka GSC port) */		ioa->ccio_hpa = (struct ioa_registers *) 0xfff8A000L;		break;	default:		panic("ccio-dma.c doesn't know this GSC port Address!\n");		break;	};#else	ioa->ccio_hpa = d->hpa;#endif	ccio_alloc_pdir(ioa);	ccio_hw_init(ioa);	ccio_resmap_init(ioa);	/* CUJO20 KLUDGE start */	ccio_cujo20_hack(ioa);	/* CUJO20 KLUDGE end */	hppa_dma_ops = &ccio_ops;	create_proc_info_entry(MODULE_NAME, 0, proc_runway_root, ccio_proc_info);	return(0);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美在线你懂的| 成人综合在线视频| 欧美精品xxxxbbbb| 亚洲五码中文字幕| 91精品国产欧美一区二区成人| 丝袜美腿高跟呻吟高潮一区| 欧美电影在哪看比较好| 日产精品久久久久久久性色| 日韩精品中文字幕在线一区| 国产老女人精品毛片久久| 国产日本亚洲高清| 99精品久久只有精品| 亚洲国产综合91精品麻豆| 这里只有精品99re| 国产精品一二三四区| 中文字幕高清不卡| 在线视频你懂得一区| 水野朝阳av一区二区三区| 欧美精品一区二区三区四区| 成人黄色小视频| 亚洲第一福利视频在线| 精品欧美一区二区三区精品久久| 成人午夜视频网站| 亚洲第一二三四区| 国产亚洲福利社区一区| 91官网在线免费观看| 蜜臀91精品一区二区三区| 欧美国产一区二区| 欧美日韩黄色影视| 国产乱人伦精品一区二区在线观看| 自拍偷拍欧美精品| 日韩一级免费一区| 99天天综合性| 蜜臀久久99精品久久久画质超高清| 亚洲国产精品激情在线观看| 欧美日韩一区二区不卡| 国产成人精品www牛牛影视| 一区二区三区在线播放| 久久亚洲精品小早川怜子| 色呦呦一区二区三区| 久久69国产一区二区蜜臀| 亚洲人成精品久久久久| 久久久久99精品一区| 欧美日韩视频不卡| aa级大片欧美| 国产河南妇女毛片精品久久久| 亚洲成人久久影院| 国产精品美女久久久久久久久久久| 日韩欧美一二三四区| 欧美中文字幕一二三区视频| 成人高清视频在线| 国产一区在线观看麻豆| 午夜欧美大尺度福利影院在线看 | 久久99精品国产.久久久久久| 亚洲欧美日韩系列| 久久精品免费在线观看| 欧美一级二级三级乱码| 欧美综合一区二区三区| 91丝袜国产在线播放| 国产91精品入口| 国模娜娜一区二区三区| 蜜桃视频在线观看一区| 日韩国产欧美一区二区三区| 亚洲一本大道在线| 亚洲人成影院在线观看| 国产精品妹子av| 国产精品欧美综合在线| 国产日韩欧美一区二区三区乱码| 欧美zozozo| 欧美电影免费观看高清完整版在线| 欧美日韩成人在线一区| 欧美日韩久久久一区| 欧美日韩在线播放一区| 在线免费av一区| 91福利视频久久久久| 在线亚洲免费视频| 色婷婷激情久久| 欧洲精品视频在线观看| 欧美这里有精品| 在线观看日韩高清av| 欧美一a一片一级一片| 精品视频一区二区不卡| 欧美日本一区二区| 3d成人动漫网站| 91精品国产综合久久久久| 91麻豆精品国产自产在线| 在线电影欧美成精品| 欧美一区日韩一区| 日韩一级高清毛片| 精品国产一区二区国模嫣然| 26uuu国产日韩综合| 国产日韩欧美a| 中文字幕一区二区三中文字幕| 亚洲美女电影在线| 亚洲大片在线观看| 久久99精品国产麻豆不卡| 国产精品一二三四五| 色综合天天性综合| 欧美日韩精品是欧美日韩精品| 欧美一区二区高清| 国产亚洲精品中文字幕| 亚洲三级理论片| 视频一区国产视频| 国产一区二区不卡| 色综合中文字幕国产| 91麻豆精品国产91久久久资源速度 | 一级精品视频在线观看宜春院 | 国产高清一区日本| av电影在线观看一区| 欧美日韩日日摸| 久久亚洲综合色| 亚洲精品大片www| 日本成人超碰在线观看| 福利电影一区二区| 欧美性高清videossexo| 精品少妇一区二区三区| 国产精品美女www爽爽爽| 亚洲成av人片观看| 国产精品一区二区果冻传媒| 色婷婷综合久久久中文一区二区| 欧美一卡在线观看| 国产精品拍天天在线| 免费视频最近日韩| 97精品久久久久中文字幕| 日韩欧美一级特黄在线播放| 亚洲天堂久久久久久久| 麻豆91小视频| 91黄色在线观看| 久久久久9999亚洲精品| 亚洲一区免费视频| 成人免费毛片高清视频| 69久久99精品久久久久婷婷| 国产精品久久久一区麻豆最新章节| 偷窥少妇高潮呻吟av久久免费| 国产99久久久精品| 91精品国产综合久久蜜臀| 亚洲欧美成aⅴ人在线观看| 免费观看一级欧美片| 欧洲另类一二三四区| 亚洲欧洲精品天堂一级 | 国产伦精品一区二区三区免费| 在线观看国产精品网站| 国产亚洲欧洲997久久综合| 日韩电影在线免费看| 欧洲一区二区三区免费视频| 国产精品二三区| 狠狠色丁香婷婷综合| 日韩一区二区在线看片| 亚洲一区二区三区视频在线播放| 99天天综合性| 中文字幕一区二区三区不卡 | 麻豆一区二区在线| 欧美亚洲综合一区| 一区二区视频免费在线观看| 成人黄色大片在线观看| 国产女人18水真多18精品一级做| 久久电影网站中文字幕| 6080日韩午夜伦伦午夜伦| 亚洲国产精品一区二区久久| 一本色道久久加勒比精品 | 国产盗摄女厕一区二区三区| 精品国产一区二区三区四区四| 蜜桃91丨九色丨蝌蚪91桃色| 制服丝袜国产精品| 日韩精品一级中文字幕精品视频免费观看| 色999日韩国产欧美一区二区| 亚洲人成7777| 欧洲一区在线观看| 亚洲电影中文字幕在线观看| 欧美亚洲免费在线一区| 亚洲最色的网站| 欧美日韩专区在线| 午夜欧美大尺度福利影院在线看| 在线不卡a资源高清| 日韩av一级片| 精品久久99ma| 粉嫩蜜臀av国产精品网站| 中文字幕第一区二区| 菠萝蜜视频在线观看一区| 中文字幕一区二区三区在线观看| 91视频国产观看| 亚洲国产精品麻豆| 欧美一区二区三区视频| 久久99精品久久久久婷婷| 久久久久97国产精华液好用吗| 国产成人亚洲综合色影视| 国产精品美女久久久久aⅴ | 久久精品一区二区三区不卡| 国产一区二区精品久久91| 国产精品久久久久久久午夜片 | 亚洲va韩国va欧美va精品 | 欧美日韩精品免费| 麻豆精品一二三| 国产肉丝袜一区二区| 91色视频在线| 日韩av电影免费观看高清完整版 | 欧美成人免费网站| 国产成人精品亚洲日本在线桃色 | 欧美经典一区二区| 日本福利一区二区|