2022-09-20 17:58:04 +00:00
|
|
|
#pragma once
|
|
|
|
#include "thread/Task.h"
|
|
|
|
|
|
|
|
namespace Scheduler
|
|
|
|
{
|
|
|
|
void init();
|
|
|
|
void yield();
|
2022-10-08 15:56:40 +00:00
|
|
|
void exit(int status);
|
2022-09-20 17:58:04 +00:00
|
|
|
void sleep(unsigned long ms);
|
|
|
|
void add_kernel_task(void (*task)(void));
|
2022-09-23 14:41:43 +00:00
|
|
|
void add_user_task(void* task);
|
2022-09-21 19:06:00 +00:00
|
|
|
|
2022-10-01 10:28:32 +00:00
|
|
|
void load_user_task(const char* filename);
|
|
|
|
|
2022-10-08 15:56:40 +00:00
|
|
|
void task_exit(Context* context, int64_t status);
|
|
|
|
void task_misbehave(Context* context, int64_t status);
|
2022-09-20 17:58:04 +00:00
|
|
|
|
|
|
|
Task* current_task();
|
|
|
|
|
|
|
|
void task_yield(Context* context);
|
|
|
|
void task_tick(Context* context);
|
2022-09-21 19:06:00 +00:00
|
|
|
|
|
|
|
void reap_task(Task* task);
|
|
|
|
void reap_tasks();
|
2022-10-12 15:08:45 +00:00
|
|
|
|
|
|
|
void reset_task(Task* task, ELFImage* new_image);
|
2022-09-20 17:58:04 +00:00
|
|
|
}
|