aboutsummaryrefslogtreecommitdiffstats
path: root/src/sched.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-08-07 11:33:31 -0400
committerKevin O'Connor <kevin@koconnor.net>2017-08-08 00:27:28 -0400
commita9982beacf184ccdc4bf1221852c900b0809537d (patch)
tree0c7774106b678688361ae8b4ffc346eb51b7b013 /src/sched.c
parente9d2ec7c41c60ab74fe2850fb0787af7bb3361f4 (diff)
downloadkutter-a9982beacf184ccdc4bf1221852c900b0809537d.tar.gz
kutter-a9982beacf184ccdc4bf1221852c900b0809537d.tar.xz
kutter-a9982beacf184ccdc4bf1221852c900b0809537d.zip
sched: Introduce sched_wake_tasks() function to wake up tasks
Add function to indicate when tasks need to be run. This will allow the scheduler code to know if there are any tasks that need to be processed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/sched.c')
-rw-r--r--src/sched.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sched.c b/src/sched.c
index 0aadcc75..a2f5fea8 100644
--- a/src/sched.c
+++ b/src/sched.c
@@ -28,6 +28,9 @@ static struct timer sentinel_timer, deleted_timer;
static uint_fast8_t
periodic_event(struct timer *t)
{
+ // Make sure the stats task runs periodically
+ sched_wake_tasks();
+ // Reschedule timer
periodic_timer.waketime += timer_from_us(100000);
sentinel_timer.waketime = periodic_timer.waketime + 0x80000000;
return SF_RESCHEDULE;
@@ -177,10 +180,17 @@ sched_timer_reset(void)
* Task waking
****************************************************************/
+// Note that at least one task is ready to run
+void
+sched_wake_tasks(void)
+{
+}
+
// Note that a task is ready to run
void
sched_wake_task(struct task_wake *w)
{
+ sched_wake_tasks();
writeb(&w->wake, 1);
}