diff options
Diffstat (limited to 'include/linux/preempt.h')
-rw-r--r-- | include/linux/preempt.h | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/include/linux/preempt.h b/include/linux/preempt.h index bea8dd8ff5e0..75e4e30677f1 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h | |||
@@ -26,7 +26,6 @@ | |||
26 | * SOFTIRQ_MASK: 0x0000ff00 | 26 | * SOFTIRQ_MASK: 0x0000ff00 |
27 | * HARDIRQ_MASK: 0x000f0000 | 27 | * HARDIRQ_MASK: 0x000f0000 |
28 | * NMI_MASK: 0x00100000 | 28 | * NMI_MASK: 0x00100000 |
29 | * PREEMPT_ACTIVE: 0x00200000 | ||
30 | * PREEMPT_NEED_RESCHED: 0x80000000 | 29 | * PREEMPT_NEED_RESCHED: 0x80000000 |
31 | */ | 30 | */ |
32 | #define PREEMPT_BITS 8 | 31 | #define PREEMPT_BITS 8 |
@@ -53,10 +52,6 @@ | |||
53 | 52 | ||
54 | #define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET) | 53 | #define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET) |
55 | 54 | ||
56 | #define PREEMPT_ACTIVE_BITS 1 | ||
57 | #define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS) | ||
58 | #define PREEMPT_ACTIVE (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT) | ||
59 | |||
60 | /* We use the MSB mostly because its available */ | 55 | /* We use the MSB mostly because its available */ |
61 | #define PREEMPT_NEED_RESCHED 0x80000000 | 56 | #define PREEMPT_NEED_RESCHED 0x80000000 |
62 | 57 | ||
@@ -126,8 +121,7 @@ | |||
126 | * Check whether we were atomic before we did preempt_disable(): | 121 | * Check whether we were atomic before we did preempt_disable(): |
127 | * (used by the scheduler) | 122 | * (used by the scheduler) |
128 | */ | 123 | */ |
129 | #define in_atomic_preempt_off() \ | 124 | #define in_atomic_preempt_off() (preempt_count() != PREEMPT_DISABLE_OFFSET) |
130 | ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_DISABLE_OFFSET) | ||
131 | 125 | ||
132 | #if defined(CONFIG_DEBUG_PREEMPT) || defined(CONFIG_PREEMPT_TRACER) | 126 | #if defined(CONFIG_DEBUG_PREEMPT) || defined(CONFIG_PREEMPT_TRACER) |
133 | extern void preempt_count_add(int val); | 127 | extern void preempt_count_add(int val); |
@@ -146,18 +140,6 @@ extern void preempt_count_sub(int val); | |||
146 | #define preempt_count_inc() preempt_count_add(1) | 140 | #define preempt_count_inc() preempt_count_add(1) |
147 | #define preempt_count_dec() preempt_count_sub(1) | 141 | #define preempt_count_dec() preempt_count_sub(1) |
148 | 142 | ||
149 | #define preempt_active_enter() \ | ||
150 | do { \ | ||
151 | preempt_count_add(PREEMPT_ACTIVE + PREEMPT_DISABLE_OFFSET); \ | ||
152 | barrier(); \ | ||
153 | } while (0) | ||
154 | |||
155 | #define preempt_active_exit() \ | ||
156 | do { \ | ||
157 | barrier(); \ | ||
158 | preempt_count_sub(PREEMPT_ACTIVE + PREEMPT_DISABLE_OFFSET); \ | ||
159 | } while (0) | ||
160 | |||
161 | #ifdef CONFIG_PREEMPT_COUNT | 143 | #ifdef CONFIG_PREEMPT_COUNT |
162 | 144 | ||
163 | #define preempt_disable() \ | 145 | #define preempt_disable() \ |