diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-01-28 17:04:58 -0500 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-02-01 16:30:40 -0500 |
commit | e1b81e70c3af9d19d639bc8bdaa5a8fc13bf17a8 (patch) | |
tree | a05f415994b7313afff06a437e049c40bb5366cd /include/litmus | |
parent | cc602187d4466374bca031039e145aa1b89aca96 (diff) |
SRP: port to new generic locking API
This re-enables SRP support under PSN-EDF and demonstrates how the new
locking API should be used.
Diffstat (limited to 'include/litmus')
-rw-r--r-- | include/litmus/litmus.h | 2 | ||||
-rw-r--r-- | include/litmus/srp.h | 28 |
2 files changed, 29 insertions, 1 deletions
diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h index 4a774a9e7acc..8971b25f23e6 100644 --- a/include/litmus/litmus.h +++ b/include/litmus/litmus.h | |||
@@ -115,7 +115,7 @@ static inline lt_t litmus_clock(void) | |||
115 | 115 | ||
116 | void preempt_if_preemptable(struct task_struct* t, int on_cpu); | 116 | void preempt_if_preemptable(struct task_struct* t, int on_cpu); |
117 | 117 | ||
118 | #ifdef CONFIG_SRP | 118 | #ifdef CONFIG_LITMUS_LOCKING |
119 | void srp_ceiling_block(void); | 119 | void srp_ceiling_block(void); |
120 | #else | 120 | #else |
121 | #define srp_ceiling_block() /* nothing */ | 121 | #define srp_ceiling_block() /* nothing */ |
diff --git a/include/litmus/srp.h b/include/litmus/srp.h new file mode 100644 index 000000000000..c9a4552b2bf3 --- /dev/null +++ b/include/litmus/srp.h | |||
@@ -0,0 +1,28 @@ | |||
1 | #ifndef LITMUS_SRP_H | ||
2 | #define LITMUS_SRP_H | ||
3 | |||
4 | struct srp_semaphore; | ||
5 | |||
6 | struct srp_priority { | ||
7 | struct list_head list; | ||
8 | unsigned int priority; | ||
9 | pid_t pid; | ||
10 | }; | ||
11 | #define list2prio(l) list_entry(l, struct srp_priority, list) | ||
12 | |||
13 | /* struct for uniprocessor SRP "semaphore" */ | ||
14 | struct srp_semaphore { | ||
15 | struct litmus_lock litmus_lock; | ||
16 | struct srp_priority ceiling; | ||
17 | struct task_struct* owner; | ||
18 | int cpu; /* cpu associated with this "semaphore" and resource */ | ||
19 | }; | ||
20 | |||
21 | /* map a task to its SRP preemption level priority */ | ||
22 | typedef unsigned int (*srp_prioritization_t)(struct task_struct* t); | ||
23 | /* Must be updated by each plugin that uses SRP.*/ | ||
24 | extern srp_prioritization_t get_srp_prio; | ||
25 | |||
26 | struct srp_semaphore* allocate_srp_semaphore(void); | ||
27 | |||
28 | #endif | ||