30 lines
644 B
C++
30 lines
644 B
C++
#pragma once
|
|
#include "thread/Task.h"
|
|
|
|
#define TASK_PAGES_IN_STACK 4
|
|
|
|
namespace Scheduler
|
|
{
|
|
void init();
|
|
void yield();
|
|
void exit(int status);
|
|
void sleep(unsigned long ms);
|
|
void add_kernel_task(void (*task)(void));
|
|
|
|
Task* create_user_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();
|
|
|
|
void reset_task(Task* task, ELFImage* new_image);
|
|
} |