Add raw spinlock wrapper for kernels < 2.6.33
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 24 Jun 2011 02:47:25 +0000 (22:47 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 24 Jun 2011 02:47:25 +0000 (22:47 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lib/ringbuffer/frontend_types.h
wrapper/spinlock.h [new file with mode: 0644]

index fe208b676e0f035f8bd4b9794ca94f79f24ca8dd..283a254f2a61dccc0725b1d9d03d546838fe1ee4 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/kref.h>
 #include "../../wrapper/ringbuffer/config.h"
 #include "../../wrapper/ringbuffer/backend_types.h"
+#include "../../wrapper/spinlock.h"
 #include "../../lib/prio_heap/lttng_prio_heap.h"       /* For per-CPU read-side iterator */
 
 /*
diff --git a/wrapper/spinlock.h b/wrapper/spinlock.h
new file mode 100644 (file)
index 0000000..af00ef2
--- /dev/null
@@ -0,0 +1,23 @@
+#ifndef _LTT_WRAPPER_SPINLOCK_H
+#define _LTT_WRAPPER_SPINLOCK_H
+
+/*
+ * Copyright (C) 2011 Mathieu Desnoyers (mathieu.desnoyers@efficios.com)
+ *
+ * Dual LGPL v2.1/GPL v2 license.
+ */
+
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
+
+#define raw_spin_lock_init(lock)                               \
+       do {                                                    \
+               *(lock) = __RAW_SPIN_LOCK_UNLOCKED(lock);       \
+       } while (0)
+
+#define raw_spin_is_locked(lock)       spin_is_locked(lock)
+
+
+#endif
+#endif /* _LTT_WRAPPER_SPINLOCK_H */
This page took 0.029599 seconds and 4 git commands to generate.