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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? nftllite.c

?? Nandflash翻譯層源代碼,在論壇上下載的
?? C
?? 第 1 頁 / 共 5 頁
字號:
      else
	vol.mappedSector = vol.flash.map(&vol.flash,vol.mappedSectorAddress,SECTOR_SIZE);
    }
    vol.mappedSectorNo = sectorNo;
    vol.flash.socket->remapped = FALSE;
  }

  if (physAddress)
    *physAddress = vol.mappedSectorAddress;

  return vol.mappedSector;
}


/* Mounting and formatting */

#define UNIT_ORPHAN	0x10

/*----------------------------------------------------------------------*/
/*		           m o u n t U n i t				*/
/*									*/
/* Mount one unit. Read the relevant data from the unit header and 	*/
/* update the conversion tables. 					*/
/*                                                                      */
/* Parameters:                                                          */
/*	vol		: Pointer identifying drive			*/
/*	unitNo		: Unit to mount					*/
/*                                                                      */
/* Returns:                                                             */
/*	FLStatus	: 0 on success, failed otherwise		*/
/*----------------------------------------------------------------------*/

static FLStatus mountUnit(Anand vol, UnitNo unitNo)
{
  UnitNo virtualUnitNo, replacementUnitNo;
  unsigned short eraseMark;
  unsigned long eraseCount;
  PhysUnit *pU = &vol.physicalUnits[unitNo];

  getUnitData(&vol,unitNo,&virtualUnitNo,&replacementUnitNo);
  getUnitTailer(&vol,unitNo,&eraseMark,&eraseCount);

  if (virtualUnitNo == NO_UNIT ||
      eraseMark != ERASE_MARK) {  /* this unit is not assigned */
    *pU = UNIT_FREE;
  }
  else {  /* this unit is assigned */
    *pU &= UNIT_AVAILABLE | UNIT_ORPHAN;
    if (replacementUnitNo < vol.noOfUnits) {
      *pU |= UNIT_REPLACED;
      if (vol.physicalUnits[replacementUnitNo] & (UNIT_AVAILABLE | UNIT_REPLACED))
	/* Mark replacement unit as non-orphan */
	vol.physicalUnits[replacementUnitNo] &= ~UNIT_ORPHAN;
    }
    if (!(virtualUnitNo & REPLACING_UNIT)) {
      unsigned short foldMark;
      UnitNo physUnitNo;

      if (virtualUnitNo >= vol.noOfVirtualUnits)
	return flBadFormat;

      foldMark = getFoldMark(&vol,unitNo);
      physUnitNo = vol.virtualUnits[virtualUnitNo];
      if (foldMark == FOLDING_COMPLETE)
	formatChain(&vol,unitNo);
      else if (physUnitNo == NO_UNIT || !(vol.physicalUnits[physUnitNo] & UNIT_AVAILABLE)) {
	/* If we have duplicates, it's OK if one of them is currently folded */
	vol.virtualUnits[virtualUnitNo] = unitNo;
	*pU &= ~UNIT_ORPHAN;

	if (foldMark == FOLDING_IN_PROGRESS)
	  *pU &= ~UNIT_AVAILABLE;
	if (physUnitNo != NO_UNIT)
	  formatChain(&vol,physUnitNo);	/* Get rid of old chain */
      }
      else if (foldMark == FOLDING_IN_PROGRESS)
	formatChain(&vol,unitNo);
      else
	return flBadFormat;	/* We have a duplicate to a unit that */
				/* is not currently folded. That's bad. */
    }
  }

  return flOK;
}


/*----------------------------------------------------------------------*/
/*      	     a l l o c a t e A n d W r i t e S e c t o r	*/
/*									*/
/* Write to sectorNo. if necessary, allocate a free sector first.	*/
/*									*/
/* Parameters:                                                          */
/*	vol		: Pointer identifying drive			*/
/*	sectorNo	: Virtual sector no. to write			*/
/*	fromAddress	: Address of sector data. 			*/
/*                                                                      */
/* Returns:                                                             */
/*	FLStatus	: 0 on success, failed otherwise		*/
/*----------------------------------------------------------------------*/

static FLStatus allocateAndWriteSector(Anand vol,
				     SectorNo sectorNo,
				     void FAR1 *fromAddress)
{
  UnitNo virtualUnitNo = (UnitNo)(sectorNo / vol.sectorsPerUnit);
  UnitNo firstUnitNo = vol.virtualUnits[virtualUnitNo];
  UnitNo unitNo;
  unsigned unitOffset = (sectorNo % vol.sectorsPerUnit) << SECTOR_SIZE_BITS;
  unsigned unitChainLength = 1;
  FLBoolean sectorExists = FALSE;

  /* If we can't write to this unit, must fold it first */
  if (firstUnitNo != NO_UNIT && !(vol.physicalUnits[firstUnitNo] & UNIT_AVAILABLE)) {
    checkStatus(foldUnit(&vol,virtualUnitNo));
    firstUnitNo = vol.virtualUnits[virtualUnitNo];
  }

  /* Find a unit to write this sector */

  unitNo = firstUnitNo;
  while (unitNo != NO_UNIT) {
    unsigned char sectorFlags = getSectorFlags(&vol,unitBaseAddress(&vol,unitNo) + unitOffset);
    if (sectorFlags == SECTOR_FREE)
      break;
    if (sectorFlags != SECTOR_IGNORE)
      sectorExists = sectorFlags == SECTOR_USED;
    unitNo = getNextUnit(&vol,unitNo);
    unitChainLength++;
  }

  if (unitNo == NO_UNIT) {
    if (unitChainLength >= MAX_UNIT_CHAIN)
      checkStatus(foldUnit(&vol,virtualUnitNo));
    checkStatus(allocateUnit(&vol,&unitNo));
    checkStatus(assignUnit(&vol,unitNo,virtualUnitNo));
    firstUnitNo = vol.virtualUnits[virtualUnitNo];

  }

  if (!(vol.physicalUnits[unitNo] & UNIT_AVAILABLE))
    return flGeneralFailure;

  checkStatus(writeAndCheck(&vol,unitBaseAddress(&vol,unitNo) + unitOffset,fromAddress,EDC));

  if (vol.countsValid > virtualUnitNo) {
    if (unitNo != firstUnitNo && !(vol.physicalUnits[unitNo] & UNIT_REPLACED)) {
      if (~vol.physicalUnits[unitNo] & UNIT_COUNT)	/* Increment block count */
	vol.physicalUnits[unitNo]++;
      else
	return flGeneralFailure;

      if (sectorExists)	/* Decrement block count */
	if (vol.physicalUnits[firstUnitNo] & UNIT_COUNT)
	  vol.physicalUnits[firstUnitNo]--;
	else
	    return flGeneralFailure;
    }
    else if (!sectorExists) {
      if (~vol.physicalUnits[firstUnitNo] & UNIT_COUNT)  /* Increment block count */
	vol.physicalUnits[firstUnitNo]++;
      else
	return flGeneralFailure;
    }
  }

  return flOK;
}


/*----------------------------------------------------------------------*/
/*      	          w r i t e S e c t o r				*/
/*									*/
/* Writes a sector.							*/
/*									*/
/* Parameters:                                                          */
/*	vol		: Pointer identifying drive			*/
/*	sectorNo	: Virtual sector no. to write			*/
/*	fromAddress	: Data to write					*/
/*                                                                      */
/* Returns:                                                             */
/*	FLStatus	: 0 on success, failed otherwise		*/
/*----------------------------------------------------------------------*/

static FLStatus writeSector(Anand vol, SectorNo sectorNo, void FAR1 *fromAddress)
{
  FLStatus status = flWriteFault;
  int i;

  if (vol.badFormat)
    return flBadFormat;
  if (sectorNo > vol.virtualSectors)
    return flSectorNotFound;

  vol.sectorsWritten++;
  for (i = 0; i < 4 && status == flWriteFault; i++) {
    if (vol.mappedSectorNo == sectorNo)
      vol.mappedSectorNo = UNASSIGNED_SECTOR;
    status = allocateAndWriteSector(&vol,sectorNo,fromAddress);
  }

  return status;
}


/*----------------------------------------------------------------------*/
/*      	         d e l e t e S e c t o r			*/
/*									*/
/* Marks contiguous sectors as deleted.					*/
/*									*/
/* Parameters:                                                          */
/*	vol		: Pointer identifying drive			*/
/*	sectorNo	: First sector no. to delete			*/
/*	noOfSectors	: No. of sectors to delete			*/
/*                                                                      */
/* Returns:                                                             */
/*	FLStatus	: 0 on success, failed otherwise		*/
/*----------------------------------------------------------------------*/

static FLStatus deleteSector(Anand vol, SectorNo sectorNo, int noOfSectors)
{
  int iSector;

  if (vol.badFormat)
    return flBadFormat;
  if (sectorNo + noOfSectors > vol.virtualSectors)
    return flSectorNotFound;

  for (iSector = 0; iSector < noOfSectors; iSector++, sectorNo++,
       vol.sectorsDeleted++) {

    CardAddress sectorAddress = virtual2Physical(&vol,sectorNo);
    if (sectorAddress != UNASSIGNED_ADDRESS) {
      unsigned char sectorFlags[2];
      UnitNo currUnitNo;

      /* Check that the unit is writable, and if not, fold it first */
      UnitNo virtualUnitNo = (UnitNo)(sectorNo / vol.sectorsPerUnit);
      UnitNo unitNo = vol.virtualUnits[virtualUnitNo];
      if (!(vol.physicalUnits[unitNo] & UNIT_AVAILABLE)){
	checkStatus(foldUnit(&vol,virtualUnitNo));
	sectorAddress = virtual2Physical(&vol,sectorNo);
      }

      /* Mark sector deleted */
      sectorFlags[0] = sectorFlags[1] = SECTOR_DELETED;
      vol.flash.write(&vol.flash,
		       sectorAddress + SECTOR_DATA_OFFSET,
		       &sectorFlags,
		       sizeof sectorFlags,
		       EXTRA);

      currUnitNo = (UnitNo)(sectorAddress >> vol.unitSizeBits);
      if (vol.physicalUnits[currUnitNo] & UNIT_REPLACED)
	currUnitNo = vol.virtualUnits[virtualUnitNo];
      if (vol.countsValid > virtualUnitNo)
	if (vol.physicalUnits[currUnitNo] & UNIT_COUNT)
	  vol.physicalUnits[currUnitNo]--;	/* Decrement block count */
	else
	  return flGeneralFailure;
    }
  }

  return flOK;
}


/*----------------------------------------------------------------------*/
/*      	          t l S e t B u s y				*/
/*									*/
/* Notifies the start and end of a file-system operation.		*/
/*									*/
/* Parameters:                                                          */
/*	vol		: Pointer identifying drive			*/
/*      state		: ON (1) = operation entry			*/
/*			  OFF(0) = operation exit			*/
/*                                                                      */
/*----------------------------------------------------------------------*/

static void tlSetBusy(Anand vol, FLBoolean state)
{
}

#if defined(DEFRAGMENT_VOLUME) || defined(SINGLE_BUFFER)

/*----------------------------------------------------------------------*/
/*      	            d e f r a g m e n t				*/
/*									*/
/* Performs unit allocations to arrange a minimum number of writable	*/
/* sectors.                                                             */
/*									*/
/* Parameters:                                                          */
/*	vol		: Pointer identifying drive			*/
/*	sectorsNeeded	: Minimum required sectors			*/
/*                                                                      */
/* Returns:                                                             */
/*	FLStatus	: 0 on success, failed otherwise		*/
/*----------------------------------------------------------------------*/

static FLStatus defragment(Anand vol, long FAR2 *sectorsNeeded)
{
  UnitNo dummyUnitNo, firstFreeUnit;
  FLBoolean firstRound = TRUE;

  while (vol.freeUnits * vol.sectorsPerUnit < *sectorsNeeded) {
    if (vol.badFormat)
      return flBadFormat;

    checkStatus(allocateUnit(&vol,&dummyUnitNo));
    if (firstRound) {              /* remember the first free unit */
      firstFreeUnit = dummyUnitNo;
      firstRound = FALSE;
    }
    else if (firstFreeUnit == dummyUnitNo)
      /* We have wrapped around, all the units that were marked as free
	 are now erased, and we still don't have enough space. */
      checkStatus(foldBestChain(&vol,&dummyUnitNo)); /* make more free units */
  }

  *sectorsNeeded = vol.freeUnits * vol.sectorsPerUnit;

  return flOK;
}

#endif


#ifdef FORMAT_VOLUME

/*----------------------------------------------------------------------*/
/*      	        s e c t o r s I n V o l u m e			*/
/*									*/
/* Gets the total number of sectors in the volume			*/
/*									*/
/* Parameters:                                                          */
/*	vol		: Pointer identifying drive			*/
/*                                                                      */
/* Returns:                                                             */
/*	Number of sectors in the volume					*/
/*----------------------------------------------------------------------*/

static SectorNo sectorsInVolume(Anand vol)
{
  return vol.virtualSectors;
}


/*----------------------------------------------------------------------*/
/*      	               i s E r a s e d U n i t			*/
/*									*/
/* Check if a unit is erased.                                           */
/*									*/
/* Parameters:                                                          */
/*	vol		: Pointer identifying drive			*/
/*	unitNo		: unit to check					*/
/*                                                                      */
/* Returns:                                                             */
/*	TRUE if unit is erased, FALSE otherwise				*/
/*----------------------------------------------------------------------*/

static FLBoolean isErased(Anand vol, UnitNo unitNo)
{
  CardAddress offset;
  char ff[SECTOR_SIZE];

  tffsset(ff,0xff,sizeof ff);
  for (offset = 0; offset < (1UL << vol.unitSizeBits); offset += SECTOR_SIZE)
    if (tffscmp(vol.flash.map(&vol.flash,
			       unitBaseAddress(&vol,unitNo) + offset,
			       SECTOR_SIZE),
		ff,sizeof ff))
      return FALSE;

  return TRUE;
}


/*----------------------------------------------------------------------*/
/*      	            f o r m a t	N F T L 			*/
/*									*/
/* Perform NFTL Format.							*/
/*									*/
/* Parameters:                                                          */
/*	flash		: Flash media to format				*/
/*	formatParams	: Address of FormatParams structure to use	*/

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91丝袜美女网| 国产电影精品久久禁18| 精品久久久久久最新网址| 丁香一区二区三区| 三级在线观看一区二区| 国产精品国模大尺度视频| 在线成人av影院| 99久久99精品久久久久久 | 久久九九国产精品| 欧美男男青年gay1069videost| 国产高清无密码一区二区三区| 无吗不卡中文字幕| 国产精品久久久久久久久晋中| 日韩欧美三级在线| 欧美日本免费一区二区三区| 99久久精品99国产精品| 国产东北露脸精品视频| 蜜臀国产一区二区三区在线播放| 亚洲自拍偷拍综合| 中文字幕亚洲区| 日本一区二区三区视频视频| 日韩一区二区免费电影| 欧美蜜桃一区二区三区| 久久精品免费在线观看| 欧美日韩在线不卡| 色综合中文字幕| 成人av综合一区| 成人午夜看片网址| 国产河南妇女毛片精品久久久| 午夜精品在线看| 夜夜嗨av一区二区三区网页| 18欧美乱大交hd1984| 久久久国产综合精品女国产盗摄| 精品剧情在线观看| 日韩欧美在线1卡| 日韩欧美久久久| 日韩欧美一区中文| 日韩一区二区中文字幕| 欧美一区二区三级| 欧美一卡2卡三卡4卡5免费| 7777精品伊人久久久大香线蕉经典版下载| 色视频欧美一区二区三区| 不卡高清视频专区| 99这里只有精品| 99久久精品国产精品久久| 99久久综合色| 91国偷自产一区二区使用方法| 一本大道综合伊人精品热热| 不卡大黄网站免费看| gogogo免费视频观看亚洲一| 99国产欧美久久久精品| 色又黄又爽网站www久久| 日本乱人伦aⅴ精品| 欧美日韩综合不卡| 欧美一区二区三区四区在线观看| 日韩精品一区二区三区在线播放| 欧美mv和日韩mv国产网站| 欧美成人r级一区二区三区| 26uuu国产一区二区三区| 国产精品羞羞答答xxdd| 国产精品污网站| 国产精品1区二区.| 国产裸体歌舞团一区二区| 欧美日韩精品欧美日韩精品| 欧美精品精品一区| 欧美大片顶级少妇| 中文字幕久久午夜不卡| 亚洲免费在线视频| 日韩黄色在线观看| 国产一区二区伦理| 91老师片黄在线观看| 欧美年轻男男videosbes| 日韩美女一区二区三区四区| 国产精品污网站| 亚洲超碰精品一区二区| 国产一区二区三区免费| 91免费观看在线| 日韩三级.com| 中文字幕日本不卡| 日本亚洲一区二区| 成人天堂资源www在线| 欧美日韩一区二区三区四区| 久久久久综合网| 亚洲一区二区三区四区在线观看| 精品一区二区免费在线观看| 91毛片在线观看| 欧美成va人片在线观看| 亚洲综合久久av| 亚洲精品高清视频在线观看| 亚洲影院理伦片| 国产精品一区二区久久不卡 | 岛国一区二区三区| 欧美精品免费视频| 日本一区二区成人| 免费高清在线一区| 91网站在线观看视频| 精品日韩一区二区三区| 亚洲精品视频观看| 国产风韵犹存在线视精品| 9191久久久久久久久久久| 国产精品久久久久aaaa樱花 | 国产精品久久久久久一区二区三区| 日日欢夜夜爽一区| 91在线一区二区三区| 精品国产91久久久久久久妲己| 欧美一区二区精品在线| 日韩一区二区在线看片| 亚洲日本电影在线| 国产福利91精品| 91精品国产综合久久久久久漫画| 亚洲日本丝袜连裤袜办公室| 国产一区二区三区| 日韩亚洲欧美成人一区| 亚洲国产视频a| 91亚洲精品乱码久久久久久蜜桃| 欧美tickling挠脚心丨vk| 亚洲综合激情另类小说区| 不卡欧美aaaaa| 国产亚洲一区二区三区四区| 免费观看久久久4p| 欧美天堂一区二区三区| 日韩一区在线播放| 波多野结衣欧美| 国产拍揄自揄精品视频麻豆| 国模娜娜一区二区三区| 日韩美女一区二区三区| 美日韩黄色大片| 日韩一区二区电影| 免费不卡在线视频| 91精品国产一区二区三区香蕉| 亚洲丶国产丶欧美一区二区三区| 色综合网色综合| 亚洲精品日产精品乱码不卡| 成人性色生活片免费看爆迷你毛片| 精品99一区二区| 国产一区二区三区精品欧美日韩一区二区三区| 91国偷自产一区二区开放时间 | 精品国产凹凸成av人网站| 日本不卡视频在线| 日韩欧美电影在线| 六月丁香综合在线视频| 精品少妇一区二区三区免费观看| 美女免费视频一区| 久久亚区不卡日本| 国产成人久久精品77777最新版本| 国产日韩亚洲欧美综合| 国产91色综合久久免费分享| 国产精品色哟哟| 91免费观看国产| 亚洲电影中文字幕在线观看| 中文字幕中文字幕在线一区| 成人福利视频网站| 亚洲欧美日韩一区| 欧美性一二三区| 秋霞午夜av一区二区三区| 日韩精品一区二区三区视频| 久99久精品视频免费观看| 久久久国产一区二区三区四区小说| 福利一区福利二区| 亚洲精品欧美综合四区| 欧美一区二区视频在线观看2020| 久草热8精品视频在线观看| 国产精品美女久久久久久久久| 91黄色激情网站| 免播放器亚洲一区| 一区二区三区四区中文字幕| 久久福利资源站| 久久女同精品一区二区| www.久久久久久久久| 亚洲午夜久久久久久久久久久 | 色悠悠久久综合| 天堂精品中文字幕在线| 久久免费看少妇高潮| 91视频国产观看| 蜜桃视频一区二区三区| 亚洲国产成人在线| 欧美另类变人与禽xxxxx| 国产一区999| 亚洲午夜精品网| 久久久www成人免费毛片麻豆| 色偷偷久久人人79超碰人人澡| 蜜桃av一区二区在线观看| 国产精品美女久久久久高潮| 欧美在线色视频| 国产福利精品一区| 亚洲第一福利一区| 国产三级精品在线| 欧美精品tushy高清| 成人国产精品免费观看动漫| 日本人妖一区二区| 亚洲人成网站精品片在线观看| 日韩欧美国产成人一区二区| 一本久久综合亚洲鲁鲁五月天| 九九热在线视频观看这里只有精品| 最新国产成人在线观看| 精品久久久久久无| 中文字幕精品一区二区精品绿巨人 | 91精品国产综合久久久蜜臀粉嫩| 成人动漫中文字幕| 久久99精品久久久久久动态图|