diff options
author | Christian Cunningham <cc@localhost> | 2022-01-03 20:10:10 -0800 |
---|---|---|
committer | Christian Cunningham <cc@localhost> | 2022-01-03 20:10:10 -0800 |
commit | 1b180d2f15e9b726e6e9dde5601f41fa48c1c044 (patch) | |
tree | 837de56031b3c26b62e8773d2bc671b38da12e53 /src/sys/schedule.q.c | |
parent | 3448a072fab683b97c93922b2d150e530a22b5a3 (diff) |
Ensured Aligned Mutexes
Diffstat (limited to 'src/sys/schedule.q.c')
-rw-r--r-- | src/sys/schedule.q.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/src/sys/schedule.q.c b/src/sys/schedule.q.c deleted file mode 100644 index 88488da..0000000 --- a/src/sys/schedule.q.c +++ /dev/null @@ -1,49 +0,0 @@ -#if !(defined(LL) || defined(FLAT)) -#include "../sys/schedule.h" -#include "../lib/q.h" -#include "../lib/mem.h" - -static struct Q_base bq = { - .next = 0, - .last = 0, -}; -static struct Scheduler scheduler = { - .tasks = &bq, -}; - -void add_fxn(void (*task)(void), unsigned char priority) -{ - struct Task* t = (struct Task*)malloc(sizeof(struct Task)); - t->priority = priority; - t->task = task; - pushq(scheduler.tasks, t); -} - -unsigned int get_task_length(void) -{ - unsigned int length = 0; - if (scheduler.tasks->last == 0) - return length; - else if (scheduler.tasks->next == scheduler.tasks->last) - return 1; - else { - struct Q* q = scheduler.tasks->next; - length += 1; - while (q->next != 0) { - q = q->next; - length += 1; - } - return length; - } -} - -void execute_task(void) -{ - if (scheduler.tasks->last != 0) { - struct Task* tsk = (struct Task*)scheduler.tasks->next->data; - (tsk->task)(); - popq(scheduler.tasks); - } -} - -#endif |