From: charles Date: Tue, 11 Nov 2008 01:48:47 +0000 (+0000) Subject: Reduce size for nor simulation testing to try force errors X-Git-Tag: pre-name-change~261 X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=1d1b44f28bbce072485071b6257146eaadf96e75 Reduce size for nor simulation testing to try force errors --- diff --git a/direct/Makefile b/direct/Makefile index 9f4b606..bfd98be 100644 --- a/direct/Makefile +++ b/direct/Makefile @@ -14,14 +14,15 @@ # # NB Warning this Makefile does not include header dependencies. # -# $Id: Makefile,v 1.19 2008-11-07 00:32:21 charles Exp $ +# $Id: Makefile,v 1.20 2008-11-11 01:48:47 charles Exp $ #EXTRA_COMPILE_FLAGS = -DYAFFS_IGNORE_TAGS_ECC CFLAGS = -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_SHORT_NAMES_IN_RAM -DCONFIG_YAFFS_YAFFS2 CFLAGS += -DCONFIG_YAFFS_PROVIDE_DEFS -DCONFIG_YAFFSFS_PROVIDE_VALUES -DNO_Y_INLINE -CFLAGS += -Wall -g $(EXTRA_COMPILE_FLAGS) -Wstrict-aliasing -fno-strict-aliasing -CFLAGS += -O0 +CFLAGS += -Wall -g $(EXTRA_COMPILE_FLAGS) -Wstrict-aliasing +#CFLAGS += -fno-strict-aliasing +CFLAGS += -O3 #CFLAGS += -DVALGRIND_TEST #CFLAGS+= -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations diff --git a/direct/nor_stress.c b/direct/nor_stress.c index 0eaaf1b..4ac10b1 100644 --- a/direct/nor_stress.c +++ b/direct/nor_stress.c @@ -48,8 +48,8 @@ static void FatalError(void) static void UpdateCounter(const char *name, unsigned *val, int initialise) { - int inh; - int outh; + int inh=-1; + int outh=-1; unsigned x[2]; int nread = 0; int nwritten = 0; @@ -139,6 +139,9 @@ static void dump_directory_tree_worker(const char *dname,int recursive) if((s.st_mode & S_IFMT) == S_IFDIR && recursive) dump_directory_tree_worker(str,1); + + if(s.st_ino > 10000) + FatalError(); } diff --git a/direct/yaffs_norif1.c b/direct/yaffs_norif1.c index c9534ac..c49b6c4 100644 --- a/direct/yaffs_norif1.c +++ b/direct/yaffs_norif1.c @@ -35,7 +35,7 @@ * */ -const char *yaffs_norif1_c_version = "$Id: yaffs_norif1.c,v 1.1 2008-11-07 00:34:47 charles Exp $"; +const char *yaffs_norif1_c_version = "$Id: yaffs_norif1.c,v 1.2 2008-11-11 01:48:47 charles Exp $"; #include "yaffs_norif1.h" @@ -58,7 +58,7 @@ const char *yaffs_norif1_c_version = "$Id: yaffs_norif1.c,v 1.1 2008-11-07 00:34 #define FORMAT_VALUE 0x1234 #define DATA_BYTES_PER_CHUNK 1024 -#define BLOCKS_IN_DEVICE (32*1024/256) +#define BLOCKS_IN_DEVICE (8*1024/256) #define YNOR_PREMARKER (0xF6) diff --git a/direct/yaffscfg2k.c b/direct/yaffscfg2k.c index 0a59d95..5100e6d 100644 --- a/direct/yaffscfg2k.c +++ b/direct/yaffscfg2k.c @@ -157,7 +157,7 @@ int yaffs_StartUp(void) m18_1Dev.nChunksPerBlock =248; m18_1Dev.nReservedBlocks = 2; m18_1Dev.startBlock = 0; // Can use block 0 - m18_1Dev.endBlock = 127; // Last block + m18_1Dev.endBlock = 31; // Last block m18_1Dev.useNANDECC = 0; // use YAFFS's ECC m18_1Dev.nShortOpCaches = 10; // Use caches m18_1Dev.genericDevice = (void *) 1; // Used to identify the device in fstat. diff --git a/direct/ynorsim.c b/direct/ynorsim.c index 569e0de..3281a2f 100644 --- a/direct/ynorsim.c +++ b/direct/ynorsim.c @@ -21,12 +21,21 @@ //#define YNORSIM_BIT_CHANGES 15 #define YNORSIM_BIT_CHANGES 1 +#if 0 /* Simulate 32MB of flash in 256k byte blocks. * This stuff is x32. */ #define YNORSIM_BLOCK_SIZE_U32 (256*1024/4) #define YNORSIM_DEV_SIZE_U32 (32*1024 * 1024/4) +#else +/* Simulate 8MB of flash in 256k byte blocks. + * This stuff is x32. + */ + +#define YNORSIM_BLOCK_SIZE_U32 (256*1024/4) +#define YNORSIM_DEV_SIZE_U32 (8*1024 * 1024/4) +#endif static __u32 word[YNORSIM_DEV_SIZE_U32]; @@ -82,7 +91,7 @@ static void ynorsim_Ready(void) return; srand(time(NULL)); remaining_ops = 1000000000; - remaining_ops = (rand() % 10000) * 10000; + remaining_ops = (rand() % 10000) * 3000 * YNORSIM_BIT_CHANGES; ynorsim_RestoreImage(); }