Add uprobes support
[lttng-modules.git] / wrapper / spinlock.h
1 /* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1)
2 *
3 * wrapper/spinlock.h
4 *
5 * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 */
7
8 #ifndef _LTTNG_WRAPPER_SPINLOCK_H
9 #define _LTTNG_WRAPPER_SPINLOCK_H
10
11 #include <linux/version.h>
12
13 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
14
15 #include <linux/string.h>
16
17 #define raw_spin_lock_init(lock) \
18 do { \
19 raw_spinlock_t __lock = __RAW_SPIN_LOCK_UNLOCKED; \
20 memcpy(lock, &__lock, sizeof(lock)); \
21 } while (0)
22
23 #define raw_spin_is_locked(lock) __raw_spin_is_locked(lock)
24
25 #define wrapper_desc_spin_lock(lock) spin_lock(lock)
26 #define wrapper_desc_spin_unlock(lock) spin_unlock(lock)
27
28 #else
29
30 #define wrapper_desc_spin_lock(lock) raw_spin_lock(lock)
31 #define wrapper_desc_spin_unlock(lock) raw_spin_unlock(lock)
32
33 #endif
34 #endif /* _LTTNG_WRAPPER_SPINLOCK_H */
This page took 0.030309 seconds and 4 git commands to generate.