projects
/
yaffs2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
yaffs driver refactoring: Change to Linux driver interface
[yaffs2.git]
/
direct
/
basic-test
/
yaffs_osglue.c
diff --git
a/direct/basic-test/yaffs_osglue.c
b/direct/basic-test/yaffs_osglue.c
index 6e8870b1780dc52aa669ef54cffe8b66e8783ccf..4c2e442033f8cc03be314a90295798f70148613f 100644
(file)
--- a/
direct/basic-test/yaffs_osglue.c
+++ b/
direct/basic-test/yaffs_osglue.c
@@
-1,7
+1,7
@@
/*
* YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
*
/*
* YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
*
- * Copyright (C) 2002-201
0
Aleph One Ltd.
+ * Copyright (C) 2002-201
1
Aleph One Ltd.
* for Toby Churchill Ltd and Brightstar Engineering
*
* Created by Charles Manning <charles@aleph1.co.uk>
* 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 "yaffs_nandemul2k.h"
#include "yaffs_norif1.h"
#include "yaffs_trace.h"
-
+#include <assert.h>
#include <errno.h>
#include <errno.h>
@@
-37,6
+37,13
@@
int yaffsfs_GetLastError(void)
return yaffsfs_lastError;
}
return yaffsfs_lastError;
}
+int yaffsfs_CheckMemRegion(const void *addr, size_t size, int writeable)
+{
+ if(!addr)
+ return -1;
+ return 0;
+}
+
#ifdef CONFIG_YAFFS_USE_PTHREADS
#include <pthread.h>
#ifdef CONFIG_YAFFS_USE_PTHREADS
#include <pthread.h>
@@
-75,7
+82,7
@@
void yaffsfs_LockInit(void)
u32 yaffsfs_CurrentTime(void)
{
u32 yaffsfs_CurrentTime(void)
{
- return
0
;
+ return
time(NULL)
;
}
}
@@
-83,7
+90,7
@@
static int yaffs_kill_alloc = 0;
static size_t total_malloced = 0;
static size_t malloc_limit = 0 & 6000000;
static size_t total_malloced = 0;
static size_t malloc_limit = 0 & 6000000;
-void *yaffs_malloc(size_t size)
+void *yaffs
fs
_malloc(size_t size)
{
void * this;
if(yaffs_kill_alloc)
{
void * this;
if(yaffs_kill_alloc)
@@
-97,7
+104,7
@@
void *yaffs_malloc(size_t size)
return this;
}
return this;
}
-void yaffs_free(void *ptr)
+void yaffs
fs
_free(void *ptr)
{
free(ptr);
}
{
free(ptr);
}
@@
-108,3
+115,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);
+}