Commit | Line | Data |
---|---|---|
a181050f MD |
1 | #ifndef _LTT_WRAPPER_SPINLOCK_H |
2 | #define _LTT_WRAPPER_SPINLOCK_H | |
3 | ||
4 | /* | |
5 | * Copyright (C) 2011 Mathieu Desnoyers (mathieu.desnoyers@efficios.com) | |
6 | * | |
7 | * Dual LGPL v2.1/GPL v2 license. | |
8 | */ | |
9 | ||
10 | #include <linux/version.h> | |
11 | ||
12 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)) | |
13 | ||
8e1be6f1 MD |
14 | #include <linux/string.h> |
15 | ||
16 | #define raw_spin_lock_init(lock) \ | |
17 | do { \ | |
18 | raw_spinlock_t __lock = __RAW_SPIN_LOCK_UNLOCKED; \ | |
19 | memcpy(lock, &__lock, sizeof(lock)); \ | |
a181050f MD |
20 | } while (0) |
21 | ||
dce93417 | 22 | #define raw_spin_is_locked(lock) __raw_spin_is_locked(lock) |
a181050f MD |
23 | |
24 | ||
25 | #endif | |
26 | #endif /* _LTT_WRAPPER_SPINLOCK_H */ |