compat.h 943 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef _LINUX_COMPAT_H_
  2. #define _LINUX_COMPAT_H_
  3. #define __user
  4. #define __iomem
  5. #define ndelay(x) udelay(1)
  6. #define printk printf
  7. #define KERN_EMERG
  8. #define KERN_ALERT
  9. #define KERN_CRIT
  10. #define KERN_ERR
  11. #define KERN_WARNING
  12. #define KERN_NOTICE
  13. #define KERN_INFO
  14. #define KERN_DEBUG
  15. #define kmalloc(size, flags) malloc(size)
  16. #define kfree(ptr) free(ptr)
  17. /*
  18. * ..and if you can't take the strict
  19. * types, you can specify one yourself.
  20. *
  21. * Or not use min/max at all, of course.
  22. */
  23. #define min_t(type,x,y) \
  24. ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
  25. #define max_t(type,x,y) \
  26. ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
  27. #define BUG() do { \
  28. printf("U-Boot BUG at %s:%d!\n", __FILE__, __LINE__); \
  29. } while (0)
  30. #define BUG_ON(condition) do { if (condition) BUG(); } while(0)
  31. #define likely(x) __builtin_expect(!!(x), 1)
  32. #define unlikely(x) __builtin_expect(!!(x), 0)
  33. #define PAGE_SIZE 4096
  34. #endif