aboutsummaryrefslogtreecommitdiffstats
path: root/litmus
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2011-01-28 16:41:16 -0500
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2011-02-01 16:30:39 -0500
commitcc602187d4466374bca031039e145aa1b89aca96 (patch)
treea92f08cd0ecfd462a694b23f22fedd36ef2aaecf /litmus
parenta3db326495d4051bddc657d3b226ad4daa7997c4 (diff)
Litmus core: replace FMLP & SRP system calls with generic syscalls
This renders the FMLP and SRP unfunctional until they are ported to the new locking API.
Diffstat (limited to 'litmus')
-rw-r--r--litmus/fmlp.c54
-rw-r--r--litmus/locking.c4
-rw-r--r--litmus/sched_gsn_edf.c8
-rw-r--r--litmus/sched_psn_edf.c11
-rw-r--r--litmus/srp.c59
5 files changed, 5 insertions, 131 deletions
diff --git a/litmus/fmlp.c b/litmus/fmlp.c
index 1e4d544a9230..6e3ddadbc429 100644
--- a/litmus/fmlp.c
+++ b/litmus/fmlp.c
@@ -207,62 +207,8 @@ static void do_fmlp_up(struct pi_semaphore* sem)
207 spin_unlock_irqrestore(&sem->wait.lock, flags); 207 spin_unlock_irqrestore(&sem->wait.lock, flags);
208} 208}
209 209
210asmlinkage long sys_fmlp_down(int sem_od)
211{
212 long ret = 0;
213 struct pi_semaphore * sem;
214 int suspended = 0;
215
216 preempt_disable();
217 TS_PI_DOWN_START;
218
219 sem = lookup_fmlp_sem(sem_od);
220 if (sem)
221 suspended = do_fmlp_down(sem);
222 else
223 ret = -EINVAL;
224
225 if (!suspended) {
226 TS_PI_DOWN_END;
227 preempt_enable();
228 }
229
230 return ret;
231}
232
233asmlinkage long sys_fmlp_up(int sem_od)
234{
235 long ret = 0;
236 struct pi_semaphore * sem;
237
238 preempt_disable();
239 TS_PI_UP_START;
240
241 sem = lookup_fmlp_sem(sem_od);
242 if (sem)
243 do_fmlp_up(sem);
244 else
245 ret = -EINVAL;
246
247
248 TS_PI_UP_END;
249 preempt_enable();
250
251 return ret;
252}
253
254#else 210#else
255 211
256struct fdso_ops fmlp_sem_ops = {}; 212struct fdso_ops fmlp_sem_ops = {};
257 213
258asmlinkage long sys_fmlp_down(int sem_od)
259{
260 return -ENOSYS;
261}
262
263asmlinkage long sys_fmlp_up(int sem_od)
264{
265 return -ENOSYS;
266}
267
268#endif 214#endif
diff --git a/litmus/locking.c b/litmus/locking.c
index 848407b79b4f..ab643475093f 100644
--- a/litmus/locking.c
+++ b/litmus/locking.c
@@ -75,6 +75,7 @@ asmlinkage long sys_litmus_lock(int lock_od)
75 entry = get_entry_for_od(lock_od); 75 entry = get_entry_for_od(lock_od);
76 if (entry && is_lock(entry)) { 76 if (entry && is_lock(entry)) {
77 l = get_lock(entry); 77 l = get_lock(entry);
78 TRACE_CUR("attempts to lock 0x%p\n", l);
78 err = l->ops->lock(l); 79 err = l->ops->lock(l);
79 } 80 }
80 81
@@ -96,7 +97,8 @@ asmlinkage long sys_litmus_unlock(int lock_od)
96 entry = get_entry_for_od(lock_od); 97 entry = get_entry_for_od(lock_od);
97 if (entry && is_lock(entry)) { 98 if (entry && is_lock(entry)) {
98 l = get_lock(entry); 99 l = get_lock(entry);
99 err = l->ops->lock(l); 100 TRACE_CUR("attempts to unlock 0x%p\n", l);
101 err = l->ops->unlock(l);
100 } 102 }
101 103
102 /* Note: task my have been preempted in between! Take this into 104 /* Note: task my have been preempted in between! Take this into
diff --git a/litmus/sched_gsn_edf.c b/litmus/sched_gsn_edf.c
index e9c5e531b1ae..4ad95dba4a04 100644
--- a/litmus/sched_gsn_edf.c
+++ b/litmus/sched_gsn_edf.c
@@ -594,7 +594,7 @@ static void gsnedf_task_exit(struct task_struct * t)
594 TRACE_TASK(t, "RIP\n"); 594 TRACE_TASK(t, "RIP\n");
595} 595}
596 596
597#ifdef CONFIG_FMLP 597#if 0
598 598
599/* Update the queue position of a task that got it's priority boosted via 599/* Update the queue position of a task that got it's priority boosted via
600 * priority inheritance. */ 600 * priority inheritance. */
@@ -795,12 +795,6 @@ static struct sched_plugin gsn_edf_plugin __cacheline_aligned_in_smp = {
795 .schedule = gsnedf_schedule, 795 .schedule = gsnedf_schedule,
796 .task_wake_up = gsnedf_task_wake_up, 796 .task_wake_up = gsnedf_task_wake_up,
797 .task_block = gsnedf_task_block, 797 .task_block = gsnedf_task_block,
798#ifdef CONFIG_FMLP
799 .fmlp_active = 1,
800 .pi_block = gsnedf_pi_block,
801 .inherit_priority = gsnedf_inherit_priority,
802 .return_priority = gsnedf_return_priority,
803#endif
804 .admit_task = gsnedf_admit_task, 798 .admit_task = gsnedf_admit_task,
805 .activate_plugin = gsnedf_activate_plugin, 799 .activate_plugin = gsnedf_activate_plugin,
806}; 800};
diff --git a/litmus/sched_psn_edf.c b/litmus/sched_psn_edf.c
index b89823d5c026..01f31e407082 100644
--- a/litmus/sched_psn_edf.c
+++ b/litmus/sched_psn_edf.c
@@ -309,7 +309,7 @@ static void psnedf_task_exit(struct task_struct * t)
309 raw_spin_unlock_irqrestore(&pedf->slock, flags); 309 raw_spin_unlock_irqrestore(&pedf->slock, flags);
310} 310}
311 311
312#ifdef CONFIG_FMLP 312#if 0
313static long psnedf_pi_block(struct pi_semaphore *sem, 313static long psnedf_pi_block(struct pi_semaphore *sem,
314 struct task_struct *new_waiter) 314 struct task_struct *new_waiter)
315{ 315{
@@ -443,9 +443,6 @@ static long psnedf_admit_task(struct task_struct* tsk)
443/* Plugin object */ 443/* Plugin object */
444static struct sched_plugin psn_edf_plugin __cacheline_aligned_in_smp = { 444static struct sched_plugin psn_edf_plugin __cacheline_aligned_in_smp = {
445 .plugin_name = "PSN-EDF", 445 .plugin_name = "PSN-EDF",
446#ifdef CONFIG_SRP
447 .srp_active = 1,
448#endif
449 .tick = psnedf_tick, 446 .tick = psnedf_tick,
450 .task_new = psnedf_task_new, 447 .task_new = psnedf_task_new,
451 .complete_job = complete_job, 448 .complete_job = complete_job,
@@ -453,12 +450,6 @@ static struct sched_plugin psn_edf_plugin __cacheline_aligned_in_smp = {
453 .schedule = psnedf_schedule, 450 .schedule = psnedf_schedule,
454 .task_wake_up = psnedf_task_wake_up, 451 .task_wake_up = psnedf_task_wake_up,
455 .task_block = psnedf_task_block, 452 .task_block = psnedf_task_block,
456#ifdef CONFIG_FMLP
457 .fmlp_active = 1,
458 .pi_block = psnedf_pi_block,
459 .inherit_priority = psnedf_inherit_priority,
460 .return_priority = psnedf_return_priority,
461#endif
462 .admit_task = psnedf_admit_task 453 .admit_task = psnedf_admit_task
463}; 454};
464 455
diff --git a/litmus/srp.c b/litmus/srp.c
index 4601b7dba812..b4c171e79fd4 100644
--- a/litmus/srp.c
+++ b/litmus/srp.c
@@ -189,55 +189,6 @@ static void do_srp_up(struct srp_semaphore* sem)
189 wake_up_all(&__get_cpu_var(srp).ceiling_blocked); 189 wake_up_all(&__get_cpu_var(srp).ceiling_blocked);
190} 190}
191 191
192/* Adjust the system-wide priority ceiling if resource is claimed. */
193asmlinkage long sys_srp_down(int sem_od)
194{
195 int cpu;
196 int ret = -EINVAL;
197 struct srp_semaphore* sem;
198
199 /* disabling preemptions is sufficient protection since
200 * SRP is strictly per CPU and we don't interfere with any
201 * interrupt handlers
202 */
203 preempt_disable();
204 TS_SRP_DOWN_START;
205
206 cpu = smp_processor_id();
207 sem = lookup_srp_sem(sem_od);
208 if (sem && sem->cpu == cpu) {
209 do_srp_down(sem);
210 ret = 0;
211 }
212
213 TS_SRP_DOWN_END;
214 preempt_enable();
215 return ret;
216}
217
218/* Adjust the system-wide priority ceiling if resource is freed. */
219asmlinkage long sys_srp_up(int sem_od)
220{
221 int cpu;
222 int ret = -EINVAL;
223 struct srp_semaphore* sem;
224
225 preempt_disable();
226 TS_SRP_UP_START;
227
228 cpu = smp_processor_id();
229 sem = lookup_srp_sem(sem_od);
230
231 if (sem && sem->cpu == cpu) {
232 do_srp_up(sem);
233 ret = 0;
234 }
235
236 TS_SRP_UP_END;
237 preempt_enable();
238 return ret;
239}
240
241static int srp_wake_up(wait_queue_t *wait, unsigned mode, int sync, 192static int srp_wake_up(wait_queue_t *wait, unsigned mode, int sync,
242 void *key) 193 void *key)
243{ 194{
@@ -303,16 +254,6 @@ void srp_ceiling_block(void)
303 254
304#else 255#else
305 256
306asmlinkage long sys_srp_down(int sem_od)
307{
308 return -ENOSYS;
309}
310
311asmlinkage long sys_srp_up(int sem_od)
312{
313 return -ENOSYS;
314}
315
316struct fdso_ops srp_sem_ops = {}; 257struct fdso_ops srp_sem_ops = {};
317 258
318#endif 259#endif