5 #define MB (1024 * 1024UL)
8 void * alloc_shared(unsigned int size
);
9 void * zmalloc(size_t size
);
11 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
13 #define max(x, y) ((x) >= (y) ? (x) : (y))
14 #define min(x, y) ((x) <= (y) ? (x) : (y))
17 # define offsetof(type, member) ((size_t) &((type *) 0)->member)
20 #define MAX_ERRNO 4095
21 #define IS_ERR_VALUE(x) ((x) >= (unsigned long)-MAX_ERRNO)
22 static inline long IS_ERR(unsigned long x
)
24 return IS_ERR_VALUE(x
);
27 void sizeunit(unsigned long size
, char *buf
);