亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
在线视频国产一区| 亚洲福利一区二区| 国产黄色91视频| 久久久亚洲午夜电影| 国产在线精品不卡| 国产亚洲综合色| 成人高清视频在线观看| 国产精品伦理一区二区| 色综合久久久久综合体桃花网| 亚洲人吸女人奶水| 欧美日韩在线播| 国产在线看一区| 亚洲欧洲av在线| 欧美美女一区二区在线观看| 另类综合日韩欧美亚洲| 国产精品美女久久久久久久久| 色综合久久天天综合网| 日本欧美加勒比视频| 日本一区二区三区dvd视频在线| 91麻豆精品一区二区三区| 亚洲成人黄色小说| 久久久久99精品一区| 欧日韩精品视频| 精品无人码麻豆乱码1区2区| 中文字幕av免费专区久久| 欧美综合欧美视频| 国模少妇一区二区三区| 亚洲男人的天堂av| 精品入口麻豆88视频| 99久久久久久| 久草精品在线观看| 一区二区三区中文字幕精品精品| 欧美精品色综合| 成+人+亚洲+综合天堂| 欧美在线免费观看亚洲| 久久国产精品区| 亚洲精品国产精华液| 精品剧情在线观看| 欧美午夜精品一区二区蜜桃| 国产综合成人久久大片91| 亚洲丰满少妇videoshd| 久久久久国产免费免费| 欧美一区二区视频在线观看 | 国产一区二区日韩精品| 亚洲精品高清视频在线观看| 精品国产一区二区三区久久久蜜月 | 国产成a人亚洲精品| 亚洲电影视频在线| 国产精品福利影院| 日韩视频一区二区| 欧美三级午夜理伦三级中视频| 国产成人免费视频网站高清观看视频 | 久久精品国产免费看久久精品| 国产精品久久综合| 精品不卡在线视频| 欧美剧情电影在线观看完整版免费励志电影 | 在线成人免费观看| av亚洲精华国产精华| 九九久久精品视频| 亚洲福利电影网| 一区二区三区四区视频精品免费| 久久久噜噜噜久久人人看| 欧美精品一二三区| 欧美在线你懂的| 日本高清视频一区二区| 成人网男人的天堂| 激情综合网天天干| 久久国产乱子精品免费女| 日本在线不卡视频一二三区| 一区二区三区在线免费| 成人欧美一区二区三区小说| 国产视频一区二区在线观看| 精品国产一区二区在线观看| 日韩一区国产二区欧美三区| 欧美精品高清视频| 91 com成人网| 538prom精品视频线放| 欧美日韩精品欧美日韩精品| 日本久久精品电影| 色又黄又爽网站www久久| 91在线视频免费91| av动漫一区二区| 97精品国产露脸对白| 97久久超碰国产精品| 色综合久久综合| 欧美日韩中字一区| 在线播放91灌醉迷j高跟美女| 欧美福利一区二区| 91精品国产入口在线| 日韩一区二区高清| 精品少妇一区二区三区在线播放| 精品国产乱码久久久久久久久| 欧美一级欧美三级| 久久影院午夜片一区| 久久免费看少妇高潮| 国产日韩av一区二区| 国产精品久线观看视频| 亚洲美女视频一区| 亚洲成人自拍一区| 麻豆精品久久精品色综合| 久久国产精品无码网站| 国产99久久久久| 一本一本大道香蕉久在线精品 | 亚洲三级在线观看| 亚洲第一福利一区| 久久99久久99| 成人在线综合网| 欧美午夜一区二区三区免费大片| 91精品国产免费| 国产片一区二区三区| 亚洲精品成人少妇| 美女脱光内衣内裤视频久久网站| 国产精品99久| 欧美在线观看视频一区二区 | 在线免费精品视频| 日韩免费高清视频| 亚洲欧美日韩国产一区二区三区| 亚洲国产精品天堂| 国产在线国偷精品产拍免费yy| 97se亚洲国产综合自在线不卡| 欧美男女性生活在线直播观看| 久久亚洲综合色一区二区三区 | 欧美色手机在线观看| 日韩午夜激情av| 综合激情成人伊人| 毛片av一区二区| 色综合天天综合给合国产| 日韩限制级电影在线观看| 亚洲视频在线一区| 精品一区二区日韩| 91福利精品第一导航| 久久奇米777| 婷婷夜色潮精品综合在线| 国产成人自拍网| 欧美一区二区三区在线观看 | 精品国产一区二区三区忘忧草| 亚洲精品大片www| 高清国产午夜精品久久久久久| 欧美美女直播网站| 亚洲品质自拍视频| 丁香亚洲综合激情啪啪综合| 91精品中文字幕一区二区三区| 国产精品久久久久久久午夜片| 美女性感视频久久| 欧美日韩免费一区二区三区 | 亚洲国产精品一区二区久久恐怖片| 成人性生交大片免费看视频在线| 51精品视频一区二区三区| 亚洲激情自拍视频| 粉嫩一区二区三区性色av| 日韩欧美国产wwwww| 亚洲第一主播视频| 在线视频一区二区三| 国产精品色婷婷| 国内成+人亚洲+欧美+综合在线| 51精品视频一区二区三区| 亚洲午夜三级在线| 色婷婷久久综合| 亚洲人成伊人成综合网小说| 成人性生交大片| 国产精品久久福利| 丁香六月综合激情| 中文字幕成人在线观看| 国产毛片精品国产一区二区三区| 日韩一级精品视频在线观看| 日韩一区精品字幕| 7777精品伊人久久久大香线蕉完整版 | 成人综合婷婷国产精品久久蜜臀| 精品av综合导航| 狠狠久久亚洲欧美| 久久伊人中文字幕| 国产精品资源网| 国产性天天综合网| 国产精品综合av一区二区国产馆| 久久综合九色综合欧美亚洲| 国产在线播放一区三区四| 精品国产成人系列| 国产在线视视频有精品| 久久精品水蜜桃av综合天堂| 国产精品亚洲一区二区三区妖精| 久久久久久9999| 丁香网亚洲国际| 成人免费小视频| 色婷婷精品大在线视频| 一区二区三区精品| 欧美日韩在线观看一区二区| 热久久一区二区| 337p粉嫩大胆噜噜噜噜噜91av| 国产精品资源网| 亚洲乱码国产乱码精品精小说| 在线精品视频免费观看| 亚洲一级二级在线| 91麻豆精品国产自产在线观看一区| 日本成人中文字幕| 26uuu久久天堂性欧美| 懂色av中文字幕一区二区三区| 亚洲精品成人精品456| 91精品国产综合久久精品图片| 国内精品国产三级国产a久久| 国产精品久久久久一区二区三区|