X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=direct%2Fynorsim.c;h=6936a9c874e2c9bffb4d995e8ab4d8e870c8fda6;hb=a89cf765098ba9927eafeaca0f303eb76052fc64;hp=569e0ded1e9e40746de4da50ee2d551e6da2074e;hpb=49942b13d7cfbdba72c18de0f37d16d81b4372a8;p=yaffs2.git diff --git a/direct/ynorsim.c b/direct/ynorsim.c index 569e0de..6936a9c 100644 --- a/direct/ynorsim.c +++ b/direct/ynorsim.c @@ -21,15 +21,25 @@ //#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]; +extern int random_seed; static void NorError(void) { @@ -80,9 +90,9 @@ static void ynorsim_Ready(void) { if(initialised) return; - srand(time(NULL)); + srand(random_seed); remaining_ops = 1000000000; - remaining_ops = (rand() % 10000) * 10000; + remaining_ops = (rand() % 10000) * 3000 * YNORSIM_BIT_CHANGES; ynorsim_RestoreImage(); }