diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-07-01 09:50:35 -0400 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-07-01 09:50:35 -0400 |
commit | 7364a4bcb88e6c1291a9a8af097a139e84eebace (patch) | |
tree | 6966d224880a26a7c0a0a729b731c901f938177a | |
parent | c70e2aa039b3f05bd9c520a66dd9af8b405b19b8 (diff) |
don't include NP-Flag syscalls if config option is not selected
-rw-r--r-- | include/litmus/litmus.h | 29 | ||||
-rw-r--r-- | litmus/litmus.c | 17 |
2 files changed, 39 insertions, 7 deletions
diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h index ca9d3c8d88..8a4c44999f 100644 --- a/include/litmus/litmus.h +++ b/include/litmus/litmus.h | |||
@@ -86,13 +86,6 @@ void list_qsort(struct list_head* list, list_cmp_t less_than); | |||
86 | #define RT_NON_PREEMPTIVE 0x4e50 /* = P */ | 86 | #define RT_NON_PREEMPTIVE 0x4e50 /* = P */ |
87 | #define RT_EXIT_NP_REQUESTED 0x5251 /* = RQ */ | 87 | #define RT_EXIT_NP_REQUESTED 0x5251 /* = RQ */ |
88 | 88 | ||
89 | /* returns 1 if task t has registered np flag and set it to RT_NON_PREEMPTIVE | ||
90 | */ | ||
91 | int is_np(struct task_struct *t); | ||
92 | |||
93 | /* request that the task should call sys_exit_np() | ||
94 | */ | ||
95 | void request_exit_np(struct task_struct *t); | ||
96 | 89 | ||
97 | /* kill naughty tasks | 90 | /* kill naughty tasks |
98 | */ | 91 | */ |
@@ -183,4 +176,26 @@ void srp_ceiling_block(void); | |||
183 | 176 | ||
184 | #define heap2task(hn) ((struct task_struct*) hn->value) | 177 | #define heap2task(hn) ((struct task_struct*) hn->value) |
185 | 178 | ||
179 | |||
180 | #ifdef CONFIG_NP_SECTION | ||
181 | /* returns 1 if task t has registered np flag and set it to RT_NON_PREEMPTIVE | ||
182 | */ | ||
183 | int is_np(struct task_struct *t); | ||
184 | |||
185 | /* request that the task should call sys_exit_np() | ||
186 | */ | ||
187 | void request_exit_np(struct task_struct *t); | ||
188 | |||
189 | #else | ||
190 | |||
191 | static inline int is_np(struct task_struct *t) | ||
192 | { | ||
193 | return tsk_rt(t)->kernel_np; | ||
194 | } | ||
195 | |||
196 | #define request_exit_np(t) | ||
197 | |||
198 | #endif | ||
199 | |||
200 | |||
186 | #endif | 201 | #endif |
diff --git a/litmus/litmus.c b/litmus/litmus.c index 0dec4342ba..852559468d 100644 --- a/litmus/litmus.c +++ b/litmus/litmus.c | |||
@@ -316,6 +316,8 @@ void send_scheduler_signals(void) | |||
316 | 316 | ||
317 | } | 317 | } |
318 | 318 | ||
319 | #ifdef CONFIG_NP_SECTION | ||
320 | |||
319 | static inline void np_mem_error(struct task_struct* t, const char* reason) | 321 | static inline void np_mem_error(struct task_struct* t, const char* reason) |
320 | { | 322 | { |
321 | if (t->state != TASK_DEAD && !(t->flags & PF_EXITING)) { | 323 | if (t->state != TASK_DEAD && !(t->flags & PF_EXITING)) { |
@@ -455,6 +457,21 @@ asmlinkage long sys_exit_np(void) | |||
455 | return retval; | 457 | return retval; |
456 | } | 458 | } |
457 | 459 | ||
460 | #else /* !CONFIG_NP_SECTION */ | ||
461 | |||
462 | asmlinkage long sys_register_np_flag(short __user *flag) | ||
463 | { | ||
464 | return -ENOSYS; | ||
465 | } | ||
466 | |||
467 | asmlinkage long sys_exit_np(void) | ||
468 | { | ||
469 | return -ENOSYS; | ||
470 | } | ||
471 | |||
472 | #endif /* CONFIG_NP_SECTION */ | ||
473 | |||
474 | |||
458 | /* p is a real-time task. Re-init its state as a best-effort task. */ | 475 | /* p is a real-time task. Re-init its state as a best-effort task. */ |
459 | static void reinit_litmus_state(struct task_struct* p, int restore) | 476 | static void reinit_litmus_state(struct task_struct* p, int restore) |
460 | { | 477 | { |