1 #ifndef __LINUX_COMPAT_H__
2 #define __LINUX_COMPAT_H__
3 
4 #include <malloc.h>
5 #include <linux/list.h>
6 #include <linux/compat.h>
7 
8 #define __init
9 #define __devinit
10 #define __devinitdata
11 #define __devinitconst
12 #define __iomem
13 #define __deprecated
14 
15 typedef enum { false = 0, true = 1 } bool;
16 
17 struct unused {};
18 typedef struct unused unused_t;
19 
20 typedef int irqreturn_t;
21 typedef unused_t spinlock_t;
22 
23 struct work_struct {};
24 
25 struct timer_list {};
26 struct notifier_block {};
27 
28 typedef unsigned long dmaaddr_t;
29 
30 #define spin_lock_init(lock) do {} while (0)
31 #define spin_lock(lock) do {} while (0)
32 #define spin_unlock(lock) do {} while (0)
33 #define spin_lock_irqsave(lock, flags) do {} while (0)
34 #define spin_unlock_irqrestore(lock, flags) do {} while (0)
35 
36 #define setup_timer(timer, func, data) do {} while (0)
37 #define del_timer_sync(timer) do {} while (0)
38 #define schedule_work(work) do {} while (0)
39 #define INIT_WORK(work, fun) do {} while (0)
40 
41 #define cpu_relax() do {} while (0)
42 
43 #define pr_debug(fmt, args...) debug(fmt, ##args)
44 #define dev_dbg(dev, fmt, args...)		\
45 	debug(fmt, ##args)
46 #define dev_vdbg(dev, fmt, args...)		\
47 	debug(fmt, ##args)
48 #define dev_info(dev, fmt, args...)		\
49 	printf(fmt, ##args)
50 #define dev_err(dev, fmt, args...)		\
51 	printf(fmt, ##args)
52 #define printk printf
53 
54 #define WARN(condition, fmt, args...) ({	\
55 	int ret_warn = !!condition;		\
56 	if (ret_warn)				\
57 		printf(fmt, ##args);		\
58 	ret_warn; })
59 
60 #define KERN_DEBUG
61 #define KERN_NOTICE
62 #define KERN_WARNING
63 #define KERN_ERR
64 
65 #define kfree(ptr) free(ptr)
66 
67 #define pm_runtime_get_sync(dev) do {} while (0)
68 #define pm_runtime_put(dev) do {} while (0)
69 #define pm_runtime_put_sync(dev) do {} while (0)
70 #define pm_runtime_use_autosuspend(dev) do {} while (0)
71 #define pm_runtime_set_autosuspend_delay(dev, delay) do {} while (0)
72 #define pm_runtime_enable(dev) do {} while (0)
73 
74 #define MODULE_DESCRIPTION(desc)
75 #define MODULE_AUTHOR(author)
76 #define MODULE_LICENSE(license)
77 #define MODULE_ALIAS(alias)
78 #define module_param(name, type, perm)
79 #define MODULE_PARM_DESC(name, desc)
80 #define EXPORT_SYMBOL_GPL(name)
81 
82 #define writesl(a, d, s) __raw_writesl((unsigned long)a, d, s)
83 #define readsl(a, d, s) __raw_readsl((unsigned long)a, d, s)
84 #define writesw(a, d, s) __raw_writesw((unsigned long)a, d, s)
85 #define readsw(a, d, s) __raw_readsw((unsigned long)a, d, s)
86 #define writesb(a, d, s) __raw_writesb((unsigned long)a, d, s)
87 #define readsb(a, d, s) __raw_readsb((unsigned long)a, d, s)
88 
89 #define IRQ_NONE 0
90 #define IRQ_HANDLED 0
91 
92 #define dev_set_drvdata(dev, data) do {} while (0)
93 
94 #define disable_irq_wake(irq) do {} while (0)
95 #define enable_irq_wake(irq) -EINVAL
96 #define free_irq(irq, data) do {} while (0)
97 #define request_irq(nr, f, flags, nm, data) 0
98 
99 #define device_init_wakeup(dev, a) do {} while (0)
100 
101 #define platform_data device_data
102 
103 #ifndef wmb
104 #define wmb()			asm volatile (""   : : : "memory")
105 #endif
106 
107 #define msleep(a)	udelay(a * 1000)
108 
109 /*
110  * Map U-Boot config options to Linux ones
111  */
112 #ifdef CONFIG_OMAP34XX
113 #define CONFIG_SOC_OMAP3430
114 #endif
115 
116 #endif /* __LINUX_COMPAT_H__ */
117