aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/preempt_mask.h15
-rw-r--r--include/linux/sched.h2
2 files changed, 6 insertions, 11 deletions
diff --git a/include/linux/preempt_mask.h b/include/linux/preempt_mask.h
index 810d7e386f20..d169820203dd 100644
--- a/include/linux/preempt_mask.h
+++ b/include/linux/preempt_mask.h
@@ -17,10 +17,11 @@
17 * there are a few palaeontologic drivers which reenable interrupts in 17 * there are a few palaeontologic drivers which reenable interrupts in
18 * the handler, so we need more than one bit here. 18 * the handler, so we need more than one bit here.
19 * 19 *
20 * PREEMPT_MASK: 0x000000ff 20 * PREEMPT_MASK: 0x000000ff
21 * SOFTIRQ_MASK: 0x0000ff00 21 * SOFTIRQ_MASK: 0x0000ff00
22 * HARDIRQ_MASK: 0x000f0000 22 * HARDIRQ_MASK: 0x000f0000
23 * NMI_MASK: 0x00100000 23 * NMI_MASK: 0x00100000
24 * PREEMPT_ACTIVE: 0x00200000
24 */ 25 */
25#define PREEMPT_BITS 8 26#define PREEMPT_BITS 8
26#define SOFTIRQ_BITS 8 27#define SOFTIRQ_BITS 8
@@ -46,15 +47,9 @@
46 47
47#define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET) 48#define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET)
48 49
49#ifndef PREEMPT_ACTIVE
50#define PREEMPT_ACTIVE_BITS 1 50#define PREEMPT_ACTIVE_BITS 1
51#define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS) 51#define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS)
52#define PREEMPT_ACTIVE (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT) 52#define PREEMPT_ACTIVE (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT)
53#endif
54
55#if PREEMPT_ACTIVE < (1 << (NMI_SHIFT + NMI_BITS))
56#error PREEMPT_ACTIVE is too low!
57#endif
58 53
59#define hardirq_count() (preempt_count() & HARDIRQ_MASK) 54#define hardirq_count() (preempt_count() & HARDIRQ_MASK)
60#define softirq_count() (preempt_count() & SOFTIRQ_MASK) 55#define softirq_count() (preempt_count() & SOFTIRQ_MASK)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 045b0d227846..55080df48b70 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -22,7 +22,7 @@ struct sched_param {
22#include <linux/errno.h> 22#include <linux/errno.h>
23#include <linux/nodemask.h> 23#include <linux/nodemask.h>
24#include <linux/mm_types.h> 24#include <linux/mm_types.h>
25#include <linux/preempt.h> 25#include <linux/preempt_mask.h>
26 26
27#include <asm/page.h> 27#include <asm/page.h>
28#include <asm/ptrace.h> 28#include <asm/ptrace.h>