changeset 236:d74a9a8c1f49

Reduce size for nor simulation testing to try force errors
author charles
date Tue, 11 Nov 2008 01:48:47 +0000
parents 85ea0cc0d313
children b97223f16e0e
files direct/Makefile direct/nor_stress.c direct/yaffs_norif1.c direct/yaffscfg2k.c direct/ynorsim.c
diffstat 5 files changed, 20 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/direct/Makefile
+++ b/direct/Makefile
@@ -20,8 +20,9 @@
 
 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
--- 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(c
 
 			if((s.st_mode & S_IFMT) == S_IFDIR && recursive)
 				dump_directory_tree_worker(str,1);
+				
+                        if(s.st_ino > 10000)
+                          FatalError();
 							
 		}
 		
--- a/direct/yaffs_norif1.c
+++ b/direct/yaffs_norif1.c
@@ -58,7 +58,7 @@ const char *yaffs_norif1_c_version = "$I
 #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)
--- 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.
--- 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();
 }