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

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

?? fat.c

?? filesystem for at91sam9263ek,編輯器為keil for arm mdk
?? C
?? 第 1 頁 / 共 2 頁
字號:
				nextcluster = ( (lb<<4) + (hb>>4) );			}			break;		case FAT16:			offset=cluster_addr%256;			nextcluster = *((euint16*)buf + offset);			break;		case FAT32:			offset=cluster_addr%128;			nextcluster = *((euint32*)buf + offset);			break;	}	return(nextcluster);}/*****************************************************************************/ /* ****************************************************************************   * void fat_setNextClusterAddressWBuf(FileSystem *fs,euint32 cluster_addr,euint32 next_cluster_addr,euint8* buf) * Description: This function fills in a fat entry. The entry is cluster_addr and the * data entered is next_cluster_addr. This function is also given a *buf, so it does * not write the data itself, except in the case of FAT 12 cross sector data, where * the second sector is handled by this function. * Return value:*/void fat_setNextClusterAddressWBuf(FileSystem *fs,euint32 cluster_addr,euint32 next_cluster_addr,euint8* buf){	euint16 offset;	euint8 *buf2;			switch(fs->type)	{		case FAT12:			offset = ((cluster_addr%1024)*3/2)%512;			if(offset == 511){				if(cluster_addr%2==0){					buf[offset]=next_cluster_addr&0xFF;				}else{					buf[offset]=(buf[offset]&0xF)+((next_cluster_addr<<4)&0xF0);				}				buf2=part_getSect(fs->part,fat_getSectorAddressFatEntry(fs,cluster_addr)+1,IOM_MODE_READWRITE);				if(cluster_addr%2==0){					buf2[0]=(buf2[0]&0xF0)+((next_cluster_addr>>8)&0xF);				}else{					buf2[0]=(next_cluster_addr>>4)&0xFF;				}				part_relSect(fs->part,buf2);			}else{				if(cluster_addr%2==0){					buf[offset]=next_cluster_addr&0xFF;					buf[offset+1]=(buf[offset+1]&0xF0)+((next_cluster_addr>>8)&0xF);				}else{					buf[offset]=(buf[offset]&0xF)+((next_cluster_addr<<4)&0xF0);					buf[offset+1]=(next_cluster_addr>>4)&0xFF;				}			}			break;		case FAT16:			offset=cluster_addr%256;			*((euint16*)buf+offset)=next_cluster_addr;			break;		case FAT32:			offset=cluster_addr%128;			*((euint32*)buf+offset)=next_cluster_addr;			break;	}}/*****************************************************************************//* ****************************************************************************   * esint16 fat_getNextClusterChain(FileSystem *fs, ClusterChain *Cache) * Description: This function is to advance the clusterchain of a Cache. * First, the function verifies if the Cache is valid. It could correct it if it  * is not, but this is not done at the time. If the cachen is valid, the next step is * to see what the next cluster is, if this is the End of Clustermark, the cache is * updated to know the lastcluster but will remain untouched otherwise. -1 is returned. * If there are more clusters the function scans the rest of the chain until the next * cluster is no longer lineair, or until it has run out of fat data (only 1 sector) is * examined, namely the one fetched to check for EoC. * With lineair is meant that logical cluster n+1 should be 1 more than logical cluster n * at the disc level. * Return value: 0 on success, or -1 when EoC.*/esint16 fat_getNextClusterChain(FileSystem *fs, ClusterChain *Cache){	euint32 sect,lr,nlr,dc;	esint16 lin=0;	euint8 *buf;	if(Cache->DiscCluster==0)	{		return(-1);	}	sect=fat_getSectorAddressFatEntry(fs,Cache->DiscCluster);	buf=part_getSect(fs->part,sect,IOM_MODE_READONLY);	dc=fat_getNextClusterAddressWBuf(fs,Cache->DiscCluster,buf);	if(fat_isEocMarker(fs,dc))	{		Cache->LastCluster=Cache->DiscCluster;		part_relSect(fs->part,buf);		return(-1);	}		Cache->DiscCluster=dc;	Cache->LogicCluster++;			lr=Cache->DiscCluster-1;	nlr=lr+1;		while(nlr-1==lr && fat_getSectorAddressFatEntry(fs,nlr)==sect)	{		lr=nlr;		nlr=fat_getNextClusterAddressWBuf(fs,lr,buf);		lin++;		}		Cache->Linear=lin-1<0?0:lin-1;		part_relSect(fs->part,buf);	return(0);}/*****************************************************************************//* ****************************************************************************   * esint16 fat_LogicToDiscCluster(FileSystem *fs, ClusterChain *Cache,euint32 logiccluster) * Description: This function is used to follow clusterchains. When called it will convert * a logical cluster, to a disc cluster, using a Cache object. All it does is call * getNextClusterChain in the proper manner, and rewind clusterchains if required. * It is NOT recommended to go backwards in clusterchains, since this will require * scanning the entire chain every time. * Return value: 0 on success and -1 on failure (meaning out of bounds).*/esint16 fat_LogicToDiscCluster(FileSystem *fs, ClusterChain *Cache,euint32 logiccluster){	if(logiccluster<Cache->LogicCluster || Cache->DiscCluster==0){		Cache->LogicCluster=0;		Cache->DiscCluster=Cache->FirstCluster;		Cache->Linear=0;	}		if(Cache->LogicCluster==logiccluster){		return(0);	}		while(Cache->LogicCluster!=logiccluster)	{		if(Cache->Linear!=0)		{			Cache->Linear--;			Cache->LogicCluster++;			Cache->DiscCluster++;		}		else		{			if((fat_getNextClusterChain(fs,Cache))!=0){				return(-1);			}		}	}	return(0);}/*****************************************************************************//* ****************************************************************************   * eint16 fat_allocClusterChain(FileSystem *fs,ClusterChain *Cache,euint32 num_clusters) * Description: This function extends a clusterchain by num_clusters. It returns the * number of clusters it *failed* to allocate.  * Return value: 0 on success, all other values are the number of clusters it could * not allocate.*/eint16 fat_allocClusterChain(FileSystem *fs,ClusterChain *Cache,euint32 num_clusters){	euint32 cc,ncl=num_clusters,lc;	euint8 *bufa=0,*bufb=0;	euint8  overflow=0;	if(Cache->FirstCluster<=1)return(num_clusters);		lc=fs_getLastCluster(fs,Cache);	cc=lc;		while(ncl > 0){		cc++;		if(cc>=fs->DataClusterCount+1){			if(overflow){				bufa=part_getSect(fs->part,fat_getSectorAddressFatEntry(fs,lc),IOM_MODE_READWRITE);				fat_setNextClusterAddressWBuf(fs,lc,fat_giveEocMarker(fs),bufa);				Cache->LastCluster=lc;				part_relSect(fs->part,bufa);				fs->FreeClusterCount-=num_clusters-ncl;				return(num_clusters-ncl);			}			cc=2;			overflow++;		}		bufa=part_getSect(fs->part,fat_getSectorAddressFatEntry(fs,cc),IOM_MODE_READONLY);		if(fat_getNextClusterAddressWBuf(fs,cc,bufa)==0){			bufb=part_getSect(fs->part,fat_getSectorAddressFatEntry(fs,lc),IOM_MODE_READWRITE);			fat_setNextClusterAddressWBuf(fs,lc,cc,bufb);			part_relSect(fs->part,bufb);			ncl--;			lc=cc;		}		part_relSect(fs->part,bufa);		if(ncl==0){			bufa=part_getSect(fs->part,fat_getSectorAddressFatEntry(fs,lc),IOM_MODE_READWRITE);			fat_setNextClusterAddressWBuf(fs,lc,fat_giveEocMarker(fs),bufa);			Cache->LastCluster=lc;			part_relSect(fs->part,bufa);		}	}	if(Cache->ClusterCount)Cache->ClusterCount+=num_clusters;	return(0);}/* ****************************************************************************   * eint16 fat_unlinkClusterChain(FileSystem *fs,ClusterChain *Cache) * Description: This function removes a clusterchain. Starting at FirstCluster * it follows the chain until the end, resetting all values to 0. * Return value: 0 on success.*/eint16 fat_unlinkClusterChain(FileSystem *fs,ClusterChain *Cache){	euint32 c,tbd=0;		Cache->LogicCluster=0;	Cache->DiscCluster=Cache->FirstCluster;		c=0;		while(!fat_LogicToDiscCluster(fs,Cache,c++)){		if(tbd!=0){			fat_setNextClusterAddress(fs,tbd,0);		}		tbd=Cache->DiscCluster;	}	fat_setNextClusterAddress(fs,Cache->DiscCluster,0);	fs->FreeClusterCount+=c;	 	return(0);}euint32 fat_countClustersInChain(FileSystem *fs,euint32 firstcluster){	ClusterChain cache;	euint32 c=0;		if(firstcluster<=1)return(0);		cache.DiscCluster = cache.LogicCluster = cache.LastCluster = cache.Linear = 0;	cache.FirstCluster = firstcluster;		while(!(fat_LogicToDiscCluster(fs,&cache,c++)));		return(c-1);}euint32 fat_DiscToLogicCluster(FileSystem *fs,euint32 firstcluster,euint32 disccluster){	ClusterChain cache;	euint32 c=0,r=0;		cache.DiscCluster = cache.LogicCluster = cache.LastCluster = cache.Linear = 0;	cache.FirstCluster = firstcluster;		while(!(fat_LogicToDiscCluster(fs,&cache,c++)) && !r){		if(cache.DiscCluster == disccluster){			r = cache.LogicCluster;		}	}	return(r);}euint32 fat_countFreeClusters(FileSystem *fs){	euint32 c=2,fc=0;		while(c<=fs->DataClusterCount+1){		if(fat_getNextClusterAddress(fs,c,0)==0)fc++;		c++;	}	return(fc);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲乱码一区二区三区在线观看| 欧美日韩免费在线视频| 香蕉乱码成人久久天堂爱免费| 成人av电影观看| 中文字幕在线不卡国产视频| 99久久久免费精品国产一区二区| 亚洲日本青草视频在线怡红院| 91猫先生在线| 日韩中文字幕亚洲一区二区va在线| 3751色影院一区二区三区| 国产综合色产在线精品| 中文在线资源观看网站视频免费不卡| 成人久久视频在线观看| 亚洲欧美一区二区三区久本道91| 日本高清不卡视频| 青椒成人免费视频| 国产欧美精品一区二区三区四区| 91啪亚洲精品| 久久精品国产第一区二区三区| 久久九九久精品国产免费直播| 99re热视频这里只精品| 日本色综合中文字幕| 国产片一区二区三区| 欧美婷婷六月丁香综合色| 精品伊人久久久久7777人| 亚洲美女在线国产| 日韩精品最新网址| 色av成人天堂桃色av| 国模套图日韩精品一区二区| 亚洲另类在线制服丝袜| 欧美成人免费网站| 日本精品视频一区二区| 精品在线你懂的| 亚洲成av人片在www色猫咪| 亚洲午夜在线电影| 久久精品一区二区三区四区| 欧美午夜一区二区三区 | 中文字幕一区二区三区精华液| 欧美三级中文字| 国产成人午夜视频| 日本不卡视频在线观看| 日韩美女视频19| 久久蜜桃av一区精品变态类天堂 | 国产99久久久国产精品潘金| 五月婷婷色综合| 亚洲欧美激情插| 久久久久久久一区| 欧美一区二区在线看| 91色porny蝌蚪| 粉嫩av一区二区三区| 日本女人一区二区三区| 一片黄亚洲嫩模| 中文文精品字幕一区二区| 欧美一级高清片在线观看| 欧美午夜免费电影| 日本精品视频一区二区| 国产精品一区久久久久| 麻豆精品国产传媒mv男同| 亚洲电影一区二区| 一区二区三区在线免费播放| 中文字幕在线不卡视频| 久久精品亚洲乱码伦伦中文| 日韩欧美中文字幕一区| 欧美久久免费观看| 精品国一区二区三区| 日韩一区二区电影| 日韩一区二区三区av| 欧美久久久久久久久久| 欧美三区免费完整视频在线观看| 色综合天天综合在线视频| 99久久精品情趣| 91免费版在线| 99久久精品国产麻豆演员表| 成人午夜视频免费看| 国产成人午夜高潮毛片| 国产精品一色哟哟哟| 成人久久18免费网站麻豆| 国产宾馆实践打屁股91| 成人精品国产福利| aaa国产一区| 91一区二区在线观看| 91蜜桃在线观看| 欧美色视频在线| 7777精品伊人久久久大香线蕉| 欧美日韩不卡一区二区| 91精品国产综合久久精品性色| 欧美久久久久久蜜桃| 日韩精品一区在线| 国产女人18水真多18精品一级做| 国产日韩欧美制服另类| 日韩一区欧美一区| 亚洲一区在线视频| 日本成人在线一区| 国产成人综合亚洲网站| 成人国产一区二区三区精品| 91亚洲精华国产精华精华液| 欧美性大战久久| 精品美女在线播放| 国产精品网站在线观看| 亚洲男人都懂的| 午夜精品久久久久久久| 国产在线一区二区综合免费视频| 国产98色在线|日韩| 色八戒一区二区三区| 日韩限制级电影在线观看| 久久精品亚洲精品国产欧美| 亚洲视频 欧洲视频| 日韩黄色在线观看| 国产成人在线色| 91久久精品网| 欧美电影免费观看高清完整版在线观看| 久久久久国产精品人| 亚洲日本va午夜在线影院| 三级在线观看一区二区| 国产成人免费视频| 欧美电影在线免费观看| 亚洲国产精品二十页| 亚洲一区二区视频在线观看| 黑人巨大精品欧美黑白配亚洲| 91蝌蚪porny| 日韩精品一区二区三区视频播放| 久久国产福利国产秒拍| 91美女片黄在线| 欧美tk—视频vk| 亚洲自拍都市欧美小说| 国产精品自拍毛片| 91精品国产综合久久久久久| 日韩一区在线播放| 国产又黄又大久久| 欧美亚洲国产bt| 国产精品激情偷乱一区二区∴| 日韩精品一卡二卡三卡四卡无卡| 大胆欧美人体老妇| 日韩欧美一区二区在线视频| 一区二区免费视频| 成人高清在线视频| 精品精品国产高清a毛片牛牛| 亚洲自拍偷拍欧美| av电影一区二区| 久久香蕉国产线看观看99| 日日欢夜夜爽一区| 91福利精品第一导航| 国产女人aaa级久久久级| 久久超级碰视频| 欧美日韩二区三区| 亚洲精选一二三| 波多野结衣精品在线| 久久精品在这里| 国产在线看一区| 日韩欧美在线综合网| 亚洲成av人片观看| 欧洲精品一区二区| 亚洲免费在线看| 99久久精品免费看国产免费软件| 国产三级一区二区| 国产乱一区二区| 久久免费视频色| 国产精品一卡二| 久久品道一品道久久精品| 久久精品久久精品| 精品美女在线播放| 国内精品嫩模私拍在线| 欧美成人三级电影在线| 精品无人区卡一卡二卡三乱码免费卡 | 99国产精品一区| 欧美国产乱子伦| 成人自拍视频在线观看| 久久精品人人爽人人爽| 国产精品18久久久| 国产婷婷色一区二区三区四区| 国产一区二区网址| 欧美激情一区不卡| 色综合夜色一区| 一区二区三区四区视频精品免费| 色狠狠一区二区| 婷婷六月综合亚洲| 日韩欧美中文字幕一区| 精品一区二区三区香蕉蜜桃| 26uuu精品一区二区在线观看| 国内精品久久久久影院一蜜桃| 国产欧美日韩视频一区二区| bt欧美亚洲午夜电影天堂| 亚洲精选在线视频| 欧美一区永久视频免费观看| 看片网站欧美日韩| 偷拍与自拍一区| 精品国产sm最大网站免费看| 国产白丝网站精品污在线入口| 亚洲天堂免费在线观看视频| 欧美三级韩国三级日本一级| 久久国产精品一区二区| 国产嫩草影院久久久久| 日本韩国精品在线| 美女被吸乳得到大胸91| 欧美激情在线一区二区三区| 欧美自拍偷拍午夜视频| 美女高潮久久久| 亚洲私人黄色宅男| 欧美一区二视频| 成人av免费在线|