1 #ifndef _LINUX_COMPAT_H_
2 #define _LINUX_COMPAT_H_
7 #define ndelay(x) udelay(1)
20 #define kmalloc(size, flags) malloc(size)
21 #define kzalloc(size, flags) calloc(size, 1)
22 #define vmalloc(size) malloc(size)
23 #define kfree(ptr) free(ptr)
24 #define vfree(ptr) free(ptr)
26 #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
29 * ..and if you can't take the strict
30 * types, you can specify one yourself.
32 * Or not use min/max at all, of course.
34 #define min_t(type,x,y) \
35 ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
36 #define max_t(type,x,y) \
37 ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
41 printf("U-Boot BUG at %s:%d!\n", __FILE__, __LINE__); \
44 #define BUG_ON(condition) do { if (condition) BUG(); } while(0)
47 #define likely(x) __builtin_expect(!!(x), 1)
48 #define unlikely(x) __builtin_expect(!!(x), 0)
50 #define PAGE_SIZE 4096