aboutsummaryrefslogtreecommitdiffstats
path: root/include/litmus/sched_plugin.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/litmus/sched_plugin.h')
-rw-r--r--include/litmus/sched_plugin.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/litmus/sched_plugin.h b/include/litmus/sched_plugin.h
index 071e809564b2..186e99c6bb88 100644
--- a/include/litmus/sched_plugin.h
+++ b/include/litmus/sched_plugin.h
@@ -41,6 +41,25 @@ static inline struct fmlp_semaphore* to_fmlp(struct pi_semaphore* sem) {
41} 41}
42#endif 42#endif
43 43
44#ifdef CONFIG_OMLP
45struct omlp_semaphore {
46 /* NOTE: first part of struct matchs fmlp_semaphore, so
47 * omlp_struct can be cast to fmlp_struct
48 */
49 struct pi_semaphore pi; /* must always be first. */
50
51 /* current lock holder */
52 struct task_struct *holder;
53
54 /* PQ - just a single list since we only support G-EDF for now */
55 struct list_head pq_task_list;
56};
57
58static inline struct omlp_semaphore* to_omlp(struct pi_semaphore* sem) {
59 return (struct omlp_semaphore*)sem;
60}
61#endif
62
44/************************ setup/tear down ********************/ 63/************************ setup/tear down ********************/
45 64
46typedef long (*activate_plugin_t) (void); 65typedef long (*activate_plugin_t) (void);
@@ -149,6 +168,13 @@ struct sched_plugin {
149 return_priority_t fmlp_return_priority; 168 return_priority_t fmlp_return_priority;
150 pi_block_t fmlp_pi_block; 169 pi_block_t fmlp_pi_block;
151#endif 170#endif
171
172#ifdef CONFIG_OMLP
173 unsigned int omlp_active;
174 inherit_priority_t omlp_inherit_priority;
175 return_priority_t omlp_return_priority;
176 pi_block_t omlp_pi_block;
177#endif
152} __attribute__ ((__aligned__(SMP_CACHE_BYTES))); 178} __attribute__ ((__aligned__(SMP_CACHE_BYTES)));
153 179
154 180
@@ -177,6 +203,14 @@ static inline int fmlp_active(void)
177 return 0; 203 return 0;
178#endif 204#endif
179} 205}
206static inline int omlp_active(void)
207{
208#ifdef CONFIG_OMLP
209 return litmus->omlp_active;
210#else
211 return 0;
212#endif
213}
180 214
181extern struct sched_plugin linux_sched_plugin; 215extern struct sched_plugin linux_sched_plugin;
182 216