Set up u-boot glue code and patching scripts.
[yaffs2.git] / direct / basic-test / yaffs_osglue.c
index 14963839b23a2180e8f4b49515ad4d155e7565f6..4a149e277588dd9bc4387bcfe02c57eb3a495186 100644 (file)
@@ -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 <charles@aleph1.co.uk>
@@ -19,7 +19,7 @@
 #include "yaffs_nandemul2k.h"
 #include "yaffs_norif1.h"
 #include "yaffs_trace.h"
-
+#include <assert.h>
 
 #include <errno.h>
 
@@ -39,7 +39,7 @@ int yaffsfs_GetLastError(void)
 
 
 #ifdef CONFIG_YAFFS_USE_PTHREADS
-#include <pthreads.h>
+#include <pthread.h>
 static pthread_mutex_t mutex1;
 
 
@@ -55,7 +55,7 @@ void yaffsfs_Unlock(void)
 
 void yaffsfs_LockInit(void)
 {
-       pthread_mutex_init( &mutex, NULL);
+       pthread_mutex_init( &mutex1, NULL);
 }
 
 #else
@@ -75,7 +75,7 @@ void yaffsfs_LockInit(void)
 
 u32 yaffsfs_CurrentTime(void)
 {
-       return 0;
+       return time(NULL);
 }
 
 
@@ -83,7 +83,7 @@ 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 *yaffsfs_malloc(size_t size)
 {
        void * this;
        if(yaffs_kill_alloc)
@@ -97,7 +97,7 @@ void *yaffs_malloc(size_t size)
        return this;
 }
 
-void yaffs_free(void *ptr)
+void yaffsfs_free(void *ptr)
 {
        free(ptr);
 }
@@ -108,3 +108,9 @@ void yaffsfs_OSInitialisation(void)
 }
 
 
+void yaffs_bug_fn(const char *file_name, int line_no)
+{
+       printf("yaffs bug detected %s:%d\n",
+               file_name, line_no);
+       assert(0);
+}