|
@@ -25,6 +25,8 @@
|
|
#include <linux/cpu.h>
|
|
#include <linux/cpu.h>
|
|
#include <linux/notifier.h>
|
|
#include <linux/notifier.h>
|
|
|
|
|
|
|
|
+#ifdef CONFIG_SMP
|
|
|
|
+
|
|
#ifdef CONFIG_DEBUG_LOCK_ALLOC
|
|
#ifdef CONFIG_DEBUG_LOCK_ALLOC
|
|
#define LOCKDEP_INIT_MAP lockdep_init_map
|
|
#define LOCKDEP_INIT_MAP lockdep_init_map
|
|
#else
|
|
#else
|
|
@@ -57,4 +59,18 @@ void lg_local_unlock_cpu(struct lglock *lg, int cpu);
|
|
void lg_global_lock(struct lglock *lg);
|
|
void lg_global_lock(struct lglock *lg);
|
|
void lg_global_unlock(struct lglock *lg);
|
|
void lg_global_unlock(struct lglock *lg);
|
|
|
|
|
|
|
|
+#else
|
|
|
|
+/* When !CONFIG_SMP, map lglock to spinlock */
|
|
|
|
+#define lglock spinlock
|
|
|
|
+#define DEFINE_LGLOCK(name) DEFINE_SPINLOCK(name)
|
|
|
|
+#define DEFINE_STATIC_LGLOCK(name) static DEFINE_SPINLOCK(name)
|
|
|
|
+#define lg_lock_init(lg, name) spin_lock_init(lg)
|
|
|
|
+#define lg_local_lock spin_lock
|
|
|
|
+#define lg_local_unlock spin_unlock
|
|
|
|
+#define lg_local_lock_cpu(lg, cpu) spin_lock(lg)
|
|
|
|
+#define lg_local_unlock_cpu(lg, cpu) spin_unlock(lg)
|
|
|
|
+#define lg_global_lock spin_lock
|
|
|
|
+#define lg_global_unlock spin_unlock
|
|
|
|
+#endif
|
|
|
|
+
|
|
#endif
|
|
#endif
|