资源简介
友善光盘自带的,移植内核是时用过的,亲测可用,
代码片段和文件信息
/*
* YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
*
* Copyright (C) 2002-2007 Aleph One Ltd.
* for Toby Churchill Ltd and Brightstar Engineering
*
* Created by Charles Manning
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
const char *yaffs_checkptrw_c_version =
“$Id: yaffs_checkptrw.cv 1.23 2010/02/18 01:18:04 charles Exp $“;
#include “yaffs_checkptrw.h“
#include “yaffs_getblockinfo.h“
static int yaffs_CheckpointSpaceOk(yaffs_Device *dev)
{
int blocksAvailable = dev->nErasedBlocks - dev->param.nReservedBlocks;
T(YAFFS_TRACE_CHECKPOINT
(TSTR(“checkpt blocks available = %d“ TENDSTR)
blocksAvailable));
return (blocksAvailable <= 0) ? 0 : 1;
}
static int yaffs_CheckpointErase(yaffs_Device *dev)
{
int i;
if (!dev->param.eraseBlockInNAND)
return 0;
T(YAFFS_TRACE_CHECKPOINT (TSTR(“checking blocks %d to %d“TENDSTR)
dev->internalStartBlock dev->internalEndBlock));
for (i = dev->internalStartBlock; i <= dev->internalEndBlock; i++) {
yaffs_BlockInfo *bi = yaffs_GetBlockInfo(dev i);
if (bi->blockState == YAFFS_BLOCK_STATE_CHECKPOINT) {
T(YAFFS_TRACE_CHECKPOINT (TSTR(“erasing checkpt block %d“TENDSTR) i));
dev->nBlockErasures++;
if (dev->param.eraseBlockInNAND(dev i - dev->blockOffset /* realign */)) {
bi->blockState = YAFFS_BLOCK_STATE_EMPTY;
dev->nErasedBlocks++;
dev->nFreeChunks += dev->param.nChunksPerBlock;
} else {
dev->param.markNANDBlockBad(dev i);
bi->blockState = YAFFS_BLOCK_STATE_DEAD;
}
}
}
dev->blocksInCheckpoint = 0;
return 1;
}
static void yaffs_CheckpointFindNextErasedBlock(yaffs_Device *dev)
{
int i;
int blocksAvailable = dev->nErasedBlocks - dev->param.nReservedBlocks;
T(YAFFS_TRACE_CHECKPOINT
(TSTR(“allocating checkpt block: erased %d reserved %d avail %d next %d “TENDSTR)
dev->nErasedBlocks dev->param.nReservedBlocks blocksAvailable dev->checkpointNextBlock));
if (dev->checkpointNextBlock >= 0 &&
dev->checkpointNextBlock <= dev->internalEndBlock &&
blocksAvailable > 0) {
for (i = dev->checkpointNextBlock; i <= dev->internalEndBlock; i++) {
yaffs_BlockInfo *bi = yaffs_GetBlockInfo(dev i);
if (bi->blockState == YAFFS_BLOCK_STATE_EMPTY) {
dev->checkpointNextBlock = i + 1;
dev->checkpointCurrentBlock = i;
T(YAFFS_TRACE_CHECKPOINT (TSTR(“allocating checkpt block %d“TENDSTR) i));
return;
}
}
}
T(YAFFS_TRACE_CHECKPOINT (TSTR(“out of checkpt blocks“TENDSTR)));
dev->checkpointNextBlock = -1;
dev->checkpointCurrentBlock = -1;
}
static void yaffs_CheckpointFindNextCheckpointBlock(yaffs_Device *dev)
{
int i;
yaffs_ExtendedTags tags;
T(YAFFS_TRACE_CHECKPOINT (TSTR(“find next checkpt block: start: blocks %d next %d“ TENDSTR)
dev->blocksInCheckpoint dev->checkpointNextBlock));
if (dev->blocksI
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4108 2009-03-09 16:11 yaffs2\devextras.h
文件 45159 2010-03-12 06:47 yaffs2\direct\dtest.c
文件 2684 2008-11-07 08:32 yaffs2\direct\fsx_test\Makefile
文件 289 2007-10-16 08:46 yaffs2\direct\fsx_test\README
文件 22900 2008-11-27 04:49 yaffs2\direct\fsx_test\yaffs_fsx.c
文件 2520 2010-02-17 10:18 yaffs2\direct\Makefile
文件 1913 2010-01-06 11:56 yaffs2\direct\python\examples.py
文件 2657 2010-02-17 08:51 yaffs2\direct\python\Makefile
文件 1257 2009-10-13 07:05 yaffs2\direct\python\README.txt
文件 7126 2010-02-17 07:24 yaffs2\direct\python\yaffsfs.py
文件 1355 2010-01-11 12:06 yaffs2\direct\python\yaffs_python_helper.c
文件 1479 2009-12-15 03:46 yaffs2\direct\tests\fuzzer.c
文件 139 2010-03-10 09:57 yaffs2\direct\tests\init_fw_update_test_nand.sh
文件 127 2009-12-15 03:42 yaffs2\direct\tests\init_fw_update_test_nor.sh
文件 2970 2010-02-26 06:34 yaffs2\direct\tests\Makefile
文件 9030 2010-03-11 10:14 yaffs2\direct\tests\nor_stress.c
文件 175 2009-01-05 05:44 yaffs2\direct\tests\nor_stress.h
文件 387 2009-12-15 03:43 yaffs2\direct\tests\README
文件 762 2010-03-10 10:07 yaffs2\direct\tests\run_fw_update_test_nand.sh
文件 568 2009-12-15 03:42 yaffs2\direct\tests\run_fw_update_test_nor.sh
文件 20730 2009-11-03 09:30 yaffs2\direct\tests\yaffs_fsx.c
文件 211 2009-01-09 10:59 yaffs2\direct\tests\yaffs_fsx.h
文件 5079 2010-01-11 12:06 yaffs2\direct\tests\yaffs_test.c
文件 3719 2007-12-03 11:21 yaffs2\direct\yaffscfg.c
文件 935 2010-01-06 11:58 yaffs2\direct\yaffscfg.h
文件 5349 2010-02-26 06:41 yaffs2\direct\yaffscfg2k.c
文件 40749 2010-02-26 06:38 yaffs2\direct\yaffsfs.c
文件 6147 2010-02-17 07:24 yaffs2\direct\yaffsfs.h
文件 3661 2010-02-18 09:18 yaffs2\direct\yaffs_fileem.c
文件 12749 2010-02-18 09:18 yaffs2\direct\yaffs_fileem2k.c
............此处省略79个文件信息
评论
共有 条评论