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

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

?? fatfilt.c

?? M-System DOC(Disk on a Chip) Flash芯片的診斷工具, 可以從Flash芯片中獲取特定的數據信息, 用于判斷芯片當前的狀態.
?? C
?? 第 1 頁 / 共 4 頁
字號:




#ifdef FL_INCLUDE_FAT_MONITOR

/* --------------------------------------------------------------------------- *
 *                                                                             *
 *                     p a r t E n a b l e F F                                 *
 *                                                                             * 
 *  Installs and enables FAT filter on partition.                              * 
 *                                                                             * 
 *  Parameters:                                                                * 
 *    pv            : disk partition (filesystem volume)                   * 
 *                                                                             * 
 *  Returns:                                                                   * 
 *      flOK on success, otherwise error code                                  * 
 *                                                                             * 
 *  NOTE:  This routine uses disk's scratch buffer.                            * 
 *                                                                             * 
 * --------------------------------------------------------------------------- */

static FLStatus  partEnableFF ( FLffVol * pv )
{
    int        socNo, diskNo;
    FLffDisk * pd;
    BPB      * bpb;
    SectorNo   sectors;
    SectorNo   reservedSectors;
    SectorNo   rootDirSecNo;
    SectorNo   rootDirSectors;
    SectorNo   sectorsPerFAT;
    SectorNo   rootDirEntries;
    unsigned   maxCluster;
    int        partNo;
    IOreq      ioreq;

#ifdef  FL_MALLOC
    FLSByte     * buf;
#else
    FLSByte       buf[FL_SECTOR_SIZE];
#endif

    DBG_PRINT_FLOW(FLZONE_FS,"Debug: (partEnableFF) checking FAT type.\r\n");

    /* arg. sanity check */

    if (pv == NULL)
        return flBadDriveHandle;
 
    /* break TFFS handle into socket# and disk#, and do sanity check */

    socNo  = H2S(pv->handle);
    diskNo = H2D(pv->handle);
 
    if ((socNo >= ((int) noOfSockets)) || (diskNo >= FL_MAX_TL_PARTITIONS))
        return flBadDriveHandle;

    /* check if 'pv' belongs to this disk */

    pd = ffDisk[socNo][diskNo];

    if (pd == NULL)
        return flBadDriveHandle;

    for (partNo = 0; partNo < pd->parts; partNo++) {

        if (pd->part[partNo] == pv)
        break;
    }

    if (partNo >= pd->parts)
        return flBadDriveHandle;

#ifdef  FL_MALLOC

    /* make sure scratch buffer is available */

    if (pd->buf == NULL)
        return flBufferingError;

    buf = pd->buf;
 
#endif /* FL_MALLOC */ 

    /* make sure FAT filter is off on this partition */

    pv->ffEnabled       = FALSE;

    pv->firstFATsecNo   = (SectorNo) -1;
    pv->lastFATsecNo    = pv->firstFATsecNo;
    pv->clusterSize     = (unsigned) 0;

    /* read BPB */

    ioreq.irHandle      = pv->handle;
    ioreq.irSectorNo    = pv->startSecNo;
    ioreq.irSectorCount = (SectorNo) 1;
    ioreq.irData        = (void FAR1 *) buf;
    checkStatus( flAbsRead(&ioreq) );

    /* Does it look like DOS bootsector ? */

    bpb = &( ((DOSBootSector *) buf)->bpb );

    if( !((bpb->jumpInstruction[0] == 0xe9) 
            || 
         ((bpb->jumpInstruction[0] == 0xeb) && (bpb->jumpInstruction[2] == 0x90)))) {

        return flNonFATformat;
    }

    /* Do we handle this sector size ? */

    if (UNAL2(bpb->bytesPerSector) != FL_SECTOR_SIZE)
        return flFormatNotSupported;

    /* 
     * Is it a bogus BPB (leftover from previous disk partitioning) ? 
     * Check that there is no overlap with next partition (if one exists).
     */

    sectors = UNAL2(bpb->totalSectorsInVolumeDOS3);

    if (sectors == (SectorNo)0)
        sectors = (SectorNo) LE4(bpb->totalSectorsInVolume);

    if ((partNo+1 < pd->parts) && (pd->part[partNo+1] != NULL)) {

        if( sectors > (pd->part[partNo+1])->startSecNo - pv->startSecNo )
            return flNonFATformat;
    }

    /* number of sectors in partition as reported by BPB */

    pv->sectors = sectors;

    /* get number of reserved sectors from BPB, and check it's sanity */

    reservedSectors = (SectorNo) LE2(bpb->reservedSectors);

    switch( (int)reservedSectors ) {

        case 32:      /* always the case with FAT 32 */

#ifndef FL_INCLUDE_FAT32

            DBG_PRINT_FLOW(FLZONE_FS,"Debug: (partEnableFF) FAT32 detected.\r\n");
            return flFormatNotSupported;
#endif

        case 1:       /* must always be the case for FAT 12 and FAT16 */
        default:

            break;
    }

    /* get location and size of the first FAT copy */

    pv->firstFATsecNo = pv->startSecNo + reservedSectors;

    sectorsPerFAT = (SectorNo) LE2(bpb->sectorsPerFAT);

#ifndef FL_INCLUDE_FAT32

    if (sectorsPerFAT == 0) {        /* always the case with FAT32 */

        DBG_PRINT_FLOW(FLZONE_FS,"Debug: (partEnableFF) FAT32 detected.\r\n");
        return flFormatNotSupported;
    }

#endif

    pv->lastFATsecNo = pv->firstFATsecNo + sectorsPerFAT - (SectorNo)1;

    /* get location and size of root directory */

    rootDirSecNo = pv->firstFATsecNo + (sectorsPerFAT * bpb->noOfFATS);

    rootDirEntries = (SectorNo) UNAL2(bpb->rootDirectoryEntries);

    switch (rootDirEntries) {

#ifndef FL_INCLUDE_FAT32

        case 0:            /* always the case with FAT32 */

            DBG_PRINT_FLOW(FLZONE_FS,"Debug: (partEnableFF) FAT32 detected.\r\n");
            return flFormatNotSupported;
#endif
    
        default:

            if( ((rootDirEntries * DIRECTORY_ENTRY_SIZE) % FL_SECTOR_SIZE) != 0 )
                return flNonFATformat;
            break;
    }

    rootDirSectors = (SectorNo)(((rootDirEntries * DIRECTORY_ENTRY_SIZE) - 1) / FL_SECTOR_SIZE) +
                             (SectorNo)1;

    /* get location of data area */

    pv->firstDataSecNo = rootDirSecNo + rootDirSectors;

    /* get size of FAT cluster in sectors, and check it's sanity */

    pv->clusterSize = bpb->sectorsPerCluster;

    switch( (int)pv->clusterSize ) {

        case 1: case 2: case 4: case 8: case 16: case 32: case 64: case 128:  
            break;

        default:
            return flNonFATformat;
    }

    if ((pv->clusterSize << FL_SECTOR_SIZE_BITS) > (32768 /*(32 * 1024)*/))
        return flFormatNotSupported;

    /* sanity check */

    if( (pv->lastFATsecNo   < pv->firstFATsecNo)  ||
        (pv->firstDataSecNo <= pv->lastFATsecNo)  ||  
        (pv->sectors        < pv->firstDataSecNo) )
        return flNonFATformat;


    /* decide which type of FAT is it */

    maxCluster         = (unsigned)1 + (unsigned) 
        ((pv->sectors - (pv->firstDataSecNo - pv->startSecNo)) / pv->clusterSize);

    if (maxCluster < 4085) {

        pv->flags |= VOLUME_12BIT_FAT;    /* 12-bit FAT */

#ifndef FAT_12BIT

        DBG_PRINT_ERR(FLZONE_FS,"ERROR - FAT_12BIT must be defined.\r\n");
        return flFormatNotSupported;

#else

        DBG_PRINT_FLOW(FLZONE_FS,"Debug: (partEnableFF) FAT12 detected.\r\n");

#endif /* FAT_12BIT */
    }
    else {

        DBG_PRINT_FLOW(FLZONE_FS,"Debug: (partEnableFF) FAT16 detected.\r\n");
    }

    /* turn on FAT filter on this partition */

    pv->ffEnabled = TRUE;

    return flOK;
}




/* --------------------------------------------------------------------------- *
 *                                                                             *
 *                   p a r t F r e e D e l C l u s t e r s                     *
 *                                                                             * 
 *  Compare the new contents of the specified FAT sector against the old       * 
 *  one on the disk. If any freed clusters are found, issue 'sector delete'    * 
 *  calls for all sectors that are occupied by these freed clusters.           * 
 *                                                                             * 
 *  Parameters:                                                                * 
 *    pv            : disk partition (filesystem volume)                   * 
 *      secNo           : abs. sector # of the FAT sector                      * 
 *      newFAT          : new contents of this FAT sector                      * 
 *                                                                             * 
 *  Returns:                                                                   * 
 *      flOK on success, otherwise error code                                  * 
 *                                                                             * 
 *  NOTE:  This routine uses disk's scratch buffer.                            * 
 *                                                                             * 
 * --------------------------------------------------------------------------- */

static FLStatus  partFreeDelClusters ( FLffVol   * pv,
                                       SectorNo    secNo,
                                       FLSByte FAR1 * newFAT)
{
    FLffDisk * pd;
    int        socNo, diskNo;
    FLWord     oldFATentry, newFATentry;
    SectorNo   iSec;
    unsigned   firstCluster;
    IOreq      ioreq;
    int        offset;
    int        iPart;

#ifdef FAT_12BIT
    int        halfBytes;
#endif

#ifdef  FL_MALLOC
    FLSByte     * oldFAT;
#else
    FLSByte       oldFAT[FL_SECTOR_SIZE];
#endif

    /* arg. sanity check */

    if (pv == NULL)
        return flBadDriveHandle;
 
    /* break TFFS handle into socket# and disk#, and do sanity check */

    socNo  = H2S(pv->handle);
    diskNo = H2D(pv->handle);
 
    if ((socNo >= ((int) noOfSockets)) || (diskNo >= FL_MAX_TL_PARTITIONS))
        return flBadDriveHandle;

    /* check if 'pv' belongs to this disk */

    pd = ffDisk[socNo][diskNo];

    if (pd == NULL)
        return flBadDriveHandle;

    for (iPart = 0; iPart < pd->parts; iPart++) {

        if (pd->part[iPart] == pv)
        break;
    }

    if (iPart >= pd->parts)
        return flBadDriveHandle;

#ifdef  FL_MALLOC

    /* make sure scratch buffer is available */

    if (pd->buf == NULL)
        return flBufferingError;

    oldFAT = pd->buf;
 
#endif /* FL_MALLOC */

    /* read in the FAT sector from the disk */

    ioreq.irHandle      = pv->handle;
    ioreq.irSectorNo    = secNo;
    ioreq.irSectorCount = 1;
    ioreq.irData        = (void FAR1 *) oldFAT;
    checkStatus( flAbsRead(&ioreq) );

#ifdef FAT_12BIT

    /* size of FAT entry in half-bytes */

    halfBytes = ((pv->flags & VOLUME_12BIT_FAT) ? 3 : 4);

    /* starting cluster */

    if (halfBytes == 3) {

    firstCluster = 
            ((((unsigned)(secNo - pv->firstFATsecNo)) * (2 * FL_SECTOR_SIZE)) + 2) / 3;
    }
    else {
        firstCluster = ((unsigned)(secNo - pv->firstFATsecNo)) * (FL_SECTOR_SIZE / 2);
    }

    /* staring data sector */

    iSec = (((SectorNo)firstCluster - 2) * pv->clusterSize) + pv->firstDataSecNo;

    offset = (firstCluster * ((unsigned) halfBytes)) & ((2 * FL_SECTOR_SIZE) - 1);

    /* 
     *  Find if any clusters were logically deleted, and if so, delete them.
     *
     *  NOTE: We are skipping over 12-bit FAT entries which span more than
     *        one sector.
     */

    for (; offset < ((2 * FL_SECTOR_SIZE) - 2); 
               offset += halfBytes, iSec += pv->clusterSize) {

#ifdef FL_BIG_ENDIAN
        oldFATentry = LE2( *(LEushort FAR0 *)(oldFAT + (offset / 2)) );
        newFATentry = LE2( *(LEushort FAR1 *)(newFAT + (offset / 2)) );
#else
        oldFATentry = UNAL2( *(Unaligned FAR0 *)(oldFAT + (offset / 2)) );
        newFATentry = UNAL2( *(Unaligned FAR1 *)(newFAT + (offset / 2)) );
#endif /* FL_BIG_ENDIAN */

        if (offset & 1) {
            oldFATentry >>= 4;
            newFATentry >>= 4;
        }
        else { 
            if (halfBytes == 3) {
                oldFATentry &= 0xfff;
                newFATentry &= 0xfff;
        }
        }

#else /* !FAT_12BIT */

    firstCluster = ((unsigned) (secNo - pv->firstFATsecNo) * (FL_SECTOR_SIZE / 2));
    iSec  = pv->firstDataSecNo + 
            (((SectorNo)(firstCluster - (unsigned)2)) * pv->clusterSize);

    /* Find if any clusters were logically deleted, and if so, delete them */

    for (offset = 0;  offset < FL_SECTOR_SIZE;  offset += 2, iSec += pv->clusterSize) {

        oldFATentry = LE2( *(LEushort FAR0 *)(oldFAT + offset) );
        newFATentry = LE2( *(LEushort FAR1 *)(newFAT + offset) );

#endif /* FAT_12BIT */

        if ((oldFATentry != FAT_FREE) && (newFATentry == FAT_FREE)) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美三级韩国三级日本三斤| 亚洲精品国产a久久久久久| 91精品午夜视频| 欧美性大战久久| 94色蜜桃网一区二区三区| 成人性色生活片| 成人黄色大片在线观看| 成人动漫一区二区在线| 成人免费看视频| 波多野结衣亚洲| 91在线视频在线| 免费观看日韩av| 老司机精品视频在线| 日韩精品亚洲一区二区三区免费| 亚洲欧美日韩中文字幕一区二区三区 | 亚洲电影激情视频网站| 亚洲同性同志一二三专区| 国产欧美1区2区3区| www国产成人| 日韩美女主播在线视频一区二区三区| 欧美军同video69gay| 欧美三级午夜理伦三级中视频| 92精品国产成人观看免费| 91日韩精品一区| 色婷婷久久久久swag精品 | 国产精品久久毛片av大全日韩| 国产精品丝袜久久久久久app| 国产欧美一区二区在线| 日韩毛片精品高清免费| 亚洲欧美成aⅴ人在线观看| 成人永久免费视频| 亚洲午夜精品在线| 日本成人在线一区| 精品一区二区在线观看| 久久99深爱久久99精品| 国产精品一区二区三区99| 不卡一区二区中文字幕| 一本色道**综合亚洲精品蜜桃冫 | 精品88久久久久88久久久| 久久蜜桃av一区二区天堂| 国产精品动漫网站| 亚洲综合自拍偷拍| 国产在线看一区| 高清久久久久久| 一本到三区不卡视频| 精品视频一区二区不卡| 99久久777色| 日韩欧美中文一区二区| 国产欧美日产一区| 国产午夜亚洲精品午夜鲁丝片| 日本一二三四高清不卡| 亚洲精品日韩专区silk| 日本不卡高清视频| 粉嫩av一区二区三区粉嫩| 色婷婷精品大在线视频| 欧美人与禽zozo性伦| 精品国产乱码久久久久久久 | 久久综合中文字幕| 国产精品网站在线| 亚洲一级二级三级| 蜜臀va亚洲va欧美va天堂| 国产成人啪免费观看软件| 色狠狠综合天天综合综合| 69精品人人人人| 日本一区二区成人| 日韩激情在线观看| 99久久夜色精品国产网站| 欧美精品日韩精品| 国产精品水嫩水嫩| 亚洲一级二级三级在线免费观看| 国产成人免费av在线| 欧美日韩一区不卡| 国产欧美一区二区精品仙草咪| 亚洲综合色在线| 国产精品一级片在线观看| 欧美视频在线播放| 欧美刺激脚交jootjob| 亚洲高清三级视频| 国产盗摄一区二区| 欧美一区二区三区影视| 中文字幕一区二区三中文字幕| 日韩成人免费电影| 91日韩一区二区三区| 精品日韩一区二区| 亚洲一区二区三区三| 国产成人aaaa| 91精品国产高清一区二区三区 | 亚洲bt欧美bt精品| 在线亚洲+欧美+日本专区| www成人在线观看| 久久99在线观看| 在线一区二区视频| 亚洲人成精品久久久久久 | 5566中文字幕一区二区电影| 中文字幕一区不卡| 波多野洁衣一区| 国产亚洲成av人在线观看导航| 国内一区二区视频| 欧美电影免费观看高清完整版在线观看| 欧美性极品少妇| 中文字幕五月欧美| 91网站最新地址| 国产欧美日韩在线| 高清不卡一二三区| 国产午夜亚洲精品羞羞网站| 国产成人丝袜美腿| 精品99久久久久久| 久久99精品久久久久久久久久久久 | 久久精品国产成人一区二区三区 | 91成人免费网站| 亚洲高清视频的网址| 成人性生交大片免费看中文网站| 日本一区二区视频在线| 蜜桃视频一区二区三区 | 亚洲欧美另类久久久精品| 97超碰欧美中文字幕| 亚洲永久免费av| wwwwww.欧美系列| 91麻豆精品国产91久久久使用方法| 亚洲蜜臀av乱码久久精品蜜桃| 国产精品1区2区3区在线观看| 国产欧美日韩不卡免费| 国产高清精品久久久久| 亚洲欧洲av一区二区三区久久| 成人免费三级在线| 国产人久久人人人人爽| av资源站一区| 亚洲视频一二三| 99re在线精品| 玉米视频成人免费看| 91美女视频网站| 一区二区三区国产豹纹内裤在线| 亚洲一级二级在线| 成人激情免费视频| 中文字幕一区二区三区色视频| 99久久99久久精品国产片果冻| 亚洲欧美一区二区三区久本道91| 精品视频123区在线观看| 夜夜嗨av一区二区三区四季av| 欧美一区二区三区四区五区| 久久99精品一区二区三区三区| 国产日韩精品视频一区| 波多野结衣在线aⅴ中文字幕不卡| 亚洲最大成人网4388xx| 欧美剧在线免费观看网站| 国产一区二区在线免费观看| 精品福利在线导航| 成人高清伦理免费影院在线观看| 国产精品不卡在线| 国产在线国偷精品产拍免费yy| 欧美午夜精品一区| 日韩专区一卡二卡| 欧美大片日本大片免费观看| 成人app下载| 亚洲猫色日本管| 日韩视频一区二区在线观看| 懂色av一区二区夜夜嗨| 一区二区三区在线免费视频| 日韩精品专区在线影院重磅| 成人蜜臀av电影| 麻豆国产精品777777在线| 欧美国产1区2区| 91精品国产综合久久精品图片 | 久久久久久夜精品精品免费| 色屁屁一区二区| 免费观看在线综合| 一区二区三区日韩欧美精品| 91精品国产美女浴室洗澡无遮挡| 91在线观看一区二区| 亚洲一区二区三区四区在线免费观看| 久久免费视频一区| 欧美精品第一页| 成人激情免费视频| 韩国欧美国产一区| 亚洲午夜激情av| 最新久久zyz资源站| 91精品免费在线| 在线精品亚洲一区二区不卡| 麻豆精品国产传媒mv男同| 亚洲国产日韩一级| 亚洲欧洲日产国码二区| 欧美刺激午夜性久久久久久久| 欧美影院午夜播放| 99热这里都是精品| 懂色av噜噜一区二区三区av| 一级女性全黄久久生活片免费| 国产欧美一区二区精品性色| 制服丝袜亚洲精品中文字幕| 91女人视频在线观看| 久久精品国产亚洲a| 无码av中文一区二区三区桃花岛| 成人免费在线视频| 2014亚洲片线观看视频免费| 日韩精品自拍偷拍| 欧美三级在线视频| 欧美日韩中文精品| 成人黄色免费短视频| 国产成人在线视频播放| 日韩和的一区二区| 一区二区三区加勒比av|