aboutsummaryrefslogtreecommitdiffstats
path: root/include/litmus
diff options
context:
space:
mode:
Diffstat (limited to 'include/litmus')
-rw-r--r--include/litmus/fdso.h4
-rw-r--r--include/litmus/sched_plugin.h34
-rw-r--r--include/litmus/unistd_32.h4
-rw-r--r--include/litmus/unistd_64.h6
4 files changed, 45 insertions, 3 deletions
diff --git a/include/litmus/fdso.h b/include/litmus/fdso.h
index b0e62a9098bd..4c67c87d0e1b 100644
--- a/include/litmus/fdso.h
+++ b/include/litmus/fdso.h
@@ -19,8 +19,9 @@ typedef enum {
19 19
20 FMLP_SEM = 0, 20 FMLP_SEM = 0,
21 SRP_SEM = 1, 21 SRP_SEM = 1,
22 OMLP_SEM = 2,
22 23
23 MAX_OBJ_TYPE = 1 24 MAX_OBJ_TYPE = 2
24} obj_type_t; 25} obj_type_t;
25 26
26struct inode_obj_id { 27struct inode_obj_id {
@@ -64,6 +65,7 @@ static inline void* od_lookup(int od, obj_type_t type)
64 65
65#define lookup_fmlp_sem(od)((struct fmlp_semaphore*) od_lookup(od, FMLP_SEM)) 66#define lookup_fmlp_sem(od)((struct fmlp_semaphore*) od_lookup(od, FMLP_SEM))
66#define lookup_srp_sem(od) ((struct srp_semaphore*) od_lookup(od, SRP_SEM)) 67#define lookup_srp_sem(od) ((struct srp_semaphore*) od_lookup(od, SRP_SEM))
68#define lookup_omlp_sem(od)((struct omlp_semaphore*) od_lookup(od, OMLP_SEM))
67#define lookup_ics(od) ((struct ics*) od_lookup(od, ICS_ID)) 69#define lookup_ics(od) ((struct ics*) od_lookup(od, ICS_ID))
68 70
69 71
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
diff --git a/include/litmus/unistd_32.h b/include/litmus/unistd_32.h
index dbddc6523f8e..3c55c8331e1b 100644
--- a/include/litmus/unistd_32.h
+++ b/include/litmus/unistd_32.h
@@ -19,5 +19,7 @@
19#define __NR_wait_for_ts_release __LSC(11) 19#define __NR_wait_for_ts_release __LSC(11)
20#define __NR_release_ts __LSC(12) 20#define __NR_release_ts __LSC(12)
21#define __NR_null_call __LSC(13) 21#define __NR_null_call __LSC(13)
22#define __NR_omlp_down __LSC(14)
23#define __NR_omlp_up __LSC(15)
22 24
23#define NR_litmus_syscalls 14 25#define NR_litmus_syscalls 16
diff --git a/include/litmus/unistd_64.h b/include/litmus/unistd_64.h
index f0618e75348d..dd4b6c928b2c 100644
--- a/include/litmus/unistd_64.h
+++ b/include/litmus/unistd_64.h
@@ -33,5 +33,9 @@ __SYSCALL(__NR_wait_for_ts_release, sys_wait_for_ts_release)
33__SYSCALL(__NR_release_ts, sys_release_ts) 33__SYSCALL(__NR_release_ts, sys_release_ts)
34#define __NR_null_call __LSC(13) 34#define __NR_null_call __LSC(13)
35__SYSCALL(__NR_null_call, sys_null_call) 35__SYSCALL(__NR_null_call, sys_null_call)
36#define __NR_omlp_down __LSC(14)
37__SYSCALL(__NR_omlp_down, sys_omlp_down)
38#define __NR_omlp_up __LSC(15)
39__SYSCALL(__NR_omlp_up, sys_omlp_up)
36 40
37#define NR_litmus_syscalls 14 41#define NR_litmus_syscalls 16