diff options
Diffstat (limited to 'include/litmus/sched_plugin.h')
-rw-r--r-- | include/litmus/sched_plugin.h | 50 |
1 files changed, 9 insertions, 41 deletions
diff --git a/include/litmus/sched_plugin.h b/include/litmus/sched_plugin.h index 2d856d587041..27b719aebed9 100644 --- a/include/litmus/sched_plugin.h +++ b/include/litmus/sched_plugin.h | |||
@@ -7,19 +7,9 @@ | |||
7 | 7 | ||
8 | #include <linux/sched.h> | 8 | #include <linux/sched.h> |
9 | 9 | ||
10 | /* struct for semaphore with priority inheritance */ | 10 | #ifdef CONFIG_LITMUS_LOCKING |
11 | struct pi_semaphore { | 11 | #include <litmus/locking.h> |
12 | atomic_t count; | 12 | #endif |
13 | int sleepers; | ||
14 | wait_queue_head_t wait; | ||
15 | struct { | ||
16 | /* highest-prio holder/waiter */ | ||
17 | struct task_struct *task; | ||
18 | struct task_struct* cpu_task[NR_CPUS]; | ||
19 | } hp; | ||
20 | /* current lock holder */ | ||
21 | struct task_struct *holder; | ||
22 | }; | ||
23 | 13 | ||
24 | /************************ setup/tear down ********************/ | 14 | /************************ setup/tear down ********************/ |
25 | 15 | ||
@@ -63,24 +53,9 @@ typedef void (*task_block_t) (struct task_struct *task); | |||
63 | */ | 53 | */ |
64 | typedef void (*task_exit_t) (struct task_struct *); | 54 | typedef void (*task_exit_t) (struct task_struct *); |
65 | 55 | ||
66 | /* Called when the new_owner is released from the wait queue | 56 | /* Called when the current task attempts to create a new lock of a given |
67 | * it should now inherit the priority from sem, _before_ it gets readded | 57 | * protocol type. */ |
68 | * to any queue | 58 | typedef long (*allocate_lock_t) (struct litmus_lock **lock, int type); |
69 | */ | ||
70 | typedef long (*inherit_priority_t) (struct pi_semaphore *sem, | ||
71 | struct task_struct *new_owner); | ||
72 | |||
73 | /* Called when the current task releases a semahpore where it might have | ||
74 | * inherited a piority from | ||
75 | */ | ||
76 | typedef long (*return_priority_t) (struct pi_semaphore *sem); | ||
77 | |||
78 | /* Called when a task tries to acquire a semaphore and fails. Check if its | ||
79 | * priority is higher than that of the current holder. | ||
80 | */ | ||
81 | typedef long (*pi_block_t) (struct pi_semaphore *sem, struct task_struct *t); | ||
82 | |||
83 | |||
84 | 59 | ||
85 | 60 | ||
86 | /********************* sys call backends ********************/ | 61 | /********************* sys call backends ********************/ |
@@ -100,10 +75,6 @@ struct sched_plugin { | |||
100 | activate_plugin_t activate_plugin; | 75 | activate_plugin_t activate_plugin; |
101 | deactivate_plugin_t deactivate_plugin; | 76 | deactivate_plugin_t deactivate_plugin; |
102 | 77 | ||
103 | #ifdef CONFIG_SRP | ||
104 | unsigned int srp_active; | ||
105 | #endif | ||
106 | |||
107 | /* scheduler invocation */ | 78 | /* scheduler invocation */ |
108 | scheduler_tick_t tick; | 79 | scheduler_tick_t tick; |
109 | schedule_t schedule; | 80 | schedule_t schedule; |
@@ -121,12 +92,9 @@ struct sched_plugin { | |||
121 | task_block_t task_block; | 92 | task_block_t task_block; |
122 | task_exit_t task_exit; | 93 | task_exit_t task_exit; |
123 | 94 | ||
124 | #ifdef CONFIG_FMLP | 95 | #ifdef CONFIG_LITMUS_LOCKING |
125 | /* priority inheritance */ | 96 | /* locking protocols */ |
126 | unsigned int fmlp_active; | 97 | allocate_lock_t allocate_lock; |
127 | inherit_priority_t inherit_priority; | ||
128 | return_priority_t return_priority; | ||
129 | pi_block_t pi_block; | ||
130 | #endif | 98 | #endif |
131 | } __attribute__ ((__aligned__(SMP_CACHE_BYTES))); | 99 | } __attribute__ ((__aligned__(SMP_CACHE_BYTES))); |
132 | 100 | ||