Luna/kernel/include/thread/Scheduler.h
apio f83a6ace51 Kernel, libc: Add support for providing a status code to exit()
The exit() libc function already accepted an integer, but didn't pass it on to the kernel since we had no mechanism for it to do that.
Now, the kernel stores a task's exit status to display it later (and in the future, return it to userspace via wait()/waitpid())
2022-10-08 17:56:40 +02:00

25 lines
563 B
C++

#pragma once
#include "thread/Task.h"
namespace Scheduler
{
void init();
void yield();
void exit(int status);
void sleep(unsigned long ms);
void add_kernel_task(void (*task)(void));
void add_user_task(void* task);
void load_user_task(const char* filename);
void task_exit(Context* context, int64_t status);
void task_misbehave(Context* context, int64_t status);
Task* current_task();
void task_yield(Context* context);
void task_tick(Context* context);
void reap_task(Task* task);
void reap_tasks();
}