8 #define container_of(ptr, type, member) ({ \
9 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
10 (type *)( (char *)__mptr - offsetof(type,member) );})
17 #define MAX_ERRNO 4095
19 #define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
21 static inline void *ERR_PTR(long error
)
23 return (void *) error
;
26 static inline long PTR_ERR(const void *ptr
)
31 static inline long IS_ERR(const void *ptr
)
33 return IS_ERR_VALUE((unsigned long)ptr
);
37 /* FIXED SIZE INTEGERS */
49 #define DEFINE_MUTEX(m) pthread_mutex_t (m) = PTHREAD_MUTEX_INITIALIZER;
51 #define mutex_lock(m) pthread_mutex_lock(m)
53 #define mutex_unlock(m) pthread_mutex_unlock(m)
58 #define kmalloc(s, t) malloc(s)
59 #define kzalloc(s, t) malloc(s)
60 #define kfree(p) free((void *)p)
61 #define kstrdup(s, t) strdup(s)
65 #define printk(fmt, args...) printf(fmt, ## args)
70 #define smp_rmb() do {} while(0)
71 #define smp_wmb() do {} while(0)
72 #define smp_mb() do {} while(0)
73 #define smp_mb__after_atomic_inc() do {} while(0)
75 #define read_barrier_depends() do {} while(0)
76 #define smp_read_barrier_depends() do {} while(0)
80 #define rcu_assign_pointer(a, b) do {} while(0)
85 typedef struct { sig_atomic_t counter
; } atomic_t
;
87 static inline int atomic_dec_and_test(atomic_t
*p
)
93 static inline void atomic_set(atomic_t
*p
, int v
)
98 static inline void atomic_inc(atomic_t
*p
)
103 static int atomic_read(atomic_t
*p
)
109 #define ____cacheline_aligned
111 #endif /* KERNELCOMPAT_H */
This page took 0.035342 seconds and 4 git commands to generate.