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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? dosfsfat.c

?? vxworks操作系統(tǒng)的文件系統(tǒng)部分原代碼
?? C
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
/* 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 */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
黄网站免费久久| 久久久久国产精品麻豆| 欧美在线小视频| 日本韩国欧美一区| 91在线播放网址| 色婷婷综合中文久久一本| 97成人超碰视| 色老头久久综合| 欧洲精品中文字幕| 欧美日韩一区在线观看| 欧美系列亚洲系列| 欧美巨大另类极品videosbest| 在线视频一区二区三区| 欧美伊人久久大香线蕉综合69| 色综合激情五月| 欧美日韩国产免费一区二区| 4hu四虎永久在线影院成人| 欧美一卡二卡在线| 精品美女一区二区| 国产色综合久久| 国产精品久久午夜夜伦鲁鲁| 亚洲品质自拍视频| 亚洲国产成人av网| 免费人成在线不卡| 久久99深爱久久99精品| 国产精品456| 91丨国产丨九色丨pron| 欧美日韩一级视频| 91精品国产综合久久久久久久久久| 日韩一区二区三区精品视频| 国产欧美一区二区精品性色超碰 | 欧美精选在线播放| 日韩欧美国产1| 国产精品美女久久久久久 | 国产精品亚洲一区二区三区在线| 成人午夜电影网站| 欧美日韩一区三区| 精品日韩成人av| 1000精品久久久久久久久| 亚洲高清久久久| 国内成人自拍视频| 色狠狠色噜噜噜综合网| 欧美一区二区三区视频免费| 国产精品美女久久久久久久网站| 亚洲成av人片www| 国精产品一区一区三区mba视频| 成人一级黄色片| 亚洲视频网在线直播| 性做久久久久久免费观看欧美| 另类调教123区| 97精品超碰一区二区三区| 7777精品伊人久久久大香线蕉 | 精品福利在线导航| 亚洲免费毛片网站| 国产呦萝稀缺另类资源| 一本一道综合狠狠老| 欧美成人video| 一区二区三区四区在线播放| 韩日欧美一区二区三区| 色婷婷狠狠综合| 国产欧美视频一区二区| 视频精品一区二区| 成人黄色大片在线观看| 欧美一区二区三区在线看| 亚洲人成小说网站色在线| 国产一区二区伦理| 欧美日本一区二区三区| 椎名由奈av一区二区三区| 极品少妇一区二区| 欧美色爱综合网| 国产精品情趣视频| 国产麻豆精品一区二区| 欧美一区二区视频网站| 亚洲中国最大av网站| 成人三级在线视频| 精品国产三级a在线观看| 五月天一区二区三区| 9人人澡人人爽人人精品| 久久噜噜亚洲综合| 日韩高清在线不卡| 欧洲av一区二区嗯嗯嗯啊| 中文字幕永久在线不卡| 国产精品一区二区91| 欧美日韩一区二区欧美激情 | 成人av在线一区二区三区| 精品播放一区二区| 美女精品自拍一二三四| 在线不卡一区二区| 亚洲国产毛片aaaaa无费看| 91免费版在线| 久久99热国产| 欧美一区二区三区色| 亚洲永久免费视频| 在线免费不卡电影| 亚洲精品久久久蜜桃| 91视视频在线直接观看在线看网页在线看 | 欧美中文字幕一区二区三区 | 久久久久久久综合色一本| 久久精品国内一区二区三区| 91精品久久久久久久91蜜桃| 午夜成人在线视频| 7777精品伊人久久久大香线蕉的 | 国产成人精品免费网站| 久久婷婷成人综合色| 欧美a一区二区| 91精品欧美综合在线观看最新| 亚洲成在线观看| 欧美巨大另类极品videosbest| 亚洲成年人影院| 欧美精品日韩一本| 美女视频第一区二区三区免费观看网站 | 欧美色区777第一页| 午夜精品国产更新| 欧美一区二区三区免费| 麻豆传媒一区二区三区| 精品福利av导航| 福利91精品一区二区三区| 日韩一区日韩二区| 欧美日韩在线一区二区| 免费在线观看一区| 久久久精品天堂| 91亚洲大成网污www| 亚洲精品菠萝久久久久久久| 精品1区2区3区| 精品在线视频一区| 国产精品欧美久久久久无广告| 99精品视频中文字幕| 亚洲成精国产精品女| 日韩欧美国产一区二区在线播放| 国产精品一区二区不卡| 亚洲你懂的在线视频| 欧美日韩国产高清一区二区| 韩国精品一区二区| 最新日韩av在线| 精品视频1区2区| 国产精品主播直播| 一区二区三区在线观看国产| 日韩欧美黄色影院| 99免费精品视频| 日韩国产欧美三级| 久久久精品国产免费观看同学| 97久久超碰国产精品| 免费在线观看精品| 中文字幕亚洲视频| 欧美一区2区视频在线观看| 国产成人av一区二区三区在线观看| 亚洲日本欧美天堂| 日韩视频在线你懂得| 99久久久国产精品免费蜜臀| 日本午夜一本久久久综合| 中文乱码免费一区二区| 欧美群妇大交群的观看方式| 国产一区二区三区蝌蚪| 亚洲一区在线视频观看| 国产香蕉久久精品综合网| 欧美性受xxxx| 风间由美性色一区二区三区| 五月婷婷激情综合| 国产精品九色蝌蚪自拍| 日韩视频一区二区三区| 91小宝寻花一区二区三区| 欧美色大人视频| 国产电影精品久久禁18| 天天综合网 天天综合色| 国产精品五月天| 日韩欧美在线综合网| 色偷偷88欧美精品久久久| 国产精品亚洲一区二区三区妖精| 亚洲综合色区另类av| 国产亲近乱来精品视频| 欧美一区二区三区视频免费 | 欧美日韩综合在线| 国产 欧美在线| 美女看a上一区| 亚洲福中文字幕伊人影院| 中文字幕永久在线不卡| 久久久久久免费毛片精品| 69成人精品免费视频| 色综合久久久久综合体| 成人的网站免费观看| 韩国精品一区二区| 美女在线一区二区| 亚洲国产精品欧美一二99| 亚洲色图色小说| 国产精品动漫网站| 国产欧美视频一区二区三区| 精品久久久久久亚洲综合网 | 亚洲人成7777| 中文字幕 久热精品 视频在线| 日韩亚洲欧美高清| 欧美高清激情brazzers| 欧美性猛交xxxxxx富婆| 色哟哟日韩精品| 91在线视频在线| 99久久精品国产精品久久| 成人免费高清视频在线观看| 国产传媒日韩欧美成人| 国产剧情一区在线| 国产剧情av麻豆香蕉精品| 国内精品嫩模私拍在线|