aboutsummaryrefslogtreecommitdiffstats
path: root/include/litmus/wait.h
diff options
context:
space:
mode:
authorSven Dziadek <s9svdzia@stud.uni-saarland.de>2012-04-16 15:00:33 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2012-07-23 05:57:59 -0400
commit16c1fb2d4ac691e941456a084284020c63fce93a (patch)
tree0f7cf24be334788c9f9bb8242966df83f6266dc6 /include/litmus/wait.h
parent4bc55d3b64fdf0af17f4777013a74fbef7f40ced (diff)
P-FP: port P-FP plugin used in B. Brandenburg's
dissertation (branch bbb-diss) to current version of litmus This is needed for ongoing projects I took the unchanged code but removed some leftovers of OMLP which is not implemented
Diffstat (limited to 'include/litmus/wait.h')
-rw-r--r--include/litmus/wait.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/include/litmus/wait.h b/include/litmus/wait.h
new file mode 100644
index 00000000000..ce1347c355f
--- /dev/null
+++ b/include/litmus/wait.h
@@ -0,0 +1,57 @@
1#ifndef _LITMUS_WAIT_H_
2#define _LITMUS_WAIT_H_
3
4struct task_struct* __waitqueue_remove_first(wait_queue_head_t *wq);
5
6/* wrap regular wait_queue_t head */
7struct __prio_wait_queue {
8 wait_queue_t wq;
9
10 /* some priority point */
11 lt_t priority;
12 /* break ties in priority by lower tie_breaker */
13 unsigned int tie_breaker;
14};
15
16typedef struct __prio_wait_queue prio_wait_queue_t;
17
18static inline void init_prio_waitqueue_entry(prio_wait_queue_t *pwq,
19 struct task_struct* t,
20 lt_t priority)
21{
22 init_waitqueue_entry(&pwq->wq, t);
23 pwq->priority = priority;
24 pwq->tie_breaker = 0;
25}
26
27static inline void init_prio_waitqueue_entry_tie(prio_wait_queue_t *pwq,
28 struct task_struct* t,
29 lt_t priority,
30 unsigned int tie_breaker)
31{
32 init_waitqueue_entry(&pwq->wq, t);
33 pwq->priority = priority;
34 pwq->tie_breaker = tie_breaker;
35}
36
37unsigned int __add_wait_queue_prio_exclusive(
38 wait_queue_head_t* head,
39 prio_wait_queue_t *new);
40
41static inline unsigned int add_wait_queue_prio_exclusive(
42 wait_queue_head_t* head,
43 prio_wait_queue_t *new)
44{
45 unsigned long flags;
46 unsigned int passed;
47
48 spin_lock_irqsave(&head->lock, flags);
49 passed = __add_wait_queue_prio_exclusive(head, new);
50
51 spin_unlock_irqrestore(&head->lock, flags);
52
53 return passed;
54}
55
56
57#endif