aboutsummaryrefslogtreecommitdiffstats
path: root/include/litmus
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-09-14 08:34:36 -0400
committerGlenn Elliott <gelliott@cs.unc.edu>2012-09-14 08:34:36 -0400
commit4ad6ba08f0dab67bbd89a26b27f1cc86e3c45c13 (patch)
treefd982c7a12f7a947278e05d0b126a015c24793f4 /include/litmus
parentc1d1979c99ca397241da4e3d7e0cb77f7ec28240 (diff)
checkpoint for aux_tasks. can still deadlock
Diffstat (limited to 'include/litmus')
-rw-r--r--include/litmus/aux_tasks.h33
-rw-r--r--include/litmus/litmus.h1
-rw-r--r--include/litmus/rt_param.h17
-rw-r--r--include/litmus/sched_plugin.h7
4 files changed, 55 insertions, 3 deletions
diff --git a/include/litmus/aux_tasks.h b/include/litmus/aux_tasks.h
new file mode 100644
index 000000000000..8e50ac85b082
--- /dev/null
+++ b/include/litmus/aux_tasks.h
@@ -0,0 +1,33 @@
1#ifndef LITMUS_AUX_taskS
2#define LITMUS_AUX_taskS
3
4struct task_struct;
5
6#define MAGIC_AUX_TASK_PERIOD ~((lt_t)0)
7
8/* admit an aux task with default parameters */
9//int admit_aux_task(struct task_struct *t);
10
11/* call on an aux task when it exits real-time */
12int exit_aux_task(struct task_struct *t);
13
14/* call when an aux_owner becomes real-time */
15long enable_aux_task_owner(struct task_struct *t);
16
17/* call when an aux_owner exits real-time */
18long disable_aux_task_owner(struct task_struct *t);
19
20
21/* collectivelly make all aux tasks in the process of leader inherit from hp */
22//int aux_tasks_increase_priority(struct task_struct *leader, struct task_struct *hp);
23
24/* collectivelly make all aux tasks in the process of leader inherit from hp */
25//int aux_tasks_decrease_priority(struct task_struct *leader, struct task_struct *hp);
26
27/* call when an aux_owner increases its priority */
28int aux_task_owner_increase_priority(struct task_struct *t);
29
30/* call when an aux_owner decreases its priority */
31int aux_task_owner_decrease_priority(struct task_struct *t);
32
33#endif \ No newline at end of file
diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h
index 1d70ab713571..f9829167294d 100644
--- a/include/litmus/litmus.h
+++ b/include/litmus/litmus.h
@@ -44,6 +44,7 @@ void litmus_exit_task(struct task_struct *tsk);
44 ((t)->rt_param.transition_pending) 44 ((t)->rt_param.transition_pending)
45 45
46#define tsk_rt(t) (&(t)->rt_param) 46#define tsk_rt(t) (&(t)->rt_param)
47#define tsk_aux(t) (&(t)->aux_data)
47 48
48/* Realtime utility macros */ 49/* Realtime utility macros */
49#define get_rt_flags(t) (tsk_rt(t)->flags) 50#define get_rt_flags(t) (tsk_rt(t)->flags)
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h
index 02b750a9570b..2a6c70f1dd37 100644
--- a/include/litmus/rt_param.h
+++ b/include/litmus/rt_param.h
@@ -285,9 +285,13 @@ struct rt_param {
285#endif 285#endif
286 286
287 287
288 struct task_struct* hp_group; 288#ifdef CONFIG_LITMUS_LOCKING
289 unsigned int is_slave:1; 289 unsigned int is_aux_task:1;
290 unsigned int has_slaves:1; 290 unsigned int has_aux_tasks:1;
291
292 struct list_head aux_task_node;
293 struct binheap_node aux_task_owner_node;
294#endif
291 295
292 296
293#ifdef CONFIG_NP_SECTION 297#ifdef CONFIG_NP_SECTION
@@ -354,6 +358,13 @@ struct rt_param {
354 struct control_page * ctrl_page; 358 struct control_page * ctrl_page;
355}; 359};
356 360
361struct aux_data
362{
363 struct list_head aux_tasks;
364 struct binheap aux_task_owners;
365 unsigned int initialized:1;
366};
367
357/* Possible RT flags */ 368/* Possible RT flags */
358#define RT_F_RUNNING 0x00000000 369#define RT_F_RUNNING 0x00000000
359#define RT_F_SLEEP 0x00000001 370#define RT_F_SLEEP 0x00000001
diff --git a/include/litmus/sched_plugin.h b/include/litmus/sched_plugin.h
index 24a6858b4b0b..bd75e7c09a10 100644
--- a/include/litmus/sched_plugin.h
+++ b/include/litmus/sched_plugin.h
@@ -70,6 +70,10 @@ typedef long (*allocate_affinity_observer_t) (
70 70
71typedef void (*increase_prio_t)(struct task_struct* t, struct task_struct* prio_inh); 71typedef void (*increase_prio_t)(struct task_struct* t, struct task_struct* prio_inh);
72typedef void (*decrease_prio_t)(struct task_struct* t, struct task_struct* prio_inh); 72typedef void (*decrease_prio_t)(struct task_struct* t, struct task_struct* prio_inh);
73
74typedef int (*__increase_prio_t)(struct task_struct* t, struct task_struct* prio_inh);
75typedef int (*__decrease_prio_t)(struct task_struct* t, struct task_struct* prio_inh);
76
73typedef void (*nested_increase_prio_t)(struct task_struct* t, struct task_struct* prio_inh, 77typedef void (*nested_increase_prio_t)(struct task_struct* t, struct task_struct* prio_inh,
74 raw_spinlock_t *to_unlock, unsigned long irqflags); 78 raw_spinlock_t *to_unlock, unsigned long irqflags);
75typedef void (*nested_decrease_prio_t)(struct task_struct* t, struct task_struct* prio_inh, 79typedef void (*nested_decrease_prio_t)(struct task_struct* t, struct task_struct* prio_inh,
@@ -146,6 +150,9 @@ struct sched_plugin {
146 allocate_lock_t allocate_lock; 150 allocate_lock_t allocate_lock;
147 increase_prio_t increase_prio; 151 increase_prio_t increase_prio;
148 decrease_prio_t decrease_prio; 152 decrease_prio_t decrease_prio;
153
154 __increase_prio_t __increase_prio;
155 __decrease_prio_t __decrease_prio;
149#endif 156#endif
150#ifdef CONFIG_LITMUS_NESTED_LOCKING 157#ifdef CONFIG_LITMUS_NESTED_LOCKING
151 nested_increase_prio_t nested_increase_prio; 158 nested_increase_prio_t nested_increase_prio;