X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=rtems%2Frtems-y-test%2Fcommon%2Fyaffs-rtems-flashsim.c;fp=rtems%2Frtems-y-test%2Fyaffs-rtems-flashsim.c;h=b6c83f206e9dfd3b1dcd2c8695e0596a6029730b;hb=7c666cd589631a555da943396a3124a610487b7e;hp=a49ff4434d5234268fbc65285b676a0ffe92d7f5;hpb=0d592874019a980b1a32b887be84aaabe7fb0b0c;p=yaffs2.git diff --git a/rtems/rtems-y-test/yaffs-rtems-flashsim.c b/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 a49ff44..b6c83f2 100644 --- a/rtems/rtems-y-test/yaffs-rtems-flashsim.c +++ b/rtems/rtems-y-test/common/yaffs-rtems-flashsim.c @@ -4,7 +4,7 @@ #include "yaffs-rtems-flashsim.h" #include -#include "../yaffs_guts.h" +#include "../../yaffs_guts.h" @@ -16,6 +16,12 @@ #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 ||