diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-01-28 12:24:58 -0500 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-02-01 16:30:37 -0500 |
commit | 2dea9d5e7727b8474981557cbf925687b8f33865 (patch) | |
tree | 96134311a3b67372e19a5f7eb232acb3d0be9b09 /litmus/sched_plugin.c | |
parent | fd8ae31c74975c8499983c9831bff2b136b98434 (diff) |
Litmus core: change plugin locking interface to generic 'allocate_lock()'
As the number of supported locking protocols is expected to rise,
hard-coding things like priority inheritance in the plugin interface
doesn't scale. Instead, use a new generic lock-ops approach. With this
approach, each plugin can define its own protocol implementation (or
use a generic one), and plugins can support multiple protocols without
having to change the plugin interface for each protocol.
Diffstat (limited to 'litmus/sched_plugin.c')
-rw-r--r-- | litmus/sched_plugin.c | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/litmus/sched_plugin.c b/litmus/sched_plugin.c index d912a6494d20..2f8f399b195f 100644 --- a/litmus/sched_plugin.c +++ b/litmus/sched_plugin.c | |||
@@ -121,23 +121,11 @@ static long litmus_dummy_deactivate_plugin(void) | |||
121 | return 0; | 121 | return 0; |
122 | } | 122 | } |
123 | 123 | ||
124 | #ifdef CONFIG_FMLP | 124 | #ifdef CONFIG_LITMUS_LOCKING |
125 | 125 | ||
126 | static long litmus_dummy_inherit_priority(struct pi_semaphore *sem, | 126 | static long litmus_dummy_allocate_lock(struct litmus_lock **lock, int type) |
127 | struct task_struct *new_owner) | ||
128 | { | 127 | { |
129 | return -ENOSYS; | 128 | return -ENXIO; |
130 | } | ||
131 | |||
132 | static long litmus_dummy_return_priority(struct pi_semaphore *sem) | ||
133 | { | ||
134 | return -ENOSYS; | ||
135 | } | ||
136 | |||
137 | static long litmus_dummy_pi_block(struct pi_semaphore *sem, | ||
138 | struct task_struct *new_waiter) | ||
139 | { | ||
140 | return -ENOSYS; | ||
141 | } | 129 | } |
142 | 130 | ||
143 | #endif | 131 | #endif |
@@ -158,10 +146,8 @@ struct sched_plugin linux_sched_plugin = { | |||
158 | .finish_switch = litmus_dummy_finish_switch, | 146 | .finish_switch = litmus_dummy_finish_switch, |
159 | .activate_plugin = litmus_dummy_activate_plugin, | 147 | .activate_plugin = litmus_dummy_activate_plugin, |
160 | .deactivate_plugin = litmus_dummy_deactivate_plugin, | 148 | .deactivate_plugin = litmus_dummy_deactivate_plugin, |
161 | #ifdef CONFIG_FMLP | 149 | #ifdef CONFIG_LITMUS_LOCKING |
162 | .inherit_priority = litmus_dummy_inherit_priority, | 150 | .allocate_lock = litmus_dummy_allocate_lock, |
163 | .return_priority = litmus_dummy_return_priority, | ||
164 | .pi_block = litmus_dummy_pi_block, | ||
165 | #endif | 151 | #endif |
166 | .admit_task = litmus_dummy_admit_task | 152 | .admit_task = litmus_dummy_admit_task |
167 | }; | 153 | }; |
@@ -198,10 +184,8 @@ int register_sched_plugin(struct sched_plugin* plugin) | |||
198 | CHECK(complete_job); | 184 | CHECK(complete_job); |
199 | CHECK(activate_plugin); | 185 | CHECK(activate_plugin); |
200 | CHECK(deactivate_plugin); | 186 | CHECK(deactivate_plugin); |
201 | #ifdef CONFIG_FMLP | 187 | #ifdef CONFIG_LITMUS_LOCKING |
202 | CHECK(inherit_priority); | 188 | CHECK(allocate_lock); |
203 | CHECK(return_priority); | ||
204 | CHECK(pi_block); | ||
205 | #endif | 189 | #endif |
206 | CHECK(admit_task); | 190 | CHECK(admit_task); |
207 | 191 | ||