aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/sched_plugin.c
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2014-04-30 12:34:33 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2015-09-07 16:47:32 -0400
commit2971daf071d2c0a35986f16bfed7e661e7e88f92 (patch)
treebf8c419cfbb3cc116f17ef6e24af2bcbe66f8f79 /litmus/sched_plugin.c
parent8e51b378224ae53244c6917964c88aa2a9d024ad (diff)
LITMUS^RT Core: add get_current_budget() system call
Allow userspace to figure out the used-up and remaining budget of a task.
Diffstat (limited to 'litmus/sched_plugin.c')
-rw-r--r--litmus/sched_plugin.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/litmus/sched_plugin.c b/litmus/sched_plugin.c
index edd91e9bf773..7b1eba0de75c 100644
--- a/litmus/sched_plugin.c
+++ b/litmus/sched_plugin.c
@@ -13,6 +13,7 @@
13#include <litmus/sched_plugin.h> 13#include <litmus/sched_plugin.h>
14#include <litmus/preempt.h> 14#include <litmus/preempt.h>
15#include <litmus/jobs.h> 15#include <litmus/jobs.h>
16#include <litmus/budget.h>
16 17
17/* 18/*
18 * Generic function to trigger preemption on either local or remote cpu 19 * Generic function to trigger preemption on either local or remote cpu
@@ -197,6 +198,9 @@ int register_sched_plugin(struct sched_plugin* plugin)
197 if (!plugin->wait_for_release_at) 198 if (!plugin->wait_for_release_at)
198 plugin->wait_for_release_at = default_wait_for_release_at; 199 plugin->wait_for_release_at = default_wait_for_release_at;
199 200
201 if (!plugin->current_budget)
202 plugin->current_budget = litmus_current_budget;
203
200 raw_spin_lock(&sched_plugins_lock); 204 raw_spin_lock(&sched_plugins_lock);
201 list_add(&plugin->list, &sched_plugins); 205 list_add(&plugin->list, &sched_plugins);
202 raw_spin_unlock(&sched_plugins_lock); 206 raw_spin_unlock(&sched_plugins_lock);