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

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

?? flash.c

?? 如何制作JFFS文件系統
?? C
?? 第 1 頁 / 共 3 頁
字號:
	wlen = flash_safe_write(part,				(unsigned char *)part->start + filp->f_pos,				(unsigned char *)buf, count);	/* advance file position pointer */	if(wlen >= 0)		filp->f_pos += wlen;	return wlen;}#endif /* CONFIG_CHR_DEV_FLASH */static intflash_ioctl(struct inode *inode, struct file *file,	    unsigned int cmd, unsigned long arg){	int minor;	struct flashpartition *part;	struct flashchipinfo *finfo;	if (!inode || !inode->i_rdev)		return -EINVAL;	minor = MINOR(inode->i_rdev);	if(minor < FLASH_MINOR)		return -EINVAL; /* only ioctl's for flash devices */	part = &partitions[minor - FLASH_MINOR];	switch(cmd) {	case FLASHIO_CHIPINFO:		if(!suser())			return -EACCES;		if(arg == 0)			return -EINVAL;		finfo = (struct flashchipinfo *)arg;		/* TODO: verify arg */		finfo->isValid = chips[0].isValid;		finfo->manufacturer_id = chips[0].manufacturer_id;		finfo->device_id = chips[0].device_id;		finfo->size = chips[0].size;		finfo->sectorsize = chips[0].sectorsize;		return 0;	case FLASHIO_ERASEALL:		if(!part->start)			return -EINVAL;		if(!suser())			return -EACCES;		/* Invalidate all pages and buffers */		invalidate_inodes(inode->i_rdev);		invalidate_buffers(inode->i_rdev);		/*		 * Start the erasure, then sleep and wake up now and		 * then to see if it's done. We use the waitqueue to		 * make sure we don't start erasing in the middle of		 * a write, or that nobody start using the flash while		 * we're erasing.		 *		 * TODO: break up partition erases that spans more than one		 *       chip.		 */		flash_safe_acquire(part);		flash_init_erase(part->start, part->size);		while (flash_is_busy(part->start)		       || !flash_pos_is_clean(part->start)) {			current->state = TASK_INTERRUPTIBLE;			current->timeout = jiffies + HZ / 2;			schedule();		}		flash_safe_release(part);		return 0;	default:		return -EPERM;	}	return -EPERM;}/* probe for Flash RAM's - this isn't in the init function, because this needs * to be done really early in the boot, so we can use the device to burn an * image before the system is running. */voidflash_probe(){	int i;	/* start adresses for the Flash chips - these should really	 * be settable in some other way.	 */#ifdef FLASH_VERBOSE	safe_printk("Probing flash...\n");#endif#ifdef CONFIG_COLDFIRE	chips[0].start = (unsigned char *)(0xf0110000);#else	chips[0].start = (unsigned char *)(MEM_CSE0_START | MEM_NON_CACHEABLE);	chips[1].start = (unsigned char *)(MEM_CSE1_START | MEM_NON_CACHEABLE);#endif	for(i = 0; i < MAX_CHIPS; i++) {		struct flashchip *chip = chips + i;		flashptr flashStart = (flashptr)chip->start;		unsigned short manu;#ifdef FLASH_VERBOSE		FDEBUG(safe_printk("Probing flash #%d at 0x%x\n", i, flashStart));#endif#ifdef CONFIG_SVINTO_SIM		/* in the simulator, dont trash the flash ram by writing unlocks */		chip->isValid = 1;		chip->device_id = AM29LV160BT;#else		/* reset */		flashStart[unlockAddress1] = unlockData1;		flashStart[unlockAddress2] = unlockData2;		flashStart[unlockAddress1] = resetData;		/* read manufacturer */		flashStart[unlockAddress1] = unlockData1;		flashStart[unlockAddress2] = unlockData2;		flashStart[unlockAddress1] = manufacturerUnlockData;		flashStart[unlockAddress1] = 0x9898;		manu = flashStart[manufacturerAddress];		chip->isValid = (manu == ManufacturerAMD ||				 manu == ManufacturerToshiba ||				 manu == ManufacturerST ||				 manu == ManufacturerSST);		chip->manufacturer_id = manu;		/* reset */		flashStart[unlockAddress1] = unlockData1;		flashStart[unlockAddress2] = unlockData2;		flashStart[unlockAddress1] = resetData;		/* read device id */		flashStart[unlockAddress1] = unlockData1;		flashStart[unlockAddress2] = unlockData2;		flashStart[unlockAddress1] = manufacturerUnlockData;		chip->device_id = flashStart[deviceIdAddress];		/* reset */		flashStart[unlockAddress1] = unlockData1;		flashStart[unlockAddress2] = unlockData2;		flashStart[unlockAddress1] = resetData;#endif		/* check device type and fill in correct sizes etc */		switch(chip->device_id) {		case AM29LV160BT:		case TC58FVT160:#ifdef FLASH_VERBOSE			safe_printk("Flash: 16Mb TB\n");#endif			chip->size = 0x00200000;			chip->sectorsize = 0x10000;			chip->bootsector = chip->start + chip->size					   - chip->sectorsize;			chip->bootsectorsize[0] = 0x8000;			chip->bootsectorsize[1] = 0x2000;			chip->bootsectorsize[2] = 0x2000;			chip->bootsectorsize[3] = 0x4000;			break;		//case AM29LV160BB:		case TC58FVB160:#ifdef FLASH_VERBOSE			safe_printk("Flash: 16Mb BB\n");#endif			chip->size = 0x00200000;			chip->sectorsize = 0x10000;			chip->bootsector = chip->start;			chip->bootsectorsize[0] = 0x4000;			chip->bootsectorsize[1] = 0x2000;			chip->bootsectorsize[2] = 0x2000;			chip->bootsectorsize[3] = 0x8000;			break;		case AM29LV800BB:		case AM29F800BB:#ifdef FLASH_VERBOSE			safe_printk("Flash: 8Mb BB\n");#endif			chip->size = 0x00100000;			chip->sectorsize = 0x10000;			chip->bootsector = chip->start;			chip->bootsectorsize[0] = 0x4000;			chip->bootsectorsize[1] = 0x2000;			chip->bootsectorsize[2] = 0x2000;			chip->bootsectorsize[3] = 0x8000;			break;		case M29W800T:		case AM29LV800BT:		case AM29F800BT:#ifdef FLASH_VERBOSE			safe_printk("Flash: 8Mb TB\n");#endif			chip->size = 0x00100000;			chip->sectorsize = 0x10000;			chip->bootsector = chip->start + chip->size					   - chip->sectorsize;			chip->bootsectorsize[0] = 0x8000;			chip->bootsectorsize[1] = 0x2000;			chip->bootsectorsize[2] = 0x2000;			chip->bootsectorsize[3] = 0x4000;			break;			//     case AM29LV800BB:			/* the following supports smaller sector erases (like 2 Kword)			 * so they dont use bootblocks. until we've implemented real			 * support for the smaller erases, we just treat them as if they			 * dont have bootblocks at all.			 */		case SST39LF800:#ifdef FLASH_VERBOSE			safe_printk("Flash: 8Mb No B\n");#endif			chip->size = 0x00010000;			chip->sectorsize = 0x1000;			chip->bootsector = (unsigned char *)MEM_DRAM_START; /* never a flash address (see above) */			break;		case SST39VF160:#ifdef FLASH_VERBOSE			safe_printk("Flash: SST39VF160 16Mb No B");#endif			chip->size = 0x00100000;			chip->sectorsize = 0x0100;			chip->bootsector = (unsigned char *)MEM_DRAM_START; /* never a flash address */			break;		default:#ifdef FLASH_VERBOSE			safe_printk("Flash: Unknown device\n");#endif			chip->isValid = 1;			chip->size = 0x00100000;		    chip->sectorsize = 0x1000;			chip->bootsector = (unsigned char *)MEM_DRAM_START;			break;		}		chip->busy = 0;		init_waitqueue(&chip->wqueue);	}}/* locate the flashchip structure associated with the given adress */static struct flashchip *getchip(unsigned char *ptr){	int i;	for (i = 0; i < MAX_CHIPS; i++) {		FDEBUG(printk("flash: chips[i].start: 0x%x,chips[i].size=0x%x!\n", chips[i].start,chips[i].size));		if (ptr >= chips[i].start		    && ptr < (chips[i].start + chips[i].size)) {			return &chips[i];		}	}	printk("flash: Illegal address: getchip(0x%p)!\n", ptr);	return (void *)0;}void *flash_getpart(kdev_t dev){	struct flashpartition *part;	if (MINOR(dev) < FLASH_MINOR) {		return 0;	}	part = &partitions[MINOR(dev) - FLASH_MINOR];	if (!part->start) {		return 0;	}	return (void *)part;}unsigned char *flash_get_direct_pointer(kdev_t dev, __u32 offset){	struct flashpartition *part;	if (MINOR(dev) < FLASH_MINOR) {		return 0;	}	part = &partitions[MINOR(dev) - FLASH_MINOR];	if (!part->start) {		return 0;	}	return (unsigned char *) ((__u32) part->start + offset);}/* start erasing flash-memory at ptr of a certain size * this does not wait until the erasing is done */voidflash_init_erase(unsigned char *ptr, unsigned int size){	struct flashchip *chip;	int bootSectorCounter = 0;	unsigned int erasedSize = 0;	flashptr flashStart;	unsigned long  i;    unsigned short status;#ifdef IRQ_LOCKS	unsigned long flags;#endif	ptr = (unsigned char *)((unsigned long)ptr | MEM_NON_CACHEABLE);	chip = getchip(ptr);	flashStart = (flashptr)chip->start;	FDEBUG(safe_printk("Flash: erasing memory at 0x%p, size 0x%x.\n", ptr, size));	/* need to disable interrupts, to avoid possible delays between the	 * unlocking and erase-init	 */#ifdef IRQ_LOCKS	save_flags(flags);	cli();#endif	/* Init erasing of the number of sectors needed */        printk("Erase flash device now,please wait...\n");	while (erasedSize < size) {		flashStart[unlockAddress1] = unlockData1;		flashStart[unlockAddress2] = unlockData2;		flashStart[unlockAddress1] = sectorEraseUnlockData;		flashStart[unlockAddress1] = unlockData1;		flashStart[unlockAddress2] = unlockData2;		*(flashptr)ptr = sectorEraseUnlockData2;		/* make sure we erase the individual bootsectors if in that area */		/* TODO this BREAKS if we start erasing in the middle of the bootblock! */		if (ptr < chip->bootsector || ptr >= (chip->bootsector +						      chip->sectorsize)) {			erasedSize += chip->sectorsize;			ptr += chip->sectorsize;		}		else {			erasedSize += chip->bootsectorsize[bootSectorCounter];			ptr += chip->bootsectorsize[bootSectorCounter++];		}		for(i=0;i<0x30000;i++){                        status=*(flashptr)ptr;                        if(status&0x0080){                                FDEBUG(printk("Erase address 0x%x OK! i=%d\n",ptr,i));                                break;                        }                }        }        printk("Erased OK! You can mount jffs now!\n");#ifdef IRQ_LOCKS	restore_flags(flags);#endif	/* give the busy signal time enough to activate (tBusy, 90 ns) */	nop(); nop(); nop(); nop(); nop(); nop(); nop(); nop(); nop();}intflash_erase_region(kdev_t dev, __u32 offset, __u32 size){	int minor;	struct flashpartition *part;	unsigned char *erase_start;	short retries = 5;	short success;        minor = MINOR(dev);	if (minor < FLASH_MINOR) {		return -EINVAL;	}	part = &partitions[minor - FLASH_MINOR];	if (!part->start) {		return -EINVAL;	}	/* Start the erasure, then sleep and wake up now and then to see	 * if it's done.	 */	erase_start = part->start + offset;	flash_safe_acquire(part);	do {		flash_init_erase(erase_start, size);		while (flash_is_busy(erase_start)) {			current->state = TASK_INTERRUPTIBLE;			current->timeout = jiffies + HZ / 2;			schedule();		}        		success = ((flashptr)erase_start)[0] == 0xffff	        		  && ((flashptr)erase_start)[1] == 0xffff		        	  && ((flashptr)erase_start)[2] == 0xffff			          && ((flashptr)erase_start)[3] == 0xffff;		if (!success) {			printk(KERN_NOTICE "flash: erase of region "			       "[0x%p, 0x%p] failed once\n",			       erase_start, erase_start + size);		}	} while (retries-- && !success);	flash_safe_release(part);	if (retries == 0 && !success) {		printk(KERN_WARNING "flash: erase of region "			       "[0x%p, 0x%p] totally failed\n",			       erase_start, erase_start + size);		return -1;	}	return 0;}/* wait until the erase operation is finished, in a CPU hogging manner */voidflash_busy_wait_erase(unsigned char *ptr){	flashptr flashStart;	ptr = (unsigned char *)((unsigned long)ptr | MEM_NON_CACHEABLE);	flashStart = (flashptr)getchip(ptr)->start;	/* busy-wait for flash completion - when D6 stops toggling between	 * reads.	 */	while (flash_is_busy(flashStart))		/* nothing */;}/* erase all flashchips and wait until operation is completed */voidflash_erase_all(){	/* TODO: we should loop over chips, not just try the first two! */	if(chips[0].isValid)		flash_init_erase(chips[0].start, chips[0].size);	if(chips[1].isValid)		flash_init_erase(chips[1].start, chips[0].size);	if(chips[0].isValid)		flash_busy_wait_erase(chips[0].start);	if(chips[1].isValid)		flash_busy_wait_erase(chips[1].start);#ifdef FLASH_VERBOSE	safe_printk("Flash: full erasure completed.\n");#endif}/* Write a block of Flash. The destination Flash sectors need to be erased * first. If the size is larger than the Flash chip the block starts in, the * function will continue flashing in the next chip if it exists. * Returns 0 on success, -1 on error. */intflash_write(unsigned char *ptr, const unsigned char *source, unsigned int size){#ifndef CONFIG_SVINTO_SIM	struct flashchip *chip;	flashptr theData = (flashptr)source;	flashptr flashStart;	flashptr programAddress;	int i, fsize;	int odd_size;	ptr = (unsigned char *)((unsigned long)ptr | MEM_NON_CACHEABLE);	while(size > 0) {		chip = getchip(ptr);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美日韩国产成人精品影院| 一区二区不卡在线视频 午夜欧美不卡在 | 欧美xxxx在线观看| 国产三级一区二区| 国产精品入口麻豆原神| 亚洲国产va精品久久久不卡综合| 欧美自拍丝袜亚洲| 久久久五月婷婷| 亚洲国产精品久久久男人的天堂| 日韩电影在线免费观看| 国产精品一区二区男女羞羞无遮挡| 国产成人精品一区二区三区四区 | 精品噜噜噜噜久久久久久久久试看| 精品国产一区二区三区久久影院 | 激情综合色播激情啊| 91社区在线播放| 2021国产精品久久精品| 亚洲九九爱视频| 国产精品白丝av| 69p69国产精品| 国产精品久久久久久妇女6080| 视频一区欧美精品| 一本大道久久a久久精二百| 日韩一区二区三区视频| 亚洲精选免费视频| 精品久久一区二区三区| 一卡二卡三卡日韩欧美| 成人免费视频免费观看| 精品国产1区二区| 日韩精彩视频在线观看| 欧美亚洲图片小说| 亚洲美女在线国产| 成人精品视频一区二区三区尤物| 日韩欧美在线网站| 蜜臀久久99精品久久久久宅男| 在线免费av一区| 亚洲免费观看在线视频| 99久久夜色精品国产网站| 欧美国产禁国产网站cc| 国产一区二区剧情av在线| 日韩一区二区在线播放| 日本麻豆一区二区三区视频| 欧美日韩国产另类一区| 日韩一区欧美二区| 欧美高清dvd| 久久精品久久综合| 亚洲精品一区二区三区蜜桃下载| 久久国产视频网| 久久久久久麻豆| 91丨porny丨最新| 亚洲成人综合在线| 亚洲精品一区二区三区四区高清| 成人自拍视频在线| 亚洲自拍偷拍图区| 91精品国产手机| 国产精品一二二区| 一区二区三区久久久| 欧美一卡二卡在线| 日本欧美大码aⅴ在线播放| 日韩一级二级三级精品视频| 国内久久精品视频| 激情都市一区二区| 国产精品久久三| 欧美日韩一级二级| 色系网站成人免费| 久久品道一品道久久精品| 亚洲欧美综合网| 99久久婷婷国产综合精品 | 色综合天天性综合| 麻豆精品精品国产自在97香蕉| 亚洲午夜激情网页| 一卡二卡欧美日韩| 一区二区三区蜜桃| 亚洲香蕉伊在人在线观| 精品成a人在线观看| 99免费精品在线观看| 天堂久久一区二区三区| 中文字幕精品一区| 欧美群妇大交群中文字幕| 国产成人免费视频网站高清观看视频| 亚洲欧美日韩国产成人精品影院| 精品久久久影院| 欧美艳星brazzers| gogogo免费视频观看亚洲一| 免费观看久久久4p| 亚洲一区二区三区四区的| 中文字幕 久热精品 视频在线| 欧美乱妇15p| 欧美最猛性xxxxx直播| 成人黄页在线观看| 国产综合色在线| 国产原创一区二区三区| 婷婷开心激情综合| 午夜日韩在线观看| 天天影视色香欲综合网老头| 欧美aaaaa成人免费观看视频| 美女视频黄 久久| 国产揄拍国内精品对白| 国产成人午夜99999| 国产xxx精品视频大全| 91视频一区二区三区| 在线观看日产精品| 麻豆免费精品视频| 国产一区二区三区香蕉| 国产精品99久久久久久久女警| 国产精品99久久久久久似苏梦涵 | caoporen国产精品视频| 成人永久aaa| 国产一区二区三区精品视频 | 99久久精品国产观看| 成人中文字幕电影| 一本到高清视频免费精品| 欧美日韩成人综合天天影院| 欧美一区二区三区视频免费播放 | av电影在线观看不卡| 欧美色偷偷大香| 国产一区二区看久久| 国产精品69毛片高清亚洲| 在线免费观看日本欧美| 国产欧美日韩精品一区| 亚洲三级免费观看| 美国三级日本三级久久99| 91蝌蚪国产九色| 国产性天天综合网| 日韩精品每日更新| 欧美亚洲一区三区| 亚洲三级在线免费观看| 国产成人综合在线观看| 色综合久久久久网| 精品免费一区二区三区| 中文字幕综合网| 亚洲午夜私人影院| 国产在线日韩欧美| 欧美日韩午夜在线| 亚洲国产精品高清| 精品一区二区在线观看| 欧美亚洲另类激情小说| 国产精品视频一区二区三区不卡| 日本在线播放一区二区三区| 秋霞电影一区二区| 91美女在线观看| 国产精品理论片在线观看| 久久精品国产亚洲a| 欧美日韩亚洲国产综合| 亚洲欧美在线高清| 国产**成人网毛片九色 | 欧美日韩1区2区| 成人欧美一区二区三区黑人麻豆| 日本在线播放一区二区三区| 欧美日韩精品一区视频| 一级日本不卡的影视| 91在线你懂得| 亚洲激情一二三区| 91女神在线视频| 亚洲免费观看高清完整版在线 | 男女性色大片免费观看一区二区| 欧美亚洲自拍偷拍| 亚洲精品国产一区二区精华液| 成人高清视频在线| 18成人在线视频| 92国产精品观看| 亚洲一二三级电影| 91国偷自产一区二区三区观看| 尤物在线观看一区| 在线观看成人免费视频| 亚洲自拍另类综合| 欧美色电影在线| 午夜精品久久久久久久| 欧美一级在线免费| 国产主播一区二区| 《视频一区视频二区| 欧美老女人第四色| 国产一区二区免费在线| 欧美tk丨vk视频| 一本到三区不卡视频| 青青草原综合久久大伊人精品优势| 日韩欧美亚洲国产精品字幕久久久| 精品中文字幕一区二区小辣椒| 中文字幕欧美区| 欧美日韩精品一区视频| 国产91精品精华液一区二区三区| 国产精品久久久久久久久免费丝袜 | 国产精品综合av一区二区国产馆| 日本一区免费视频| 91影院在线免费观看| 日韩精品欧美精品| 亚洲欧美日韩中文播放| 精品国产污污免费网站入口| 色天天综合色天天久久| 麻豆精品新av中文字幕| 亚洲乱码中文字幕| 国产欧美中文在线| 日韩精品中文字幕一区| 99久久99久久精品免费看蜜桃| 久久激情五月婷婷| 亚洲五码中文字幕| 亚洲欧美另类图片小说| 久久久久久久电影| 欧美一二三区在线观看| 欧美日韩在线播放三区|