1 #ifndef _LINUX_COMPAT_H_
2 #define _LINUX_COMPAT_H_
4 #define ndelay(x) udelay(1)
6 #define dev_dbg(dev, fmt, args...) \
8 #define dev_vdbg(dev, fmt, args...) \
10 #define dev_info(dev, fmt, args...) \
12 #define dev_err(dev, fmt, args...) \
25 #define kmalloc(size, flags) malloc(size)
26 #define kzalloc(size, flags) calloc(size, 1)
27 #define vmalloc(size) malloc(size)
28 #define kfree(ptr) free(ptr)
29 #define vfree(ptr) free(ptr)
31 #define DECLARE_WAITQUEUE(...) do { } while (0)
32 #define add_wait_queue(...) do { } while (0)
33 #define remove_wait_queue(...) do { } while (0)
35 #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
38 * ..and if you can't take the strict
39 * types, you can specify one yourself.
41 * Or not use min/max at all, of course.
43 #define min_t(type,x,y) \
44 ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
45 #define max_t(type,x,y) \
46 ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
50 printf("U-Boot BUG at %s:%d!\n", __FILE__, __LINE__); \
53 #define BUG_ON(condition) do { if (condition) BUG(); } while(0)
56 #define WARN_ON(x) if (x) {printf("WARNING in %s line %d\n" \
57 , __FILE__, __LINE__); }
59 #define PAGE_SIZE 4096