Luna/kernel/include/thread/Task.h
apio 1c12cf016e Add a Scheduler.
Finally.

Just Round Robin with sleeping, but it's still awesome. I think this can finish v0.3, with a few adjustments.
2022-09-20 19:58:04 +02:00

16 lines
292 B
C

#pragma once
#include "interrupts/Context.h"
struct Task
{
uint64_t id;
Context regs;
int64_t task_sleep = 0;
int64_t task_time = 0;
Task* next_task = nullptr;
};
void set_context_from_task(Task& task, Context* ctx);
void get_context_to_task(Task& task, Context* ctx);