From: charles Date: Tue, 11 Oct 2005 23:39:55 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs%2F.git;a=commitdiff_plain;h=c370031e8cc127ad5af4ac7fbbe794fb6a56a672 *** empty log message *** --- diff --git a/utils/Makefile b/utils/Makefile index 265bb04..4929e08 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -14,9 +14,9 @@ ## Change or override KERNELDIR to your kernel -KERNELDIR = /usr/src/kernel-headers-2.4.18 +#KERNELDIR = /usr/src/kernel-headers-2.4.18 -CFLAGS = -I$(KERNELDIR)/include -I.. -O2 -Wall -DCONFIG_YAFFS_UTIL +CFLAGS = -I/usr/include -I.. -O2 -Wall -DCONFIG_YAFFS_UTIL CFLAGS+= -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations CFLAGS+= -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline @@ -27,7 +27,7 @@ CC=$(MAKETOOLS)gcc MKYAFFSOBJS = mkyaffs.o -MKYAFFSIMAGEOBJS = mkyaffsimage.o nand_ecc.o +MKYAFFSIMAGEOBJS = mkyaffsimage.o yaffs_ecc.o all: mkyaffs mkyaffsimage @@ -44,8 +44,8 @@ $(MKYAFFSOBJS): %.o: %.c mkyaffs: $(MKYAFFSOBJS) $(CC) -o $@ $(MKYAFFSOBJS) -nand_ecc.c: - ln -s ../nand_ecc.c nand_ecc.c +yaffs_ecc.c: + ln -s ../yaffs_ecc.c yaffs_ecc.c clean: diff --git a/utils/mkyaffs.c b/utils/mkyaffs.c index a3ec11d..c9b4367 100644 --- a/utils/mkyaffs.c +++ b/utils/mkyaffs.c @@ -27,14 +27,14 @@ #include #include #include +#include #include #include #include #include -#include -#include +#include -const char *mkyaffs_c_version = "$Id: mkyaffs.c,v 1.8 2003-03-12 19:54:07 charles Exp $"; +const char *mkyaffs_c_version = "$Id: mkyaffs.c,v 1.9 2005-10-11 23:39:56 charles Exp $"; // countBits is a quick way of counting the number of bits in a byte. // ie. countBits[n] holds the number of 1 bits in a byte with the value n. 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)