5 #define YAFFS_MAX_NAME_LENGTH 255
6 #define YAFFS_MAX_ALIAS_LENGTH 159
8 #define BOOT_MAGIC_SIZE 8
9 #define BOOT_NAME_SIZE 16
10 #define BOOT_ARGS_SIZE 512
12 #define YAFFS_LOWEST_SEQUENCE_NUMBER 0x00001000
13 #define YAFFS_HIGHEST_SEQUENCE_NUMBER 0xEFFFFF00
16 #define __u16 unsigned short
20 #define __u32 unsigned int
24 #define __u8 unsigned char
28 YAFFS_ECC_RESULT_UNKNOWN,
29 YAFFS_ECC_RESULT_NO_ERROR,
30 YAFFS_ECC_RESULT_FIXED,
31 YAFFS_ECC_RESULT_UNFIXED
35 YAFFS_OBJECT_TYPE_UNKNOWN,
36 YAFFS_OBJECT_TYPE_FILE,
37 YAFFS_OBJECT_TYPE_SYMLINK,
38 YAFFS_OBJECT_TYPE_DIRECTORY,
39 YAFFS_OBJECT_TYPE_HARDLINK,
40 YAFFS_OBJECT_TYPE_SPECIAL
45 unsigned validMarker0;
46 unsigned chunkUsed; /* Status of the chunk: used or unused */
47 unsigned objectId; /* If 0 then this is not part of an object (unused) */
48 unsigned chunkId; /* If 0 then this is a header, else a data chunk */
49 unsigned byteCount; /* Only valid for data chunks */
51 /* The following stuff only has meaning when we read */
52 yaffs_ECCResult eccResult;
56 unsigned chunkDeleted; /* The chunk is marked deleted */
57 unsigned serialNumber; /* Yaffs1 2-bit serial number */
60 unsigned sequenceNumber; /* The sequence number of this block */
62 /* Extra info if this is an object header (YAFFS2 only) */
64 unsigned extraHeaderInfoAvailable; /* There is extra info available if this is not zero */
65 unsigned extraParentObjectId; /* The parent object */
66 unsigned extraIsShrinkHeader; /* Is it a shrink header? */
67 unsigned extraShadows; /* Does this shadow another object? */
69 yaffs_ObjectType extraObjectType; /* What object type? */
71 unsigned extraFileLength; /* Length if it is a file */
72 unsigned extraEquivalentObjectId; /* Equivalent object Id if it is a hard link */
74 unsigned validMarker1;
78 /* -------------------------- Object structure -------------------------------*/
79 /* This is the object structure as stored on NAND */
82 yaffs_ObjectType type;
84 /* Apply to everything */
86 __u16 sum__NoLongerUsed; /* checksum of name. No longer used */
87 char name[YAFFS_MAX_NAME_LENGTH + 1];
89 /* Thes following apply to directories, files, symlinks - not hard links */
90 __u32 yst_mode; /* protection */
92 #ifdef CONFIG_YAFFS_WINCE
102 /* File size applies to files only */
105 /* Equivalent object id applies to hard links only. */
106 int equivalentObjectId;
108 /* Alias is for symlinks only. */
109 char alias[YAFFS_MAX_ALIAS_LENGTH + 1];
111 __u32 yst_rdev; /* device stuff for block and char devices (major/min) */
113 #ifdef CONFIG_YAFFS_WINCE
119 __u32 roomToGrow[10];
122 int shadowsObject; /* This object header shadows the specified object if > 0 */
124 /* isShrink applies to object headers written when we shrink the file (ie resize) */
127 } yaffs_ObjectHeader;
131 unsigned char colParity;
133 unsigned lineParityPrime;
137 unsigned sequenceNumber;
141 } yaffs_PackedTags2TagsPart;
144 yaffs_PackedTags2TagsPart t;
149 unsigned char magic[BOOT_MAGIC_SIZE];
151 unsigned kernel_size; /* size in bytes */
152 unsigned kernel_addr; /* physical load addr */
154 unsigned ramdisk_size; /* size in bytes */
155 unsigned ramdisk_addr; /* physical load addr */
157 unsigned second_size; /* size in bytes */
158 unsigned second_addr; /* physical load addr */
160 unsigned tags_addr; /* physical addr for kernel tags */
161 unsigned page_size; /* flash page size we assume */
162 unsigned unused[2]; /* future expansion: should be 0 */
164 unsigned char name[BOOT_NAME_SIZE]; /* asciiz product name */
165 unsigned char cmdline[BOOT_ARGS_SIZE];
167 unsigned id[8]; /* timestamp / checksum / sha1 / etc */
170 void yaffs2_InitialiseTags(yaffs_ExtendedTags * tags);
171 void yaffs2_PackTags2(yaffs_PackedTags2 * pt, const yaffs_ExtendedTags * t);
173 #endif /* FDL_YAFFS2_H */