lin_gadget_compat.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (c) 2011 Samsung Electronics
  3. * Lukasz Majewski <l.majewski@samsung.com>
  4. *
  5. * This is a Linux kernel compatibility layer for USB Gadget
  6. *
  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.
  11. *
  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.
  16. *
  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,
  20. * MA 02111-1307 USA
  21. */
  22. #ifndef __LIN_COMPAT_H__
  23. #define __LIN_COMPAT_H__
  24. /* common */
  25. #define spin_lock_init(...)
  26. #define spin_lock(...)
  27. #define spin_lock_irqsave(lock, flags) do {flags = 1; } while (0)
  28. #define spin_unlock(...)
  29. #define spin_unlock_irqrestore(lock, flags) do {flags = 0; } while (0)
  30. #define disable_irq(...)
  31. #define enable_irq(...)
  32. #define mutex_init(...)
  33. #define mutex_lock(...)
  34. #define mutex_unlock(...)
  35. #define WARN_ON(x) if (x) {printf("WARNING in %s line %d\n" \
  36. , __FILE__, __LINE__); }
  37. #define KERN_WARNING
  38. #define KERN_ERR
  39. #define KERN_NOTICE
  40. #define KERN_DEBUG
  41. #define GFP_KERNEL 0
  42. #define IRQ_HANDLED 1
  43. #define ENOTSUPP 524 /* Operation is not supported */
  44. #define kmalloc(size, type) memalign(CONFIG_SYS_CACHELINE_SIZE, size)
  45. #define kfree(addr) free(addr)
  46. #define mdelay(n) ({unsigned long msec = (n); while (msec--) udelay(1000); })
  47. #define __iomem
  48. #define min_t min
  49. #define dma_cache_maint(addr, size, mode) cache_flush()
  50. void cache_flush(void);
  51. #endif /* __LIN_COMPAT_H__ */