Ilya Yanok | 06bb920 | 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 | |
| 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 schedule_work(work) do {} while (0) |
| 38 | #define INIT_WORK(work, fun) do {} while (0) |
| 39 | |
| 40 | #define cpu_relax() do {} while (0) |
| 41 | |
| 42 | #define pr_debug(fmt, args...) debug(fmt, ##args) |
| 43 | #define dev_dbg(dev, fmt, args...) \ |
| 44 | debug(fmt, ##args) |
| 45 | #define dev_vdbg(dev, fmt, args...) \ |
| 46 | debug(fmt, ##args) |
| 47 | #define dev_info(dev, fmt, args...) \ |
| 48 | printf(fmt, ##args) |
| 49 | #define dev_err(dev, fmt, args...) \ |
| 50 | printf(fmt, ##args) |
| 51 | #define printk printf |
| 52 | |
| 53 | #define WARN(condition, fmt, args...) ({ \ |
| 54 | int ret_warn = !!condition; \ |
| 55 | if (ret_warn) \ |
| 56 | printf(fmt, ##args); \ |
| 57 | ret_warn; }) |
| 58 | |
| 59 | #define KERN_DEBUG |
| 60 | #define KERN_NOTICE |
| 61 | #define KERN_WARNING |
| 62 | #define KERN_ERR |
| 63 | |
| 64 | #define kfree(ptr) free(ptr) |
| 65 | |
| 66 | #define pm_runtime_get_sync(dev) do {} while (0) |
| 67 | #define pm_runtime_put(dev) do {} while (0) |
| 68 | #define pm_runtime_put_sync(dev) do {} while (0) |
| 69 | #define pm_runtime_use_autosuspend(dev) do {} while (0) |
| 70 | #define pm_runtime_set_autosuspend_delay(dev, delay) do {} while (0) |
| 71 | #define pm_runtime_enable(dev) do {} while (0) |
| 72 | |
| 73 | #define MODULE_DESCRIPTION(desc) |
| 74 | #define MODULE_AUTHOR(author) |
| 75 | #define MODULE_LICENSE(license) |
| 76 | #define MODULE_ALIAS(alias) |
| 77 | #define module_param(name, type, perm) |
| 78 | #define MODULE_PARM_DESC(name, desc) |
| 79 | #define EXPORT_SYMBOL_GPL(name) |
| 80 | |
| 81 | #define writesl(a, d, s) __raw_writesl((unsigned long)a, d, s) |
| 82 | #define readsl(a, d, s) __raw_readsl((unsigned long)a, d, s) |
| 83 | #define writesw(a, d, s) __raw_writesw((unsigned long)a, d, s) |
| 84 | #define readsw(a, d, s) __raw_readsw((unsigned long)a, d, s) |
| 85 | #define writesb(a, d, s) __raw_writesb((unsigned long)a, d, s) |
| 86 | #define readsb(a, d, s) __raw_readsb((unsigned long)a, d, s) |
| 87 | |
| 88 | #define IRQ_NONE 0 |
| 89 | #define IRQ_HANDLED 0 |
| 90 | |
| 91 | #define dev_set_drvdata(dev, data) do {} while (0) |
| 92 | |
| 93 | #define disable_irq_wake(irq) do {} while (0) |
| 94 | #define enable_irq_wake(irq) -EINVAL |
| 95 | #define free_irq(irq, data) do {} while (0) |
| 96 | #define request_irq(nr, f, flags, nm, data) 0 |
| 97 | |
| 98 | #define device_init_wakeup(dev, a) do {} while (0) |
| 99 | |
| 100 | #define platform_data device_data |
| 101 | |
| 102 | #ifndef wmb |
| 103 | #define wmb() asm volatile ("" : : : "memory") |
| 104 | #endif |
| 105 | |
Ilya Yanok | cc0fcbf | 2012-11-06 13:48:25 +0000 | [diff] [blame^] | 106 | #define msleep(a) udelay(a * 1000) |
Ilya Yanok | 06bb920 | 2012-11-06 13:48:21 +0000 | [diff] [blame] | 107 | #endif /* __LINUX_COMPAT_H__ */ |