]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - include/linux/lockdep.h
ssb: remove the ssb DMA API
[linux-2.6.git] / include / linux / lockdep.h
index 12aabfcb45f641b8031970f4da1c70d427d162ef..a03977a96d7eed76fbd9eb94da21e4954b0b0d13 100644 (file)
 struct task_struct;
 struct lockdep_map;
 
+/* for sysctl */
+extern int prove_locking;
+extern int lock_stat;
+
 #ifdef CONFIG_LOCKDEP
 
 #include <linux/linkage.h>
@@ -58,6 +62,7 @@ struct lock_class {
 
        struct lockdep_subclass_key     *key;
        unsigned int                    subclass;
+       unsigned int                    dep_gen_id;
 
        /*
         * IRQ/softirq usage tracking bits:
@@ -213,10 +218,12 @@ struct held_lock {
         * interrupt context:
         */
        unsigned int irq_context:2; /* bit 0 - soft, bit 1 - hard */
-       unsigned int trylock:1;
+       unsigned int trylock:1;                                         /* 16 bits */
+
        unsigned int read:2;        /* see lock_acquire() comment */
        unsigned int check:2;       /* see lock_acquire() comment */
        unsigned int hardirqs_off:1;
+       unsigned int references:11;                                     /* 32 bits */
 };
 
 /*
@@ -296,6 +303,10 @@ extern void lock_acquire(struct lockdep_map *lock, unsigned int subclass,
 extern void lock_release(struct lockdep_map *lock, int nested,
                         unsigned long ip);
 
+#define lockdep_is_held(lock)  lock_is_held(&(lock)->dep_map)
+
+extern int lock_is_held(struct lockdep_map *lock);
+
 extern void lock_set_class(struct lockdep_map *lock, const char *name,
                           struct lock_class_key *key, unsigned int subclass,
                           unsigned long ip);
@@ -314,6 +325,8 @@ extern void lockdep_trace_alloc(gfp_t mask);
 
 #define lockdep_depth(tsk)     (debug_locks ? (tsk)->lockdep_depth : 0)
 
+#define lockdep_assert_held(l) WARN_ON(debug_locks && !lockdep_is_held(l))
+
 #else /* !LOCKDEP */
 
 static inline void lockdep_off(void)
@@ -358,6 +371,8 @@ struct lock_class_key { };
 
 #define lockdep_depth(tsk)     (0)
 
+#define lockdep_assert_held(l)                 do { } while (0)
+
 #endif /* !LOCKDEP */
 
 #ifdef CONFIG_LOCK_STAT
@@ -523,4 +538,8 @@ do {                                                                        \
 # define might_lock_read(lock) do { } while (0)
 #endif
 
+#ifdef CONFIG_PROVE_RCU
+extern void lockdep_rcu_dereference(const char *file, const int line);
+#endif
+
 #endif /* __LINUX_LOCKDEP_H */