Luna/kernel/src/sys/sched.cpp
apio b035795eb3 Kernel: Move errno.h and (k)assert.h out of the main include directory
This is mostly so IDEs don't pick them up instead of the userspace headers :)
2022-10-19 17:41:23 +02:00

24 lines
506 B
C++

#include "memory/VMM.h"
#include "std/errno.h"
#include "sys/UserMemory.h"
#include "thread/Scheduler.h"
void sys_exit(Context* context, int status)
{
Scheduler::task_exit(context, status);
}
void sys_yield(Context* context)
{
context->rax = 0;
Scheduler::task_yield(context);
}
void sys_sleep(Context* context, uint64_t ms)
{
context->rax = 0;
Task* task = Scheduler::current_task();
task->task_sleep = ms;
task->state = task->Sleeping;
Scheduler::task_yield(context);
}