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

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

?? dosfsfat.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* dosFsFat.c - DOS file system File Allocation Table Handler *//* Copyright 1987-2002 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01q,10jan02,chn  Renamed some functions to clear up sector/cluster confusion01p,10dec01,jkf  SPR#72039, various fixes from Mr. T. Johnson.01o,12oct01,jkf  adapted debugging code to be more portable. 01n,02oct01,jkf  replaced diab changes lost in 01m.01m,20sep01,jkf  SPR#69031, common code for both AE & 5.x.01l,08oct99,jkf  added ifdef for HP native tools to ignore GNUish debug macro's01k,31aug99,jkf  changes for new CBIO API.01j,31jul99,jkf  T2 merge, tidiness & spelling.01i,21dec98,mjc  fixed bug in fat16Seek(), changed name of <contigEnd>                  field in structure <DOS_FILE_HDL> to <contigEndPlus1>01h,23nov98,mjc  avoided disk access for seek within contiguous file area;01j,23sep98,vld  added FAT mirroring disabling;		 added routine fat16SyncToggle()01f,20sep98,mjc  descriptor structure name changed from DOS_FAT16_DESC                 to MS_FAT_DESC01e,17sep98,vld  added argument "number of FAT copy" to cluster read/write                 routines;cluster writing routines extended with a"raw" data		 write to FAT copies other, then active one;    	    	 routine fat16ClustValueSet() extended to support                 FAT copy initialization;01d,12jul98,mjc  cluster group allocation factor changed from                 constant to global variable fatClugFac.                 Assert header files including was moved                  to be after #ifdef DEBUG statement to allow                 NDEBUG definition  in case when DEBUG is undefined.                 fat16ContigAlloc() algorithm was changed to 1st fit.01c,01jul98,lrn  doc reviewed01b,29jun98,mjc  added FAT32, tested01a,23feb98,mjc  initially written written.*//*DESCRIPTIONThis module is part of dosFsLib and is designed to manage the threedifferent File Allocation Table formats: FAT12, FAT16 and FAT32.These formats are similar thus are implemented in a single modulewithout the ability to scale out one of these formats for systems whichdo not intend to use them.IMPLEMENTATIONThis FAT handler does not keep any part of the File Allocation Table inmemory, depending entirely on the underlying CBIO module, typically theDisk Cache for the ability to access any FAT entry of any size, i.e.byte-wise access to any particular disk sector.INITIALIZATION*//* includes */#include "vxWorks.h"#include "private/dosFsVerP.h"#include "semLib.h"#include "errnoLib.h"#include "logLib.h"#include "string.h"#include "memLib.h"#include "stdlib.h"#include "stdio.h"#include "taskLib.h"#include "private/print64Lib.h"#include "private/dosFsLibP.h"#include "private/dosFsFatP.h"/* macros */#define _TO_STR(z) _TO_TMP(z)#define _TO_TMP(z) #z#undef ERR_MSG#undef DBG_MSG#undef ERR_PRINT#ifdef DEBUG#   undef  LOCAL#   define LOCAL#   define ERR_PRINT	/* include errnoSetOut() */#   define errnoSet( err ) errnoSetOut( __FILE__, __LINE__, #err, (err) )#   define DBG_MSG(lvl, fmt, a1, a2, a3, a4, a5, a6)                       \        { if ((lvl) <= fat16Debug)                                         \            printErr (__FILE__" : "_TO_STR(__LINE__)" : "fmt, a1, a2,      \                      a3, a4, a5, a6); }#   define ERR_MSG(lvl, fmt, a1, a2, a3, a4, a5, a6)			   \        { logMsg (__FILE__" : "_TO_STR(__LINE__)" : "fmt, (int)(a1),       \                  (int)(a2), (int)(a3), (int)(a4), (int)(a5), (int)(a6)); }#else   /* NO DEBUG */#   undef  NDEBUG#   define NDEBUG/* fixme: quick dirty hack for native HP native tools build, HP simulator */#   if (CPU == SIMHPPA)    /* Allow TOOL=hp to build, will cause no effect warnings when TOOL=gnu */#        define DBG_MSG#        define ERR_MSG#   else#        define DBG_MSG(lvl, fmt, a1, a2, a3, a4, a5, a6) {}#        define ERR_MSG(lvl, fmt, a1, a2, a3, a4, a5, a6)                    \             { if ((lvl) <= fat16Debug)                                      \                 logMsg (__FILE__" : "_TO_STR(__LINE__)" : %s : "fmt,        \                 (int)(a1), (int)(a2), (int)(a3), (int)(a4), (int)(a5),      \		 (int)(a6)); }#   endif /* (CPU == SIMHPPA) */#endif /* DEBUG */                                                                             #include "assert.h"/* defines *//* File System Information Sector number */#define FSINFO_SEC_NUM		1/* Offset of free clusters count field in the File System Information Sector */#define FSINFO_SIGN		484#define FSINFO_FREE_CLUSTS	488#define FSINFO_NEXT_FREE        492/* Read FAT entry error code */#define FAT_CBIO_ERR		1/* Mutex semaphore options */#define ALLOC_SEM_OPTIONS	SEM_Q_PRIORITY | SEM_DELETE_SAFE | \				SEM_INVERSION_SAFE#define ENTRY_READ(pFd, copy, entry)		\		pFatDesc->entryRead ((pFd), (copy), (entry))#define ENTRY_WRITE(pFd, copy, entry, value)	\		pFatDesc->entryWrite ((pFd), (copy), (entry), (value))/* typedefs *//* globals */int     fat16Debug = 0;	/* debug level */int	fatClugFac = 10000;	/* cluster allocation group size factor *//* locals */#ifdef ERR_PRINT/******************************************************************************** errnoSetOut - put error message** This routine is called instead errnoSet during debugging.*/LOCAL VOID errnoSetOut(char * pFile, int line, const char * pStr, int errCode )    {    /* If it is not errno clearing or setting to previously stored value      * (in <errnoBuf> variable), print the error information.     */    if( errCode != OK  && strcmp( pStr, "errnoBuf" ) != 0 )        printf( "ERROR from %s : line %d : %s = %p, task %p\n",                pFile, line, pStr, (void *)errCode, (void *)taskIdSelf() );    errno = errCode;    }#endif  /* ERR_PRINT *//********************************************************************************* fat16MirrorSect - mirror FAT sector** This routine copies last modified sector of Primary FAT copy to appropriate * sectors of another FAT copies.** RETURNS: OK or ERROR.*/LOCAL STATUS fat16MirrorSect    (    FAST DOS_FILE_DESC_ID	pFd		/* pointer to file descriptor */    )    {    FAST DOS_VOLUME_DESC_ID	pVolDesc = pFd->pVolDesc;					/* pointer to volume descriptor */    FAST MS_FAT_DESC_ID	pFatDesc = (void *) pVolDesc->pFatDesc;					/* pointer to FAT descriptor */    FAST CBIO_DEV_ID		pCbio = pVolDesc->pCbio;					/* pointer to CBIO device */    FAST uint32_t		srcSecNum = pFd->pFileHdl->fatSector;    FAST uint32_t		dstSecNum;    FAST int			fatNum;		/* FAT copy number */         uint8_t		fsinfoBuf [8];    if (srcSecNum == 0)        return OK;    /* FAT copies synchronization might be disabled */    if ( ! pFatDesc->syncEnabled)    	return OK;    /*      * TBD: mirroring disabled (FAT32)     * ? Maybe it is worth adding callbacks to process CBIO write errors ?     */    for (fatNum = 1, dstSecNum = srcSecNum + pVolDesc->secPerFat;          fatNum < pVolDesc->nFats;          fatNum++, dstSecNum += pVolDesc->secPerFat)        {        if (cbioBlkCopy (pCbio, srcSecNum, dstSecNum, 1) != OK)            return ERROR;        /* ...??? */        }    if (pVolDesc->fatType == FAT32)        {        VX_TO_DISK_32 (pFatDesc->fatEntFreeCnt, &fsinfoBuf[0]);        VX_TO_DISK_32 (pFatDesc->groupAllocStart, &fsinfoBuf[4]);        if (OK != cbioBytesRW (pCbio, FSINFO_SEC_NUM, FSINFO_FREE_CLUSTS, 		(addr_t)fsinfoBuf, sizeof (fsinfoBuf), CBIO_WRITE, NULL))            return ERROR;        }    return OK;    } /* fat16MirrorSect *//********************************************************************************* fat16SyncToggle - toggle FAT copies mirroring.* * This routine enables/disables FAT copes mirroring. When mirroring* is enabled all reserved FAT copes are synchronized with active one.* * RETURNES: N/A.*/LOCAL void fat16SyncToggle    (    DOS_VOLUME_DESC_ID	pVolDesc,    BOOL	syncEnable    )    {    MS_FAT_DESC_ID	pFatDesc = (MS_FAT_DESC_ID)pVolDesc->pFatDesc;    block_t		srcSec, dstSec, secNum;    uint8_t		copyNum;        pFatDesc->syncEnabled = syncEnable;        if (! syncEnable)    	return;        /* synchronize FAT copies */        /* copy by one sector. It permits always one read - multi write */    srcSec = pFatDesc->fatStartSec +             pVolDesc->pFatDesc->activeCopyNum * pVolDesc->secPerFat;    for (secNum = 0; secNum < pVolDesc->secPerFat; secNum ++, srcSec ++ )    	{    	for (dstSec = pFatDesc->fatStartSec + secNum, copyNum = 0;	     copyNum < pVolDesc->nFats;	     dstSec += pVolDesc->secPerFat, copyNum ++ )    	    {    	    if (copyNum == pVolDesc->pFatDesc->activeCopyNum)    	    	continue;    	        	    cbioBlkCopy (pVolDesc->pCbio, srcSec, dstSec, 1);    	    }    	}    } /* fat16SyncToggle() *//********************************************************************************* fat12EntRead - read FAT entry from disk* * This routine reads the file allocation table (FAT) entry from a dosFs* volume.** This routine only reads from the first copy of the FAT on disk, even if* other copies exist.* * RETURNS: Contents of the entry, or FAT_CBIO_ERR if error accessing disk.*/LOCAL uint32_t fat12EntRead    (    FAST DOS_FILE_DESC_ID	pFd,	/* pointer to file descriptor */    FAST uint32_t		copyNum,/* fat copy number */    FAST uint32_t		cluster	/* entry number */    )    {    FAST DOS_VOLUME_DESC_ID	pVolDesc = pFd->pVolDesc;					/* pointer to volume descriptor */    FAST CBIO_DEV_ID		pCbio = pVolDesc->pCbio;					/* pointer to CBIO device */    FAST MS_FAT_DESC_ID	pFatDesc = (void *) pVolDesc->pFatDesc;					/* pointer to FAT descriptor */    FAST uint32_t		fatEntry;/* FAT entry */    FAST uint32_t		fatOff;	/* offset in the FAT */    FAST block_t		secNum;	/* sector number to read/write */    FAST off_t			secOff;	/* offset in the sector */    FAST uint32_t		nBytes;	/* number of bytes */         uint8_t		valBuf [2];					/* buffer for value in the entry */    assert ( copyNum < pVolDesc->nFats);    assert ( (cluster >= DOS_MIN_CLUST) && (cluster < pFatDesc->nFatEnts) );    /* Offset of the entry in the FAT in bytes */    fatOff = cluster + (cluster >> 1);	/* index = cluster * 1.5 */    /* Number of sector containing the entry */    secNum = pFatDesc->fatStartSec + copyNum * pVolDesc->secPerFat +            (fatOff >> pVolDesc->secSizeShift);    /* Offset of the entry in the sector */    secOff = fatOff & (pVolDesc->bytesPerSec - 1);    /* Number of bytes to read */    nBytes = pVolDesc->bytesPerSec - secOff;    if (nBytes > 2)        nBytes = 2;    /* Read entry from disk */    if (cbioBytesRW (pCbio, secNum, secOff, (addr_t)valBuf, nBytes, CBIO_READ, 				&pFd->fatHdl.cbioCookie) != OK)        {        pFd->fatHdl.errCode = FAT_CBIO_ERR;        return FAT_CBIO_ERR;				/* read error */        }    if (nBytes == 1)        if (cbioBytesRW (pCbio, secNum + 1, 0, (addr_t)(&valBuf[1]), 1, 				CBIO_READ, &pFd->fatHdl.cbioCookie) != OK)            {            pFd->fatHdl.errCode = FAT_CBIO_ERR;            return FAT_CBIO_ERR;			/* read error */            }    fatEntry = valBuf [0] | (valBuf [1] << 8);					/* copy word, swapping bytes */    if (cluster & 0x1)				/* if cluster number is ODD */        fatEntry = (fatEntry >> 4) & 0xfff;	/*  keep high order 12 bits */    else					/* if cluster number is EVEN */        fatEntry &= 0xfff;			/*  keep low order 12 bits */    return fatEntry;    } /* fat12EntRead *//********************************************************************************* fat12EntWrite - write FAT entry to disk* * This routine writes the file allocation table (FAT) entry to a dosFs* volume.** This routine reads the file allocation table (FAT) entry for the* specified cluster and returns it to the caller.** If the value to be written is too large to fit in a FAT entry* (12 bits), it is truncated (high order bits are discarded).** This routine only writes to the first copy of the FAT on disk, even if* other copies exist.* * RETURNS: OK, or ERROR if error accessing disk.*/LOCAL STATUS fat12EntWrite    (    FAST DOS_FILE_DESC_ID	pFd,	/* pointer to file descriptor */    FAST uint32_t		copyNum,/* fat copy number */    FAST uint32_t		cluster,/* entry number */    FAST uint32_t		value	/* value to write */    )    {    FAST DOS_VOLUME_DESC_ID	pVolDesc = pFd->pVolDesc;					/* pointer to volume descriptor */    FAST CBIO_DEV_ID		pCbio = pVolDesc->pCbio;					/* pointer to CBIO device */    FAST MS_FAT_DESC_ID	pFatDesc = (void *) pVolDesc->pFatDesc;					/* pointer to FAT descriptor */    FAST uint32_t		fatOff;	/* offset in the FAT */    FAST block_t		secNum;	/* sector number to read/write */    FAST off_t			secOff;	/* offset in the sector */    FAST uint32_t		nBytes;	/* number of bytes */         cookie_t    		cookie;	/* CBIO dev. cookie */         uint8_t		valBuf [2];					/* buffer for value in the entry */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久久久午夜片| 亚洲已满18点击进入久久| 中文字幕在线一区免费| 亚洲亚洲人成综合网络| 国产精品18久久久久久久网站| 91丨porny丨最新| 久久久亚洲精华液精华液精华液 | 精品欧美乱码久久久久久1区2区| 中文字幕av一区二区三区| 丝袜美腿一区二区三区| 色偷偷久久人人79超碰人人澡 | 亚洲猫色日本管| 国产一区二区按摩在线观看| 欧美一区二区三区在线看| 亚洲免费观看高清| 成人av在线资源网站| 久久久久久97三级| 久久精品国产亚洲5555| 91精品国产综合久久精品app | 精品中文字幕一区二区小辣椒| 在线看不卡av| 亚洲无线码一区二区三区| 色综合天天综合网天天看片| 中文字幕亚洲在| 不卡视频在线观看| 国产精品国产三级国产a| 国产精品一区二区在线看| 久久综合久久综合九色| 九九久久精品视频| 久久久夜色精品亚洲| 国产精品影视在线观看| 久久久久久久精| 国产精品18久久久久久久网站| 国产午夜亚洲精品午夜鲁丝片| 国产精品2024| 综合久久一区二区三区| 91浏览器入口在线观看| 亚洲一区二区三区四区在线免费观看| 91免费版pro下载短视频| 亚洲欧美日韩在线不卡| 欧美中文字幕一区| 麻豆国产91在线播放| 欧美成人一区二区三区在线观看| 精品一区二区三区影院在线午夜 | 精品入口麻豆88视频| 国产一区二区三区四区在线观看 | 成人av网站免费观看| 国产精品久久久久影院亚瑟| 99re在线视频这里只有精品| 一区二区三区在线播| 欧美高清视频在线高清观看mv色露露十八| 亚洲gay无套男同| 日韩一区二区免费视频| 国产99久久久国产精品免费看| 中文字幕亚洲区| 欧美伦理视频网站| 精品亚洲porn| 亚洲卡通动漫在线| 91精品国产黑色紧身裤美女| 国精产品一区一区三区mba视频| 国产日韩欧美综合一区| 91色porny在线视频| 蜜臀91精品一区二区三区| 2014亚洲片线观看视频免费| 91视频你懂的| 精品一区二区日韩| 亚洲乱码国产乱码精品精98午夜| 欧美人牲a欧美精品| 国产福利一区二区三区在线视频| 亚洲精品精品亚洲| 精品人伦一区二区色婷婷| 91视频免费播放| 国产一区二区调教| 一区二区三区影院| 久久久久久久电影| 欧美日韩激情在线| 波多野结衣在线aⅴ中文字幕不卡| 亚洲第一主播视频| 国产精品高潮久久久久无| 欧美成人vps| 欧美日本乱大交xxxxx| 丁香六月综合激情| 美女精品一区二区| 一区二区三区四区在线播放| 欧美国产一区在线| www激情久久| 欧美一区二区网站| 欧美日韩一区二区三区在线看| 国产成人av电影在线观看| 日韩av成人高清| 亚洲自拍偷拍欧美| 国产精品国产三级国产三级人妇| 日韩一区二区视频| 欧美日韩黄色一区二区| 日本丶国产丶欧美色综合| av在线不卡网| 丁香亚洲综合激情啪啪综合| 精品一区二区三区在线观看 | 亚洲乱码国产乱码精品精可以看 | 国产综合色精品一区二区三区| 亚洲国产精品人人做人人爽| 国产精品成人一区二区三区夜夜夜| 日韩视频在线一区二区| 欧美日韩久久久一区| 99九九99九九九视频精品| 国产精品69毛片高清亚洲| 国产一区二区三区av电影| 日本欧美一区二区三区乱码 | 亚洲激情一二三区| 自拍偷在线精品自拍偷无码专区 | 奇米精品一区二区三区四区| 亚洲一二三四在线| 亚洲国产精品一区二区久久恐怖片| 亚洲六月丁香色婷婷综合久久 | 制服丝袜日韩国产| 337p亚洲精品色噜噜狠狠| 欧美一级在线观看| 日韩欧美不卡一区| 久久只精品国产| 欧美国产丝袜视频| 日韩一区日韩二区| 亚洲一区二区高清| 婷婷久久综合九色国产成人| 日韩精品高清不卡| 国产在线精品一区二区不卡了| 国产乱码精品一区二区三区五月婷 | 国产精品一区二区在线播放| 国产宾馆实践打屁股91| 成人自拍视频在线| 99精品黄色片免费大全| 欧美综合天天夜夜久久| 欧美日韩一区二区欧美激情| 欧美天堂亚洲电影院在线播放| 欧美精品在欧美一区二区少妇| 日韩色在线观看| 久久精品视频免费观看| 中文字幕一区二区三区色视频| 中文字幕日韩一区二区| 亚洲一区二区三区美女| 日韩电影免费在线| 懂色av一区二区在线播放| 91福利在线导航| 欧美不卡在线视频| 《视频一区视频二区| 图片区日韩欧美亚洲| 国产一区视频导航| 91女人视频在线观看| 欧美裸体一区二区三区| 日本一区二区免费在线| 亚洲精品欧美专区| 久久国产精品无码网站| 99综合影院在线| 欧美一区二区三区爱爱| 中文字幕第一区| 亚洲二区在线视频| 国产精品一二二区| 欧美一区二区三区日韩| 国产精品国产三级国产普通话三级 | 在线免费不卡视频| 精品粉嫩超白一线天av| 亚洲乱码国产乱码精品精可以看| 久久99在线观看| 欧美日韩三级一区二区| 久久久午夜精品理论片中文字幕| 亚洲成人久久影院| k8久久久一区二区三区| 欧美成va人片在线观看| 亚洲成在线观看| 91丨porny丨首页| 国产亚洲精久久久久久| 奇米亚洲午夜久久精品| 欧美无砖专区一中文字| 中文字幕免费观看一区| 久久精品99国产精品| 欧美日本乱大交xxxxx| 亚洲桃色在线一区| 国产精品一二三区| 日韩三级免费观看| 亚洲高清免费观看| 一本色道久久加勒比精品| 久久精品人人做| 久久国产尿小便嘘嘘| 欧美日韩国产电影| 一区二区视频免费在线观看| av亚洲精华国产精华| 国产欧美一区在线| 国内精品国产三级国产a久久| 日韩欧美一级二级三级| 免费在线观看精品| 欧美一级日韩一级| 日本vs亚洲vs韩国一区三区二区| 欧美性高清videossexo| 亚洲日本一区二区三区| 99久久精品一区| 国产精品久久看| 国产风韵犹存在线视精品| 国产亚洲成aⅴ人片在线观看| 国产九色sp调教91| 久久久久久久久久电影| 国产精品一区二区男女羞羞无遮挡|