2 * Copyright (c) 2011 Samsung Electronics
3 * Lukasz Majewski <l.majewski@samsung.com>
5 * This is a Linux kernel compatibility layer for USB Gadget
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23 #ifndef __LIN_COMPAT_H__
24 #define __LIN_COMPAT_H__
27 #define spin_lock_init(...)
28 #define spin_lock(...)
29 #define spin_lock_irqsave(lock, flags) do {flags = 1; } while (0)
30 #define spin_unlock(...)
31 #define spin_unlock_irqrestore(lock, flags) do {flags = 0; } while (0)
32 #define disable_irq(...)
33 #define enable_irq(...)
35 #define mutex_init(...)
36 #define mutex_lock(...)
37 #define mutex_unlock(...)
39 #define WARN_ON(x) if (x) {printf("WARNING in %s line %d\n" \
40 , __FILE__, __LINE__); }
51 #define ENOTSUPP 524 /* Operation is not supported */
53 #define kmalloc(size, type) memalign(CONFIG_SYS_CACHELINE_SIZE, size)
54 #define kfree(addr) free(addr)
55 #define mdelay(n) ({unsigned long msec = (n); while (msec--) udelay(1000); })
59 #define dma_cache_maint(addr, size, mode) cache_flush()
60 void cache_flush(void);
62 #endif /* __LIN_COMPAT_H__ */