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