Mercurial > yaffs-ecoscentric-gpl
comparison direct/yaffs_ramem2k.c @ 356:7ee0cc4ba753
Rationalise context and parameter handling
| author | charles <charles> |
|---|---|
| date | Thu, 18 Feb 2010 01:18:04 +0000 |
| parents | 1d1b453d8b57 |
| children | b5309c9b6d7f |
comparison
equal
deleted
inserted
replaced
| 355:a52b8595f22c | 356:7ee0cc4ba753 |
|---|---|
| 14 /* | 14 /* |
| 15 * yaffs_ramem2k.c: RAM emulation in-kernel for 2K pages (YAFFS2) | 15 * yaffs_ramem2k.c: RAM emulation in-kernel for 2K pages (YAFFS2) |
| 16 */ | 16 */ |
| 17 | 17 |
| 18 | 18 |
| 19 const char *yaffs_ramem2k_c_version = "$Id: yaffs_ramem2k.c,v 1.7 2010-01-11 21:43:18 charles Exp $"; | 19 const char *yaffs_ramem2k_c_version = "$Id: yaffs_ramem2k.c,v 1.8 2010-02-18 01:18:04 charles Exp $"; |
| 20 | 20 |
| 21 #ifndef __KERNEL__ | 21 #ifndef __KERNEL__ |
| 22 #define CONFIG_YAFFS_RAM_ENABLED | 22 #define CONFIG_YAFFS_RAM_ENABLED |
| 23 #else | 23 #else |
| 24 #include <linux/config.h> | 24 #include <linux/config.h> |
| 219 | 219 |
| 220 if(tags) | 220 if(tags) |
| 221 { | 221 { |
| 222 x = &ned.block[blk]->page[pg]->data[PAGE_DATA_SIZE]; | 222 x = &ned.block[blk]->page[pg]->data[PAGE_DATA_SIZE]; |
| 223 | 223 |
| 224 yaffs_PackTags2((yaffs_PackedTags2 *)x,tags, !dev->noTagsECC); | 224 yaffs_PackTags2((yaffs_PackedTags2 *)x,tags, !dev->param.noTagsECC); |
| 225 | 225 |
| 226 } | 226 } |
| 227 | 227 |
| 228 if(tags || data) | 228 if(tags || data) |
| 229 { | 229 { |
| 255 | 255 |
| 256 if(tags) | 256 if(tags) |
| 257 { | 257 { |
| 258 x = &ned.block[blk]->page[pg]->data[PAGE_DATA_SIZE]; | 258 x = &ned.block[blk]->page[pg]->data[PAGE_DATA_SIZE]; |
| 259 | 259 |
| 260 yaffs_UnpackTags2(tags,(yaffs_PackedTags2 *)x, !dev->noTagsECC); | 260 yaffs_UnpackTags2(tags,(yaffs_PackedTags2 *)x, !dev->param.noTagsECC); |
| 261 } | 261 } |
| 262 | 262 |
| 263 return YAFFS_OK; | 263 return YAFFS_OK; |
| 264 } | 264 } |
| 265 | 265 |
| 333 yaffs_ExtendedTags tags; | 333 yaffs_ExtendedTags tags; |
| 334 int chunkNo; | 334 int chunkNo; |
| 335 | 335 |
| 336 *sequenceNumber = 0; | 336 *sequenceNumber = 0; |
| 337 | 337 |
| 338 chunkNo = blockNo * dev->nChunksPerBlock; | 338 chunkNo = blockNo * dev->param.nChunksPerBlock; |
| 339 | 339 |
| 340 nandemul2k_ReadChunkWithTagsFromNAND(dev,chunkNo,NULL,&tags); | 340 nandemul2k_ReadChunkWithTagsFromNAND(dev,chunkNo,NULL,&tags); |
| 341 if(tags.blockBad) | 341 if(tags.blockBad) |
| 342 { | 342 { |
| 343 *state = YAFFS_BLOCK_STATE_DEAD; | 343 *state = YAFFS_BLOCK_STATE_DEAD; |
