apio
9b39d618de
This function is a Luna alternative to fork() and exec(). Why? Simply because I can't figure out for the life of me how to implement a working fork(). So meanwhile, we have spawn() as a replacement. exec() still exists, though.
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();
|
|
|
|
long 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);
|
|
} |