summaryrefslogtreecommitdiff
path: root/ANDROID_3.4.5/fs/yaffs2/yportenv.h
diff options
context:
space:
mode:
Diffstat (limited to 'ANDROID_3.4.5/fs/yaffs2/yportenv.h')
-rw-r--r--ANDROID_3.4.5/fs/yaffs2/yportenv.h46
1 files changed, 29 insertions, 17 deletions
diff --git a/ANDROID_3.4.5/fs/yaffs2/yportenv.h b/ANDROID_3.4.5/fs/yaffs2/yportenv.h
index 81834254..666d909b 100644
--- a/ANDROID_3.4.5/fs/yaffs2/yportenv.h
+++ b/ANDROID_3.4.5/fs/yaffs2/yportenv.h
@@ -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>
@@ -13,9 +13,27 @@
* Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
*/
-#ifndef __YPORTENV_LINUX_H__
-#define __YPORTENV_LINUX_H__
+#ifndef __YPORTENV_H__
+#define __YPORTENV_H__
+/*
+ * Define the MTD version in terms of Linux Kernel versions
+ * This allows yaffs to be used independantly of the kernel
+ * as well as with it.
+ */
+
+#define MTD_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
+
+#ifdef YAFFS_OUT_OF_TREE
+#include "moduleconfig.h"
+#endif
+
+#include <linux/version.h>
+#define MTD_VERSION_CODE LINUX_VERSION_CODE
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19))
+#include <linux/config.h>
+#endif
#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/mm.h>
@@ -31,6 +49,7 @@
#include <linux/sort.h>
#include <linux/bitops.h>
+/* These type wrappings are used to support Unicode names in WinCE. */
#define YCHAR char
#define YUCHAR unsigned char
#define _Y(x) x
@@ -42,29 +61,22 @@
#define YAFFS_ROOT_MODE 0755
#define YAFFS_LOSTNFOUND_MODE 0700
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
#define Y_CURRENT_TIME CURRENT_TIME.tv_sec
#define Y_TIME_CONVERT(x) (x).tv_sec
+#else
+#define Y_CURRENT_TIME CURRENT_TIME
+#define Y_TIME_CONVERT(x) (x)
+#endif
#define compile_time_assertion(assertion) \
({ int x = __builtin_choose_expr(assertion, 0, (void)0); (void) x; })
-#ifndef Y_DUMP_STACK
-#define Y_DUMP_STACK() dump_stack()
-#endif
-
#define yaffs_trace(msk, fmt, ...) do { \
- if(yaffs_trace_mask & (msk)) \
+ if (yaffs_trace_mask & (msk)) \
printk(KERN_DEBUG "yaffs: " fmt "\n", ##__VA_ARGS__); \
-} while(0)
-
-#ifndef YBUG
-#define YBUG() do {\
- yaffs_trace(YAFFS_TRACE_BUG,\
- "bug " __FILE__ " %d",\
- __LINE__);\
- Y_DUMP_STACK();\
} while (0)
-#endif
+
#endif