Add fsx file test and split up basic tests.
[yaffs2.git] / rtems / rtems-y-test / common / yaffs-rtems-flashsim.c
similarity index 97%
rename from rtems/rtems-y-test/yaffs-rtems-flashsim.c
rename to rtems/rtems-y-test/common/yaffs-rtems-flashsim.c
index a49ff4434d5234268fbc65285b676a0ffe92d7f5..b6c83f206e9dfd3b1dcd2c8695e0596a6029730b 100644 (file)
@@ -4,7 +4,7 @@
 #include "yaffs-rtems-flashsim.h"
 
 #include <string.h>
-#include "../yaffs_guts.h"
+#include "../../yaffs_guts.h"
 
 
 
 #define PAGES_PER_BLOCK        64
 
 
+#if 0
+#define dout printf
+#else
+#define dout(...) do { } while(0)
+#endif
+
 typedef struct {
        unsigned char page[PAGES_PER_BLOCK][PAGE_SIZE];
        unsigned blockOk;
@@ -88,6 +94,7 @@ static int yramsim_rd_chunk (struct yaffs_dev *dev, int pageId,
        unsigned pageOffset = pageId % PAGES_PER_BLOCK;
        unsigned char * d;
        unsigned char *s;
+
        if(blockId >= sim->nBlocks ||
           pageOffset >= PAGES_PER_BLOCK ||
           dataLength >DATA_SIZE ||
@@ -122,6 +129,9 @@ static int yramsim_wr_chunk (struct yaffs_dev *dev, int pageId,
        unsigned pageOffset = pageId % PAGES_PER_BLOCK;
        unsigned char * d;
        unsigned char *s;
+
+       dout("wr_chunk\n");
+
        if(blockId >= sim->nBlocks ||
           pageOffset >= PAGES_PER_BLOCK ||
           dataLength >DATA_SIZE ||