X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs%2F.git;a=blobdiff_plain;f=utils%2Fmkyaffsimage.c;fp=utils%2Fmkyaffsimage.c;h=8d57bc3272330be454f7396990153db9ad724b69;hp=c21c631f3272379b64121b31b53ae6a8d229b55c;hb=c370031e8cc127ad5af4ac7fbbe794fb6a56a672;hpb=ce5e10874d3f7ef75757bb48bbf7181d63f2ef2c diff --git a/utils/mkyaffsimage.c b/utils/mkyaffsimage.c index c21c631..8d57bc3 100644 --- a/utils/mkyaffsimage.c +++ b/utils/mkyaffsimage.c @@ -30,17 +30,13 @@ #include #include #include - +#include "yaffs_ecc.h" #include "yaffs_guts.h" #define MAX_OBJECTS 10000 -const char * mkyaffsimage_c_version = "$Id: mkyaffsimage.c,v 1.7 2003-07-16 03:00:48 charles Exp $"; - -// External functions for ECC on data -void nand_calculate_ecc (const u_char *dat, u_char *ecc_code); -int nand_correct_data (u_char *dat, u_char *read_ecc, u_char *calc_ecc); +const char * mkyaffsimage_c_version = "$Id: mkyaffsimage.c,v 1.8 2005-10-11 23:39:56 charles Exp $"; typedef struct @@ -139,8 +135,8 @@ static __u16 yaffs_CalcNameSum(const char *name) static void yaffs_CalcECC(const __u8 *data, yaffs_Spare *spare) { - nand_calculate_ecc (data , spare->ecc1); - nand_calculate_ecc (&data[256] , spare->ecc2); + yaffs_ECCCalculate(data , spare->ecc1); + yaffs_ECCCalculate(&data[256] , spare->ecc2); } static void yaffs_CalcTagsECC(yaffs_Tags *tags) @@ -281,7 +277,7 @@ static void object_header_little_to_big_endian(yaffs_ObjectHeader* oh) oh->parentObjectId = SWAP32(oh->parentObjectId); // int oh->sum__NoLongerUsed = SWAP16(oh->sum__NoLongerUsed); // __u16 - Not used, but done for completeness. // name = skip. Char array. Not swapped. - oh->st_mode = SWAP32(oh->st_mode); + oh->yst_mode = SWAP32(oh->yst_mode); #ifdef CONFIG_YAFFS_WINCE // WinCE doesn't implement this, but we need to just in case. // In fact, WinCE would be *THE* place where this would be an issue! oh->notForWinCE[0] = SWAP32(oh->notForWinCE[0]); @@ -291,17 +287,17 @@ static void object_header_little_to_big_endian(yaffs_ObjectHeader* oh) oh->notForWinCE[4] = SWAP32(oh->notForWinCE[4]); #else // Regular POSIX. - oh->st_uid = SWAP32(oh->st_uid); - oh->st_gid = SWAP32(oh->st_gid); - oh->st_atime = SWAP32(oh->st_atime); - oh->st_mtime = SWAP32(oh->st_mtime); - oh->st_ctime = SWAP32(oh->st_ctime); + oh->yst_uid = SWAP32(oh->yst_uid); + oh->yst_gid = SWAP32(oh->yst_gid); + oh->yst_atime = SWAP32(oh->yst_atime); + oh->yst_mtime = SWAP32(oh->yst_mtime); + oh->yst_ctime = SWAP32(oh->yst_ctime); #endif oh->fileSize = SWAP32(oh->fileSize); // Aiee. An int... signed, at that! oh->equivalentObjectId = SWAP32(oh->equivalentObjectId); // alias - char array. - oh->st_rdev = SWAP32(oh->st_rdev); + oh->yst_rdev = SWAP32(oh->yst_rdev); #ifdef CONFIG_YAFFS_WINCE oh->win_ctime[0] = SWAP32(oh->win_ctime[0]); @@ -350,14 +346,14 @@ static int write_object_header(int objId, yaffs_ObjectType t, struct stat *s, in if(t != YAFFS_OBJECT_TYPE_HARDLINK) { - oh->st_mode = s->st_mode; - oh->st_uid = s->st_uid; -// NCB 12/9/02 oh->st_gid = s->st_uid; - oh->st_gid = s->st_gid; - oh->st_atime = s->st_atime; - oh->st_mtime = s->st_mtime; - oh->st_ctime = s->st_ctime; - oh->st_rdev = s->st_rdev; + oh->yst_mode = s->st_mode; + oh->yst_uid = s->st_uid; +// NCB 12/9/02 oh->yst_gid = s->yst_uid; + oh->yst_gid = s->st_gid; + oh->yst_atime = s->st_atime; + oh->yst_mtime = s->st_mtime; + oh->yst_ctime = s->st_ctime; + oh->yst_rdev = s->st_rdev; } if(t == YAFFS_OBJECT_TYPE_FILE)