X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Fbasic-test%2Fyaffscfg2k.c;h=f83aad11e69ad789879193823c9ded641de5aa71;hp=b05952f1998dd9d8636dca67a99f15367ebd60fd;hb=137f935f6d622bffdef2fece0c5194e85f5174e9;hpb=cf6888f05f691aa1a357e7e94f9bf7b98174bbc3 diff --git a/direct/basic-test/yaffscfg2k.c b/direct/basic-test/yaffscfg2k.c index b05952f..f83aad1 100644 --- a/direct/basic-test/yaffscfg2k.c +++ b/direct/basic-test/yaffscfg2k.c @@ -25,6 +25,7 @@ #include "yaffs_nandemul2k.h" #include "yaffs_norif1.h" #include "yaffs_trace.h" +#include "yaffs_osglue.h" #include @@ -43,61 +44,6 @@ unsigned yaffs_trace_mask = 0; -static int yaffsfs_lastError; - -void yaffsfs_SetError(int err) -{ - //Do whatever to set error - yaffsfs_lastError = err; -} - - -int yaffsfs_GetLastError(void) -{ - return yaffsfs_lastError; -} - -void yaffsfs_Lock(void) -{ -} - -void yaffsfs_Unlock(void) -{ -} - -u32 yaffsfs_CurrentTime(void) -{ - return 0; -} - - -static int yaffs_kill_alloc = 0; -static size_t total_malloced = 0; -static size_t malloc_limit = 0 & 6000000; - -void *yaffs_malloc(size_t size) -{ - void * this; - if(yaffs_kill_alloc) - return NULL; - if(malloc_limit && malloc_limit <(total_malloced + size) ) - return NULL; - - this = malloc(size); - if(this) - total_malloced += size; - return this; -} - -void yaffs_free(void *ptr) -{ - free(ptr); -} - -void yaffsfs_LocalInitialisation(void) -{ - // Define locking semaphore. -} // Configuration @@ -106,15 +52,15 @@ void yaffsfs_LocalInitialisation(void) #include "yaffs_flashif2.h" #include "yaffs_nandemul2k.h" -struct yaffs_dev_s ram1Dev; -struct yaffs_dev_s flashDev; -struct yaffs_dev_s m18_1Dev; +struct yaffs_dev ram1Dev; +struct yaffs_dev flashDev; +struct yaffs_dev m18_1Dev; int yaffs_start_up(void) { // Stuff to configure YAFFS // Stuff to initialise anything special (eg lock semaphore). - yaffsfs_LocalInitialisation(); + yaffsfs_OSInitialisation(); // Set up devices // /ram1 ram, yaffs1