#define __nocf_check __attribute__((nocf_check))
#endif
+#ifndef __refdata
+#define __refdata
+#endif
+
/* Are two types/vars the same type (ignoring qualifiers)? */
#ifndef __same_type
# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
/* context/locking */
# define __must_hold(x) __attribute__((context(x,1,1)))
# define __acquires(x) __attribute__((context(x,0,1)))
+# define __cond_acquires(x) __attribute__((context(x,0,-1)))
# define __releases(x) __attribute__((context(x,1,0)))
# define __acquire(x) __context__(x,1)
# define __release(x) __context__(x,-1)
# define __acquires(x)
# define __releases(x)
# define __acquire(x) (void)0
+# define __cond_acquires(x)
# define __release(x) (void)0
# define __cond_lock(x,c) (c)
#endif /* __CHECKER__ */
#define spin_lock_irqsave(x, f) (void)f, pthread_mutex_lock(x)
#define spin_unlock_irqrestore(x, f) (void)f, pthread_mutex_unlock(x)
+#define spin_trylock(x) (pthread_mutex_trylock(x) == 0)
+
#define arch_spinlock_t pthread_mutex_t
#define __ARCH_SPIN_LOCK_UNLOCKED PTHREAD_MUTEX_INITIALIZER
--- /dev/null
+#include <uapi/linux/stddef.h>
+
+#define DECLARE_FLEX_ARRAY(TYPE, NAME) __DECLARE_FLEX_ARRAY(TYPE, NAME)
#define __must_hold(x)
#define EXPORT_PER_CPU_SYMBOL_GPL(x)
+
+#define PAGE_SIZE 4096
#endif /* _KERNEL_H */
--- /dev/null
+#include <malloc.h>
+
+#define vmalloc(x) malloc(x)
+#define __vmalloc_node(size, align, gfp, node, caller) memalign(size, align)
+#define vfree(x) free(x)
+
+#define kvmalloc(x, gfp) memalign(x, x)
+#define kvfree(x) free(x)
+
+/* A correct but slow implementation */
+#define kvfree_rcu_mightsleep(x) { \
+ synchronize_rcu(); \
+ free(x); \
+}