00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef _MTDCOMPAT_H
00028 #define _MTDCOMPAT_H
00029
00030 #include <linux/autoconf.h>
00031
00032 #ifndef __ASSEMBLER__
00033
00034 #include "lib.h"
00035
00036
00037 #undef CONFIG_MTD_PARTITIONS
00038 #undef CONFIG_MTD_DEBUG
00039 #undef CONFIG_MTD_DEBUG_VERBOSE
00040 #define CONFIG_MTD_DEBUG_VERBOSE 3
00041 #undef CONFIG_MTD_NAND_VERIFY_WRITE
00042 #define CONFIG_MTD_NAND_VERIFY_WRITE
00043
00044
00045
00046 #define NAND_BBT_SUPPORT 0
00047 #define NAND_WRITE_SUPPORT 0
00048 #define NAND_ERASE_SUPPORT 0
00049 #define NAND_MULTICHIP_SUPPORT 0
00050 #define NAND_HWECC_SUPPORT 0
00051 #define NAND_KVEC_SUPPORT 0
00052
00053
00054
00055 #if (NAND_ERASE_SUPPORT == 0)
00056 #define nand_erase NULL
00057 #endif
00058
00059 #if (NAND_WRITE_SUPPORT == 0)
00060 #define nand_write NULL
00061 #define nand_write_ecc NULL
00062 #define nand_write_oob NULL
00063 #define nand_block_markbad NULL
00064 #define nand_default_block_markbad NULL
00065 #endif
00066
00067 #if (NAND_KVEC_SUPPORT == 0)
00068 #define nand_writev NULL
00069 #define nand_writev_ecc NULL
00070 #endif
00071
00072 #if (NAND_KVEC_SUPPORT == 0)
00073 struct kvec { int x; };
00074 #endif
00075
00076
00077 #define min_t(type,x,y) \
00078 ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
00079
00080 #define max_t(type,x,y) \
00081 ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
00082
00083 #define min(x,y) ({ \
00084 typeof(x) _x = (x); \
00085 typeof(y) _y = (y); \
00086 (void) (&_x == &_y); \
00087 _x < _y ? _x : _y; })
00088
00089 #define max(x,y) ({ \
00090 typeof(x) _x = (x); \
00091 typeof(y) _y = (y); \
00092 (void) (&_x == &_y); \
00093 _x > _y ? _x : _y; })
00094
00095
00096
00097 #undef cpu_to_le16
00098 #define cpu_to_le16(x) ((__le16) (__u16)(x))
00099 #undef le16_to_cpu
00100 #define le16_to_cpu(x) ((__u16) (__le16)(x))
00101
00102
00103 #define GFP_KERNEL 0
00104 #define kmalloc(size, mode) malloc(size)
00105 #define kfree(ptr) free(ptr)
00106
00107
00108 #define HZ 1000
00109 #define TASK_INTERRUPTIBLE 0
00110 #define TASK_UNINTERRUPTIBLE 1
00111 #define set_current_state(x) do { } while (0)
00112 #define schedule() do { } while (0)
00113 #define cond_resched() do { } while (0)
00114 #define wake_up(x) do { } while (0)
00115
00116
00117 struct list_head { int x; };
00118 #define wait_queue_head_t int
00119 #define DECLARE_WAITQUEUE(x, y)
00120 #define init_waitqueue_head(x) do { } while (0)
00121 #define init_waitqueue_head(x) do { } while (0)
00122 #define add_wait_queue(x, y) do { } while (0)
00123 #define remove_wait_queue(x, y) do { } while (0)
00124
00125
00126 #define spinlock_t int
00127 #define spin_lock_init(x) do { } while (0)
00128 #define spin_lock(x) do { } while (0)
00129 #define spin_unlock(x) do { } while (0)
00130
00131
00132 unsigned long jiffies;
00133 #define time_before(x, y) (x | y | 1)
00134
00135
00136 #undef local_irq_save
00137 #define local_irq_save(x) do { (void)x; } while (0)
00138 #undef local_irq_restore
00139 #define local_irq_restore(x) do { (void)x; } while (0)
00140
00141
00142 #define __iomem
00143 #define ioremap(addr, pgsize) ((void *) (addr))
00144 #define iounmap(addr) do { } while (0)
00145
00146
00147
00148 #ifdef DO_PRINTK
00149 #define printk(fmt, params...) simple_printk(fmt)
00150 void simple_printk(const char *fmt);
00151 #else
00152 #define printk(fmt, params...) do { } while (0)
00153 #endif
00154 #define KERN_INFO ""
00155 #define KERN_DEBUG ""
00156 #define KERN_NOTICE ""
00157 #define KERN_WARNING ""
00158 #define KERN_ERR ""
00159
00160
00161 #define __init
00162 #define __exit
00163 #define module_init(x)
00164 #define module_exit(x)
00165 #define MODULE_LICENSE(x)
00166 #define MODULE_AUTHOR(x)
00167 #define MODULE_DESCRIPTION(x)
00168 #define EXPORT_SYMBOL(x)
00169 #define EXPORT_SYMBOL_GPL(x)
00170
00171
00172 #define touch_softlockup_watchdog() do { } while (0)
00173 #undef THIS_MODULE
00174 #define THIS_MODULE 0
00175 struct notifier_block { int x; };
00176
00177 #undef BUG
00178 #define BUG() error2("BUG in " __FILE__, __LINE__, __FUNCTION__)
00179
00180 #endif
00181
00182 #endif