diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /include/linux/hardirq.h | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'include/linux/hardirq.h')
-rw-r--r-- | include/linux/hardirq.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index d5b387669dab..e6dd5a456bae 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -2,13 +2,11 @@ | |||
2 | #define LINUX_HARDIRQ_H | 2 | #define LINUX_HARDIRQ_H |
3 | 3 | ||
4 | #include <linux/preempt.h> | 4 | #include <linux/preempt.h> |
5 | #ifdef CONFIG_PREEMPT | ||
6 | #include <linux/smp_lock.h> | ||
7 | #endif | ||
8 | #include <linux/lockdep.h> | 5 | #include <linux/lockdep.h> |
9 | #include <linux/ftrace_irq.h> | 6 | #include <linux/ftrace_irq.h> |
10 | #include <asm/hardirq.h> | 7 | #include <asm/hardirq.h> |
11 | #include <asm/system.h> | 8 | |
9 | #include <litmus/trace_irq.h> | ||
12 | 10 | ||
13 | /* | 11 | /* |
14 | * We put the hardirq and softirq counter into the preemption | 12 | * We put the hardirq and softirq counter into the preemption |
@@ -64,6 +62,8 @@ | |||
64 | #define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT) | 62 | #define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT) |
65 | #define NMI_OFFSET (1UL << NMI_SHIFT) | 63 | #define NMI_OFFSET (1UL << NMI_SHIFT) |
66 | 64 | ||
65 | #define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET) | ||
66 | |||
67 | #ifndef PREEMPT_ACTIVE | 67 | #ifndef PREEMPT_ACTIVE |
68 | #define PREEMPT_ACTIVE_BITS 1 | 68 | #define PREEMPT_ACTIVE_BITS 1 |
69 | #define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS) | 69 | #define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS) |
@@ -82,10 +82,13 @@ | |||
82 | /* | 82 | /* |
83 | * Are we doing bottom half or hardware interrupt processing? | 83 | * Are we doing bottom half or hardware interrupt processing? |
84 | * Are we in a softirq context? Interrupt context? | 84 | * Are we in a softirq context? Interrupt context? |
85 | * in_softirq - Are we currently processing softirq or have bh disabled? | ||
86 | * in_serving_softirq - Are we currently processing softirq? | ||
85 | */ | 87 | */ |
86 | #define in_irq() (hardirq_count()) | 88 | #define in_irq() (hardirq_count()) |
87 | #define in_softirq() (softirq_count()) | 89 | #define in_softirq() (softirq_count()) |
88 | #define in_interrupt() (irq_count()) | 90 | #define in_interrupt() (irq_count()) |
91 | #define in_serving_softirq() (softirq_count() & SOFTIRQ_OFFSET) | ||
89 | 92 | ||
90 | /* | 93 | /* |
91 | * Are we in NMI context? | 94 | * Are we in NMI context? |
@@ -93,10 +96,8 @@ | |||
93 | #define in_nmi() (preempt_count() & NMI_MASK) | 96 | #define in_nmi() (preempt_count() & NMI_MASK) |
94 | 97 | ||
95 | #if defined(CONFIG_PREEMPT) | 98 | #if defined(CONFIG_PREEMPT) |
96 | # define PREEMPT_INATOMIC_BASE kernel_locked() | ||
97 | # define PREEMPT_CHECK_OFFSET 1 | 99 | # define PREEMPT_CHECK_OFFSET 1 |
98 | #else | 100 | #else |
99 | # define PREEMPT_INATOMIC_BASE 0 | ||
100 | # define PREEMPT_CHECK_OFFSET 0 | 101 | # define PREEMPT_CHECK_OFFSET 0 |
101 | #endif | 102 | #endif |
102 | 103 | ||
@@ -107,7 +108,7 @@ | |||
107 | * used in the general case to determine whether sleeping is possible. | 108 | * used in the general case to determine whether sleeping is possible. |
108 | * Do not use in_atomic() in driver code. | 109 | * Do not use in_atomic() in driver code. |
109 | */ | 110 | */ |
110 | #define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_INATOMIC_BASE) | 111 | #define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != 0) |
111 | 112 | ||
112 | /* | 113 | /* |
113 | * Check whether we were atomic before we did preempt_disable(): | 114 | * Check whether we were atomic before we did preempt_disable(): |
@@ -132,14 +133,16 @@ extern void synchronize_irq(unsigned int irq); | |||
132 | 133 | ||
133 | struct task_struct; | 134 | struct task_struct; |
134 | 135 | ||
135 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING | 136 | #if !defined(CONFIG_VIRT_CPU_ACCOUNTING) && !defined(CONFIG_IRQ_TIME_ACCOUNTING) |
136 | static inline void account_system_vtime(struct task_struct *tsk) | 137 | static inline void account_system_vtime(struct task_struct *tsk) |
137 | { | 138 | { |
138 | } | 139 | } |
140 | #else | ||
141 | extern void account_system_vtime(struct task_struct *tsk); | ||
139 | #endif | 142 | #endif |
140 | 143 | ||
141 | #if defined(CONFIG_NO_HZ) | 144 | #if defined(CONFIG_NO_HZ) |
142 | #if defined(CONFIG_TINY_RCU) | 145 | #if defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU) |
143 | extern void rcu_enter_nohz(void); | 146 | extern void rcu_enter_nohz(void); |
144 | extern void rcu_exit_nohz(void); | 147 | extern void rcu_exit_nohz(void); |
145 | 148 | ||
@@ -185,6 +188,7 @@ extern void rcu_nmi_exit(void); | |||
185 | account_system_vtime(current); \ | 188 | account_system_vtime(current); \ |
186 | add_preempt_count(HARDIRQ_OFFSET); \ | 189 | add_preempt_count(HARDIRQ_OFFSET); \ |
187 | trace_hardirq_enter(); \ | 190 | trace_hardirq_enter(); \ |
191 | ft_irq_fired(); \ | ||
188 | } while (0) | 192 | } while (0) |
189 | 193 | ||
190 | /* | 194 | /* |
@@ -215,6 +219,7 @@ extern void irq_exit(void); | |||
215 | lockdep_off(); \ | 219 | lockdep_off(); \ |
216 | rcu_nmi_enter(); \ | 220 | rcu_nmi_enter(); \ |
217 | trace_hardirq_enter(); \ | 221 | trace_hardirq_enter(); \ |
222 | ft_irq_fired(); \ | ||
218 | } while (0) | 223 | } while (0) |
219 | 224 | ||
220 | #define nmi_exit() \ | 225 | #define nmi_exit() \ |