aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2015-10-06 15:42:19 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2016-03-08 10:12:46 -0500
commitaa87f5a3b279b14cdd9dd618137cc2698eacc5d9 (patch)
tree3b4f33e0716b1a49f4deaf630c085052f932a02c
parent9414feb52855d5446e0d89765f7806deb5cfee08 (diff)
Plugin interface: add fork_task() callback
-rw-r--r--include/litmus/sched_plugin.h4
-rw-r--r--litmus/sched_plugin.c7
2 files changed, 11 insertions, 0 deletions
diff --git a/include/litmus/sched_plugin.h b/include/litmus/sched_plugin.h
index f36bb3875f58..0c2aabad40c9 100644
--- a/include/litmus/sched_plugin.h
+++ b/include/litmus/sched_plugin.h
@@ -72,6 +72,9 @@ typedef long (*complete_job_t) (void);
72 72
73typedef long (*admit_task_t)(struct task_struct* tsk); 73typedef long (*admit_task_t)(struct task_struct* tsk);
74 74
75/* return false to indicate that the plugin does not support forking */
76typedef bool (*fork_task_t)(struct task_struct* tsk);
77
75typedef long (*wait_for_release_at_t)(lt_t release_time); 78typedef long (*wait_for_release_at_t)(lt_t release_time);
76 79
77/* Informs the plugin when a synchronous release takes place. */ 80/* Informs the plugin when a synchronous release takes place. */
@@ -108,6 +111,7 @@ struct sched_plugin {
108 111
109 /* task state changes */ 112 /* task state changes */
110 admit_task_t admit_task; 113 admit_task_t admit_task;
114 fork_task_t fork_task;
111 115
112 task_new_t task_new; 116 task_new_t task_new;
113 task_wake_up_t task_wake_up; 117 task_wake_up_t task_wake_up;
diff --git a/litmus/sched_plugin.c b/litmus/sched_plugin.c
index 7b1eba0de75c..6ab5b85082c9 100644
--- a/litmus/sched_plugin.c
+++ b/litmus/sched_plugin.c
@@ -77,6 +77,12 @@ static long litmus_dummy_admit_task(struct task_struct* tsk)
77 return -EINVAL; 77 return -EINVAL;
78} 78}
79 79
80static bool litmus_dummy_fork_task(struct task_struct* tsk)
81{
82 /* Default behavior: return false to demote to non-real-time task */
83 return false;
84}
85
80static void litmus_dummy_task_new(struct task_struct *t, int on_rq, int running) 86static void litmus_dummy_task_new(struct task_struct *t, int on_rq, int running)
81{ 87{
82} 88}
@@ -193,6 +199,7 @@ int register_sched_plugin(struct sched_plugin* plugin)
193 CHECK(allocate_lock); 199 CHECK(allocate_lock);
194#endif 200#endif
195 CHECK(admit_task); 201 CHECK(admit_task);
202 CHECK(fork_task);
196 CHECK(synchronous_release_at); 203 CHECK(synchronous_release_at);
197 204
198 if (!plugin->wait_for_release_at) 205 if (!plugin->wait_for_release_at)