aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2008-07-01 10:12:30 -0400
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2008-07-01 10:12:30 -0400
commit0291b7547359c8e01ca1146ca8f2d5f321338ff8 (patch)
treefb6bc3688a9335e20e48cf57b7da8b0041e2db00
parent7364a4bcb88e6c1291a9a8af097a139e84eebace (diff)
compile without FMLP support if it is disabled
-rw-r--r--include/litmus/sched_plugin.h9
-rw-r--r--litmus/fdso.c5
-rw-r--r--litmus/fmlp.c24
-rw-r--r--litmus/sched_gsn_edf.c7
-rw-r--r--litmus/sched_plugin.c7
-rw-r--r--litmus/sched_psn_edf.c6
6 files changed, 48 insertions, 10 deletions
diff --git a/include/litmus/sched_plugin.h b/include/litmus/sched_plugin.h
index 5b4b430a5b..c26af80da8 100644
--- a/include/litmus/sched_plugin.h
+++ b/include/litmus/sched_plugin.h
@@ -88,7 +88,6 @@ struct sched_plugin {
88 /* basic info */ 88 /* basic info */
89 char *plugin_name; 89 char *plugin_name;
90 unsigned int srp_active; 90 unsigned int srp_active;
91 unsigned int fmlp_active;
92 91
93 /* scheduler invocation */ 92 /* scheduler invocation */
94 scheduler_tick_t tick; 93 scheduler_tick_t tick;
@@ -107,10 +106,13 @@ struct sched_plugin {
107 task_block_t task_block; 106 task_block_t task_block;
108 task_exit_t task_exit; 107 task_exit_t task_exit;
109 108
109#ifdef CONFIG_FMLP
110 /* priority inheritance */ 110 /* priority inheritance */
111 unsigned int fmlp_active;
111 inherit_priority_t inherit_priority; 112 inherit_priority_t inherit_priority;
112 return_priority_t return_priority; 113 return_priority_t return_priority;
113 pi_block_t pi_block; 114 pi_block_t pi_block;
115#endif
114} __attribute__ ((__aligned__(SMP_CACHE_BYTES))); 116} __attribute__ ((__aligned__(SMP_CACHE_BYTES)));
115 117
116 118
@@ -124,10 +126,13 @@ static inline int srp_active(void)
124{ 126{
125 return litmus->srp_active; 127 return litmus->srp_active;
126} 128}
127
128static inline int fmlp_active(void) 129static inline int fmlp_active(void)
129{ 130{
131#ifdef CONFIG_FMLP
130 return litmus->fmlp_active; 132 return litmus->fmlp_active;
133#else
134 return 0;
135#endif
131} 136}
132 137
133#endif 138#endif
diff --git a/litmus/fdso.c b/litmus/fdso.c
index 966b6e9e87..81ab0afff3 100644
--- a/litmus/fdso.c
+++ b/litmus/fdso.c
@@ -28,7 +28,10 @@ static const struct fdso_ops* fdso_ops[] = {
28 28
29static void* fdso_create(obj_type_t type) 29static void* fdso_create(obj_type_t type)
30{ 30{
31 return fdso_ops[type]->create(); 31 if (fdso_ops[type]->create)
32 return fdso_ops[type]->create();
33 else
34 return NULL;
32} 35}
33 36
34static void fdso_destroy(obj_type_t type, void* obj) 37static void fdso_destroy(obj_type_t type, void* obj)
diff --git a/litmus/fmlp.c b/litmus/fmlp.c
index 1c359c21c2..f34eeea9ab 100644
--- a/litmus/fmlp.c
+++ b/litmus/fmlp.c
@@ -16,9 +16,7 @@
16 16
17#include <litmus/trace.h> 17#include <litmus/trace.h>
18 18
19/* ************************************************************************** */ 19#ifdef CONFIG_FMLP
20/* PRIORITY INHERITANCE */
21/* ************************************************************************** */
22 20
23static void* create_fmlp_semaphore(void) 21static void* create_fmlp_semaphore(void)
24{ 22{
@@ -128,7 +126,7 @@ int edf_set_hp_cpu_task(struct pi_semaphore *sem, int cpu)
128 return ret; 126 return ret;
129} 127}
130 128
131int do_fmlp_down(struct pi_semaphore* sem) 129static int do_fmlp_down(struct pi_semaphore* sem)
132{ 130{
133 unsigned long flags; 131 unsigned long flags;
134 struct task_struct *tsk = current; 132 struct task_struct *tsk = current;
@@ -187,7 +185,7 @@ int do_fmlp_down(struct pi_semaphore* sem)
187 return suspended; 185 return suspended;
188} 186}
189 187
190void do_fmlp_up(struct pi_semaphore* sem) 188static void do_fmlp_up(struct pi_semaphore* sem)
191{ 189{
192 unsigned long flags; 190 unsigned long flags;
193 191
@@ -246,3 +244,19 @@ asmlinkage long sys_fmlp_up(int sem_od)
246 244
247 return ret; 245 return ret;
248} 246}
247
248#else
249
250struct fdso_ops fmlp_sem_ops = {};
251
252asmlinkage long sys_fmlp_down(int sem_od)
253{
254 return -ENOSYS;
255}
256
257asmlinkage long sys_fmlp_up(int sem_od)
258{
259 return -ENOSYS;
260}
261
262#endif
diff --git a/litmus/sched_gsn_edf.c b/litmus/sched_gsn_edf.c
index 1d84591c9c..e32a4e8458 100644
--- a/litmus/sched_gsn_edf.c
+++ b/litmus/sched_gsn_edf.c
@@ -593,6 +593,7 @@ static void gsnedf_task_exit(struct task_struct * t)
593 TRACE_TASK(t, "RIP\n"); 593 TRACE_TASK(t, "RIP\n");
594} 594}
595 595
596#ifdef CONFIG_FMLP
596static long gsnedf_pi_block(struct pi_semaphore *sem, 597static long gsnedf_pi_block(struct pi_semaphore *sem,
597 struct task_struct *new_waiter) 598 struct task_struct *new_waiter)
598{ 599{
@@ -677,6 +678,8 @@ static long gsnedf_return_priority(struct pi_semaphore *sem)
677 return ret; 678 return ret;
678} 679}
679 680
681#endif
682
680static long gsnedf_admit_task(struct task_struct* tsk) 683static long gsnedf_admit_task(struct task_struct* tsk)
681{ 684{
682 return 0; 685 return 0;
@@ -686,7 +689,6 @@ static long gsnedf_admit_task(struct task_struct* tsk)
686/* Plugin object */ 689/* Plugin object */
687static struct sched_plugin gsn_edf_plugin __cacheline_aligned_in_smp = { 690static struct sched_plugin gsn_edf_plugin __cacheline_aligned_in_smp = {
688 .plugin_name = "GSN-EDF", 691 .plugin_name = "GSN-EDF",
689 .fmlp_active = 1,
690 .finish_switch = gsnedf_finish_switch, 692 .finish_switch = gsnedf_finish_switch,
691 .tick = gsnedf_tick, 693 .tick = gsnedf_tick,
692 .task_new = gsnedf_task_new, 694 .task_new = gsnedf_task_new,
@@ -695,9 +697,12 @@ static struct sched_plugin gsn_edf_plugin __cacheline_aligned_in_smp = {
695 .schedule = gsnedf_schedule, 697 .schedule = gsnedf_schedule,
696 .task_wake_up = gsnedf_task_wake_up, 698 .task_wake_up = gsnedf_task_wake_up,
697 .task_block = gsnedf_task_block, 699 .task_block = gsnedf_task_block,
700#ifdef CONFIG_FMLP
701 .fmlp_active = 1,
698 .pi_block = gsnedf_pi_block, 702 .pi_block = gsnedf_pi_block,
699 .inherit_priority = gsnedf_inherit_priority, 703 .inherit_priority = gsnedf_inherit_priority,
700 .return_priority = gsnedf_return_priority, 704 .return_priority = gsnedf_return_priority,
705#endif
701 .admit_task = gsnedf_admit_task 706 .admit_task = gsnedf_admit_task
702}; 707};
703 708
diff --git a/litmus/sched_plugin.c b/litmus/sched_plugin.c
index dbf709ee5e..497d703faa 100644
--- a/litmus/sched_plugin.c
+++ b/litmus/sched_plugin.c
@@ -57,6 +57,8 @@ static long litmus_dummy_complete_job(void)
57 return -ENOSYS; 57 return -ENOSYS;
58} 58}
59 59
60#ifdef CONFIG_FMLP
61
60static long litmus_dummy_inherit_priority(struct pi_semaphore *sem, 62static long litmus_dummy_inherit_priority(struct pi_semaphore *sem,
61 struct task_struct *new_owner) 63 struct task_struct *new_owner)
62{ 64{
@@ -74,6 +76,7 @@ static long litmus_dummy_pi_block(struct pi_semaphore *sem,
74 return -ENOSYS; 76 return -ENOSYS;
75} 77}
76 78
79#endif
77 80
78 81
79/* The default scheduler plugin. It doesn't do anything and lets Linux do its 82/* The default scheduler plugin. It doesn't do anything and lets Linux do its
@@ -89,9 +92,11 @@ struct sched_plugin linux_sched_plugin = {
89 .complete_job = litmus_dummy_complete_job, 92 .complete_job = litmus_dummy_complete_job,
90 .schedule = litmus_dummy_schedule, 93 .schedule = litmus_dummy_schedule,
91 .finish_switch = litmus_dummy_finish_switch, 94 .finish_switch = litmus_dummy_finish_switch,
95#ifdef CONFIG_FMLP
92 .inherit_priority = litmus_dummy_inherit_priority, 96 .inherit_priority = litmus_dummy_inherit_priority,
93 .return_priority = litmus_dummy_return_priority, 97 .return_priority = litmus_dummy_return_priority,
94 .pi_block = litmus_dummy_pi_block, 98 .pi_block = litmus_dummy_pi_block,
99#endif
95 .admit_task = litmus_dummy_admit_task 100 .admit_task = litmus_dummy_admit_task
96}; 101};
97 102
@@ -125,9 +130,11 @@ int register_sched_plugin(struct sched_plugin* plugin)
125 CHECK(task_block); 130 CHECK(task_block);
126 CHECK(task_new); 131 CHECK(task_new);
127 CHECK(complete_job); 132 CHECK(complete_job);
133#ifdef CONFIG_FMLP
128 CHECK(inherit_priority); 134 CHECK(inherit_priority);
129 CHECK(return_priority); 135 CHECK(return_priority);
130 CHECK(pi_block); 136 CHECK(pi_block);
137#endif
131 CHECK(admit_task); 138 CHECK(admit_task);
132 139
133 if (!plugin->release_at) 140 if (!plugin->release_at)
diff --git a/litmus/sched_psn_edf.c b/litmus/sched_psn_edf.c
index 42b5665c44..50fc95d749 100644
--- a/litmus/sched_psn_edf.c
+++ b/litmus/sched_psn_edf.c
@@ -294,6 +294,7 @@ static void psnedf_task_exit(struct task_struct * t)
294 spin_unlock_irqrestore(&pedf->slock, flags); 294 spin_unlock_irqrestore(&pedf->slock, flags);
295} 295}
296 296
297#ifdef CONFIG_FMLP
297static long psnedf_pi_block(struct pi_semaphore *sem, 298static long psnedf_pi_block(struct pi_semaphore *sem,
298 struct task_struct *new_waiter) 299 struct task_struct *new_waiter)
299{ 300{
@@ -405,6 +406,7 @@ static long psnedf_return_priority(struct pi_semaphore *sem)
405 return ret; 406 return ret;
406} 407}
407 408
409#endif
408 410
409static long psnedf_admit_task(struct task_struct* tsk) 411static long psnedf_admit_task(struct task_struct* tsk)
410{ 412{
@@ -414,7 +416,6 @@ static long psnedf_admit_task(struct task_struct* tsk)
414/* Plugin object */ 416/* Plugin object */
415static struct sched_plugin psn_edf_plugin __cacheline_aligned_in_smp = { 417static struct sched_plugin psn_edf_plugin __cacheline_aligned_in_smp = {
416 .plugin_name = "PSN-EDF", 418 .plugin_name = "PSN-EDF",
417 .fmlp_active = 1,
418 .srp_active = 1, 419 .srp_active = 1,
419 .tick = psnedf_tick, 420 .tick = psnedf_tick,
420 .task_new = psnedf_task_new, 421 .task_new = psnedf_task_new,
@@ -423,9 +424,12 @@ static struct sched_plugin psn_edf_plugin __cacheline_aligned_in_smp = {
423 .schedule = psnedf_schedule, 424 .schedule = psnedf_schedule,
424 .task_wake_up = psnedf_task_wake_up, 425 .task_wake_up = psnedf_task_wake_up,
425 .task_block = psnedf_task_block, 426 .task_block = psnedf_task_block,
427#ifdef CONFIG_FMLP
428 .fmlp_active = 1,
426 .pi_block = psnedf_pi_block, 429 .pi_block = psnedf_pi_block,
427 .inherit_priority = psnedf_inherit_priority, 430 .inherit_priority = psnedf_inherit_priority,
428 .return_priority = psnedf_return_priority, 431 .return_priority = psnedf_return_priority,
432#endif
429 .admit_task = psnedf_admit_task 433 .admit_task = psnedf_admit_task
430}; 434};
431 435