old-MTGos-old/kernel/hal/x86_64/include/Multitasking.hpp

33 lines
703 B
C++
Raw Normal View History

2016-06-17 19:39:43 +00:00
#ifndef MULTITASKING_H
#define MULTITASKING_H
namespace MTGosHAL {
class Multitasking
{
public:
Multitasking();
auto schedule(struct cpu_state* cpu) -> struct cpu_state*;
auto initTask(void(*entry)()) -> struct cpu_state*;
uint32_t tss[32];
protected:
private:
Task* first_task;
Task* curr_task;
};
class Task
{
private:
struct cpu_state* cpu_state;
Task* next;
public:
Task(struct cpu_state*);
auto unpause() -> struct cpu_state*;
auto pause(struct cpu_state*) -> Task *;
auto addTask(Task*) -> void;
auto hasNext() -> bool;
};
} // namespace MTGosHAL
#endif // MULTITASKING_H