aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2012-05-13 16:15:33 -0400
committerJonathan Herman <hermanjl@cs.unc.edu>2012-05-13 16:15:33 -0400
commit2d8f8176515f2516b9a0b85642a7b842eb53552b (patch)
tree0a434e9f3e5af613802db75f6811dd6fb1122f95 /include
parent1fde4dd4de048d7fbfe3e1418f4a76c62423ad95 (diff)
Can disable nonpreemptivity
Diffstat (limited to 'include')
-rw-r--r--include/litmus/litmus.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h
index f0ddb89e68dd..9fcf1f45820f 100644
--- a/include/litmus/litmus.h
+++ b/include/litmus/litmus.h
@@ -169,7 +169,7 @@ static inline void request_exit_np(struct task_struct *t)
169 169
170static inline void make_np(struct task_struct *t) 170static inline void make_np(struct task_struct *t)
171{ 171{
172 tsk_rt(t)->kernel_np++; 172 tsk_rt(t)->kernel_np = 1;
173} 173}
174 174
175/* Caller should check if preemption is necessary when 175/* Caller should check if preemption is necessary when
@@ -177,7 +177,7 @@ static inline void make_np(struct task_struct *t)
177 */ 177 */
178static inline int take_np(struct task_struct *t) 178static inline int take_np(struct task_struct *t)
179{ 179{
180 return --tsk_rt(t)->kernel_np; 180 return tsk_rt(t)->kernel_np = 0;
181} 181}
182 182
183/* returns 0 if remote CPU needs an IPI to preempt, 1 if no IPI is required */ 183/* returns 0 if remote CPU needs an IPI to preempt, 1 if no IPI is required */
@@ -210,6 +210,20 @@ static inline int request_exit_np_atomic(struct task_struct *t)
210 210
211#else 211#else
212 212
213
214static inline void make_np(struct task_struct *t)
215{
216
217}
218
219/* Caller should check if preemption is necessary when
220 * the function return 0.
221 */
222static inline int take_np(struct task_struct *t)
223{
224 return 0;
225}
226
213static inline int is_kernel_np(struct task_struct* t) 227static inline int is_kernel_np(struct task_struct* t)
214{ 228{
215 return 0; 229 return 0;