aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/lockdep_internals.h
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-01-22 08:38:38 -0500
committerIngo Molnar <mingo@elte.hu>2009-02-14 17:28:01 -0500
commitd7b1b02134272840f4b655136e00c461e1cf1d53 (patch)
tree9bb71dbfbc5155cfab9829716c2b9b01cf2a76ed /kernel/lockdep_internals.h
parent9851673bc32bc9fcafbbaeffc858ead434bd6d58 (diff)
lockdep: generate the state bit definitions
Generate the state bit definitions from the lockdep_states.h file. Also, move LOCK_USED to last, so that the USED_IN USED_IN_READ ENABLED ENABLED_READ states are nicely bit aligned -- we're going to use that property Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/lockdep_internals.h')
-rw-r--r--kernel/lockdep_internals.h47
1 files changed, 20 insertions, 27 deletions
diff --git a/kernel/lockdep_internals.h b/kernel/lockdep_internals.h
index 1352409cfef1..7e653e66ce5a 100644
--- a/kernel/lockdep_internals.h
+++ b/kernel/lockdep_internals.h
@@ -10,43 +10,36 @@
10 * Lock-class usage-state bits: 10 * Lock-class usage-state bits:
11 */ 11 */
12enum lock_usage_bit { 12enum lock_usage_bit {
13 LOCK_USED = 0, 13#define LOCKDEP_STATE(__STATE) \
14 LOCK_USED_IN_HARDIRQ, 14 LOCK_USED_IN_##__STATE, \
15 LOCK_USED_IN_SOFTIRQ, 15 LOCK_USED_IN_##__STATE##_READ, \
16 LOCK_USED_IN_RECLAIM_FS, 16 LOCK_ENABLED_##__STATE, \
17 LOCK_ENABLED_SOFTIRQ, 17 LOCK_ENABLED_##__STATE##_READ,
18 LOCK_ENABLED_HARDIRQ, 18#include "lockdep_states.h"
19 LOCK_ENABLED_RECLAIM_FS, 19#undef LOCKDEP_STATE
20 LOCK_USED_IN_HARDIRQ_READ, 20 LOCK_USED,
21 LOCK_USED_IN_SOFTIRQ_READ,
22 LOCK_USED_IN_RECLAIM_FS_READ,
23 LOCK_ENABLED_SOFTIRQ_READ,
24 LOCK_ENABLED_HARDIRQ_READ,
25 LOCK_ENABLED_RECLAIM_FS_READ,
26 LOCK_USAGE_STATES 21 LOCK_USAGE_STATES
27}; 22};
28 23
29/* 24/*
30 * Usage-state bitmasks: 25 * Usage-state bitmasks:
31 */ 26 */
32#define LOCKF_USED (1 << LOCK_USED) 27#define __LOCKF(__STATE) LOCKF_##__STATE = (1 << LOCK_##__STATE),
33#define LOCKF_USED_IN_HARDIRQ (1 << LOCK_USED_IN_HARDIRQ) 28
34#define LOCKF_USED_IN_SOFTIRQ (1 << LOCK_USED_IN_SOFTIRQ) 29enum {
35#define LOCKF_USED_IN_RECLAIM_FS (1 << LOCK_USED_IN_RECLAIM_FS) 30#define LOCKDEP_STATE(__STATE) \
36#define LOCKF_ENABLED_HARDIRQ (1 << LOCK_ENABLED_HARDIRQ) 31 __LOCKF(USED_IN_##__STATE) \
37#define LOCKF_ENABLED_SOFTIRQ (1 << LOCK_ENABLED_SOFTIRQ) 32 __LOCKF(USED_IN_##__STATE##_READ) \
38#define LOCKF_ENABLED_RECLAIM_FS (1 << LOCK_ENABLED_RECLAIM_FS) 33 __LOCKF(ENABLED_##__STATE) \
34 __LOCKF(ENABLED_##__STATE##_READ)
35#include "lockdep_states.h"
36#undef LOCKDEP_STATE
37 __LOCKF(USED)
38};
39 39
40#define LOCKF_ENABLED_IRQ (LOCKF_ENABLED_HARDIRQ | LOCKF_ENABLED_SOFTIRQ) 40#define LOCKF_ENABLED_IRQ (LOCKF_ENABLED_HARDIRQ | LOCKF_ENABLED_SOFTIRQ)
41#define LOCKF_USED_IN_IRQ (LOCKF_USED_IN_HARDIRQ | LOCKF_USED_IN_SOFTIRQ) 41#define LOCKF_USED_IN_IRQ (LOCKF_USED_IN_HARDIRQ | LOCKF_USED_IN_SOFTIRQ)
42 42
43#define LOCKF_USED_IN_HARDIRQ_READ (1 << LOCK_USED_IN_HARDIRQ_READ)
44#define LOCKF_USED_IN_SOFTIRQ_READ (1 << LOCK_USED_IN_SOFTIRQ_READ)
45#define LOCKF_USED_IN_RECLAIM_FS_READ (1 << LOCK_USED_IN_RECLAIM_FS_READ)
46#define LOCKF_ENABLED_HARDIRQ_READ (1 << LOCK_ENABLED_HARDIRQ_READ)
47#define LOCKF_ENABLED_SOFTIRQ_READ (1 << LOCK_ENABLED_SOFTIRQ_READ)
48#define LOCKF_ENABLED_RECLAIM_FS_READ (1 << LOCK_ENABLED_RECLAIM_FS_READ)
49
50#define LOCKF_ENABLED_IRQ_READ \ 43#define LOCKF_ENABLED_IRQ_READ \
51 (LOCKF_ENABLED_HARDIRQ_READ | LOCKF_ENABLED_SOFTIRQ_READ) 44 (LOCKF_ENABLED_HARDIRQ_READ | LOCKF_ENABLED_SOFTIRQ_READ)
52#define LOCKF_USED_IN_IRQ_READ \ 45#define LOCKF_USED_IN_IRQ_READ \