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.h80
1 files changed, 78 insertions, 2 deletions
diff --git a/include/litmus/sched_plugin.h b/include/litmus/sched_plugin.h
index 1546ab7f1d66..d0e7d74bb45e 100644
--- a/include/litmus/sched_plugin.h
+++ b/include/litmus/sched_plugin.h
@@ -11,6 +11,12 @@
11#include <litmus/locking.h> 11#include <litmus/locking.h>
12#endif 12#endif
13 13
14#ifdef CONFIG_LITMUS_AFFINITY_LOCKING
15#include <litmus/kexclu_affinity.h>
16#endif
17
18#include <linux/interrupt.h>
19
14/************************ setup/tear down ********************/ 20/************************ setup/tear down ********************/
15 21
16typedef long (*activate_plugin_t) (void); 22typedef long (*activate_plugin_t) (void);
@@ -29,7 +35,6 @@ typedef struct task_struct* (*schedule_t)(struct task_struct * prev);
29 */ 35 */
30typedef void (*finish_switch_t)(struct task_struct *prev); 36typedef void (*finish_switch_t)(struct task_struct *prev);
31 37
32
33/********************* task state changes ********************/ 38/********************* task state changes ********************/
34 39
35/* Called to setup a new real-time task. 40/* Called to setup a new real-time task.
@@ -60,6 +65,49 @@ typedef long (*allocate_lock_t) (struct litmus_lock **lock, int type,
60 void* __user config); 65 void* __user config);
61#endif 66#endif
62 67
68struct affinity_observer;
69typedef long (*allocate_affinity_observer_t) (
70 struct affinity_observer **aff_obs, int type,
71 void* __user config);
72
73typedef void (*increase_prio_t)(struct task_struct* t, struct task_struct* prio_inh);
74typedef void (*decrease_prio_t)(struct task_struct* t, struct task_struct* prio_inh);
75
76typedef int (*__increase_prio_t)(struct task_struct* t, struct task_struct* prio_inh);
77typedef int (*__decrease_prio_t)(struct task_struct* t, struct task_struct* prio_inh);
78
79typedef void (*nested_increase_prio_t)(struct task_struct* t, struct task_struct* prio_inh,
80 raw_spinlock_t *to_unlock, unsigned long irqflags);
81typedef void (*nested_decrease_prio_t)(struct task_struct* t, struct task_struct* prio_inh,
82 raw_spinlock_t *to_unlock, unsigned long irqflags);
83
84
85typedef int (*enqueue_pai_tasklet_t)(struct tasklet_struct* tasklet);
86typedef void (*change_prio_pai_tasklet_t)(struct task_struct *old_prio,
87 struct task_struct *new_prio);
88typedef void (*run_tasklets_t)(struct task_struct* next);
89
90typedef raw_spinlock_t* (*get_dgl_spinlock_t) (struct task_struct *t);
91
92
93typedef int (*higher_prio_t)(struct task_struct* a, struct task_struct* b);
94
95#ifdef CONFIG_LITMUS_NESTED_LOCKING
96
97typedef enum
98{
99 BASE,
100 EFFECTIVE
101} comparison_mode_t;
102
103typedef int (*__higher_prio_t)(struct task_struct* a, comparison_mode_t a_mod,
104 struct task_struct* b, comparison_mode_t b_mod);
105#endif
106
107#if defined(CONFIG_LITMUS_NVIDIA) && defined(CONFIG_LITMUS_SOFTIRQD)
108typedef int (*default_cpu_for_gpu_t)(int gpu);
109#endif
110
63 111
64/********************* sys call backends ********************/ 112/********************* sys call backends ********************/
65/* This function causes the caller to sleep until the next release */ 113/* This function causes the caller to sleep until the next release */
@@ -90,14 +138,42 @@ struct sched_plugin {
90 /* task state changes */ 138 /* task state changes */
91 admit_task_t admit_task; 139 admit_task_t admit_task;
92 140
93 task_new_t task_new; 141 task_new_t task_new;
94 task_wake_up_t task_wake_up; 142 task_wake_up_t task_wake_up;
95 task_block_t task_block; 143 task_block_t task_block;
96 task_exit_t task_exit; 144 task_exit_t task_exit;
97 145
146 higher_prio_t compare;
147
98#ifdef CONFIG_LITMUS_LOCKING 148#ifdef CONFIG_LITMUS_LOCKING
99 /* locking protocols */ 149 /* locking protocols */
100 allocate_lock_t allocate_lock; 150 allocate_lock_t allocate_lock;
151 increase_prio_t increase_prio;
152 decrease_prio_t decrease_prio;
153
154 __increase_prio_t __increase_prio;
155 __decrease_prio_t __decrease_prio;
156#endif
157#ifdef CONFIG_LITMUS_NESTED_LOCKING
158 nested_increase_prio_t nested_increase_prio;
159 nested_decrease_prio_t nested_decrease_prio;
160 __higher_prio_t __compare;
161#endif
162#ifdef CONFIG_LITMUS_DGL_SUPPORT
163 get_dgl_spinlock_t get_dgl_spinlock;
164#endif
165
166#ifdef CONFIG_LITMUS_AFFINITY_LOCKING
167 allocate_affinity_observer_t allocate_aff_obs;
168#endif
169#ifdef CONFIG_LITMUS_PAI_SOFTIRQD
170 enqueue_pai_tasklet_t enqueue_pai_tasklet;
171 change_prio_pai_tasklet_t change_prio_pai_tasklet;
172 run_tasklets_t run_tasklets;
173#endif
174
175#if defined(CONFIG_LITMUS_NVIDIA) && defined(CONFIG_LITMUS_SOFTIRQD)
176 default_cpu_for_gpu_t map_gpu_to_cpu;
101#endif 177#endif
102} __attribute__ ((__aligned__(SMP_CACHE_BYTES))); 178} __attribute__ ((__aligned__(SMP_CACHE_BYTES)));
103 179