diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/lglock.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/lglock.h b/include/linux/lglock.h index 96549abe8842..0081f000e34b 100644 --- a/include/linux/lglock.h +++ b/include/linux/lglock.h | |||
| @@ -25,6 +25,8 @@ | |||
| 25 | #include <linux/cpu.h> | 25 | #include <linux/cpu.h> |
| 26 | #include <linux/notifier.h> | 26 | #include <linux/notifier.h> |
| 27 | 27 | ||
| 28 | #ifdef CONFIG_SMP | ||
| 29 | |||
| 28 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 30 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| 29 | #define LOCKDEP_INIT_MAP lockdep_init_map | 31 | #define LOCKDEP_INIT_MAP lockdep_init_map |
| 30 | #else | 32 | #else |
| @@ -57,4 +59,18 @@ void lg_local_unlock_cpu(struct lglock *lg, int cpu); | |||
| 57 | void lg_global_lock(struct lglock *lg); | 59 | void lg_global_lock(struct lglock *lg); |
| 58 | void lg_global_unlock(struct lglock *lg); | 60 | void lg_global_unlock(struct lglock *lg); |
| 59 | 61 | ||
| 62 | #else | ||
| 63 | /* When !CONFIG_SMP, map lglock to spinlock */ | ||
| 64 | #define lglock spinlock | ||
| 65 | #define DEFINE_LGLOCK(name) DEFINE_SPINLOCK(name) | ||
| 66 | #define DEFINE_STATIC_LGLOCK(name) static DEFINE_SPINLOCK(name) | ||
| 67 | #define lg_lock_init(lg, name) spin_lock_init(lg) | ||
| 68 | #define lg_local_lock spin_lock | ||
| 69 | #define lg_local_unlock spin_unlock | ||
| 70 | #define lg_local_lock_cpu(lg, cpu) spin_lock(lg) | ||
| 71 | #define lg_local_unlock_cpu(lg, cpu) spin_unlock(lg) | ||
| 72 | #define lg_global_lock spin_lock | ||
| 73 | #define lg_global_unlock spin_unlock | ||
| 74 | #endif | ||
| 75 | |||
| 60 | #endif | 76 | #endif |
