X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=share%2Fkernelcompat.h;h=e322bdbaad8c504e7e679e09afaf6a0432adb914;hb=ba6459ba344b54a4f7775e431447be79fd7790f8;hp=c5512b8d4c848f4c35ee91c8cc23c9e4f080b3f6;hpb=8d938dbd14e689a294f8a251e4ac255985c65ad5;p=ust.git diff --git a/share/kernelcompat.h b/share/kernelcompat.h index c5512b8..e322bdb 100644 --- a/share/kernelcompat.h +++ b/share/kernelcompat.h @@ -63,6 +63,7 @@ typedef uint64_t u64; #include #define DEFINE_MUTEX(m) pthread_mutex_t (m) = PTHREAD_MUTEX_INITIALIZER; +#define DECLARE_MUTEX(m) extern pthread_mutex_t (m); #define mutex_lock(m) pthread_mutex_lock(m) @@ -82,10 +83,12 @@ typedef int spinlock_t; #include #define kmalloc(s, t) malloc(s) -#define kzalloc(s, t) malloc(s) +#define kzalloc(s, t) zmalloc(s) #define kfree(p) free((void *)p) #define kstrdup(s, t) strdup(s) +#define zmalloc(s) calloc(1, s) + #define GFP_KERNEL /* PRINTK */ @@ -108,6 +111,8 @@ typedef int spinlock_t; #define rcu_assign_pointer(a, b) do {} while(0) #define call_rcu_sched(a,b) do {} while(0) #define rcu_barrier_sched() do {} while(0) +#define rcu_read_lock_sched_notrace() do{} while (0) +#define rcu_read_unlock_sched_notrace() do{} while (0) /* ATOMICITY */ @@ -302,4 +307,6 @@ static inline u32 trace_clock_freq_scale(void) #define EXPORT_SYMBOL_GPL(a) /*nothing*/ +#define smp_processor_id() (-1) + #endif /* KERNELCOMPAT_H */