2015-01-02 08:53:04 +01:00
|
|
|
|
2015-01-06 12:18:43 +01:00
|
|
|
#define __alignof__(x) 1
|
|
|
|
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
|
|
|
|
#define ARRAY_SIZE(A) (sizeof(A) / sizeof(A[0]))
|
|
|
|
#define BUG_ON(C) if (C) exit(1)
|
2015-01-06 15:59:32 +01:00
|
|
|
#define GOTO(label, rc) goto label
|
|
|
|
#define RETURN(x) return x
|
2015-01-06 12:18:43 +01:00
|
|
|
#define NVERSION(version) (version >> 16) & 0xFF, (version >> 8) & 0xFF, version & 0xFF
|
2015-01-02 08:53:04 +01:00
|
|
|
#define container_of(ptr, type, member) ({ \
|
|
|
|
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
|
|
|
|
(type *)( (char *)__mptr - offsetof(type,member) );})
|
|
|
|
|
2015-01-06 16:25:07 +01:00
|
|
|
#define __get_user(x, ptr) ((x) = somevalue + sizeof(*ptr))
|
|
|
|
|
2015-01-02 08:53:04 +01:00
|
|
|
void panic(const char *fmt, ...) __attribute__((noreturn));
|
|
|
|
|
2015-01-06 12:18:43 +01:00
|
|
|
|