*
*/
+#include "yaffs_fsx.h"
+
#include <sys/types.h>
#include <sys/stat.h>
#ifdef _UWIN
long monitorstart = -1; /* -m flag */
long monitorend = -1; /* -m flag */
int lite = 0; /* -L flag */
-long numops = /*-1 */ 10000000; /* -N flag */
int randomoplen = 1; /* -O flag disables it */
int seed = 1; /* -S flag */
void EXIT(int x)
{
printf("fsx wanted to exit with %d\n",x);
- while(1){}
+ while(x){}
}
char goodfile[1024];
int
yaffs_fsx_init(const char *mount_pt)
{
- int i, style, ch;
- char *endp;
+ int i;
goodfile[0] = 0;
logfile[0] = 0;
}
int
-yaffs_fsx_main(const char *mount_pt)
+yaffs_fsx_main(const char *mount_pt, int numops)
{
yaffs_fsx_init(mount_pt);
while (numops == -1 || numops--)
yaffs_fsx_do_op();
yaffs_fsx_complete();
+
+ return 0;
}
#ifndef __YAFFS_FSX_H__
#define __YAFFS_FSX_H__
+int yaffs_fsx_main(const char *mountpt,int n_cycles);
int yaffs_fsx_init(const char *mountpt);
int yaffs_fsx_complete(void);
-int yaffs_fsx_do_op(void);
+void yaffs_fsx_do_op(void);
#endif
int do_upgrade;
int n_cycles = -1;
+extern int ops_multiplier;
+
char mount_point[200];
void BadUsage(void)
int ch;
- while ((ch = getopt(argc,argv, "fin:ps:u"))
+ while ((ch = getopt(argc,argv, "filn:ps:u"))
!= EOF)
switch (ch) {
case 's':
case 'f':
do_fsx = 1;
break;
+ case 'l':
+ ops_multiplier *= 5;
+ break;
case 'u':
do_upgrade = 1;
break;
printf("Running stress on %s with seed %d\n",argv[1],random_seed);
NorStressTestRun(mount_point,n_cycles,do_fsx);
} else if(do_fsx){
- yaffs_fsx_main(mount_point);
+ yaffs_fsx_main(mount_point,n_cycles);
}else {
printf("No test to run!\n");
BadUsage();
{ "/M18-1", &m18_1Dev},
{ "/yaffs2", &flashDev},
{ "/ram2k", &ram2kDev},
- { "/flash/bigblock", &flashDev},
{(void *)0,(void *)0} /* Null entry to terminate list */
};
static int remaining_ops;
static int nops_so_far;
+int ops_multiplier = 500;
+
static void ynorsim_MaybePowerFail(void)
{
return;
srand(random_seed);
remaining_ops = 1000000000;
- remaining_ops = (rand() % 10000) * 4000 * YNORSIM_BIT_CHANGES;
+ remaining_ops = (rand() % 10000) * ops_multiplier * YNORSIM_BIT_CHANGES;
ynorsim_RestoreImage();
}