1 #ifndef _LINUX_COMPAT_H_
2 #define _LINUX_COMPAT_H_
4 #define ndelay(x) udelay(1)
17 #define kmalloc(size, flags) malloc(size)
18 #define kzalloc(size, flags) calloc(size, 1)
19 #define vmalloc(size) malloc(size)
20 #define kfree(ptr) free(ptr)
21 #define vfree(ptr) free(ptr)
23 #define DECLARE_WAITQUEUE(...) do { } while (0)
24 #define add_wait_queue(...) do { } while (0)
25 #define remove_wait_queue(...) do { } while (0)
27 #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
30 * ..and if you can't take the strict
31 * types, you can specify one yourself.
33 * Or not use min/max at all, of course.
35 #define min_t(type,x,y) \
36 ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
37 #define max_t(type,x,y) \
38 ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
42 printf("U-Boot BUG at %s:%d!\n", __FILE__, __LINE__); \
45 #define BUG_ON(condition) do { if (condition) BUG(); } while(0)
48 #define WARN_ON(x) if (x) {printf("WARNING in %s line %d\n" \
49 , __FILE__, __LINE__); }
51 #define PAGE_SIZE 4096