X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=direct%2Fbasic-test%2Fyaffscfg2k.c;h=441ee05fe6a7839ae450042c853d955be80f4048;hb=ffb9a41a909210075adf0c529becca54109b2d80;hp=6f7d2125d6f8ded3eb70890deb1665a2e28f2805;hpb=976dbeae825b18e6759f3903073a6784248cc244;p=yaffs2.git diff --git a/direct/basic-test/yaffscfg2k.c b/direct/basic-test/yaffscfg2k.c index 6f7d212..441ee05 100644 --- a/direct/basic-test/yaffscfg2k.c +++ b/direct/basic-test/yaffscfg2k.c @@ -1,7 +1,7 @@ /* * YAFFS: Yet Another Flash File System. A NAND-flash specific file system. * - * Copyright (C) 2002-2010 Aleph One Ltd. + * Copyright (C) 2002-2011 Aleph One Ltd. * for Toby Churchill Ltd and Brightstar Engineering * * Created by Charles Manning @@ -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 @@ -114,7 +60,7 @@ 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