aboutsummaryrefslogtreecommitdiff
path: root/src/scheduler.h
blob: 14b844c60f4f6684f48f8aa3c3b367e68da550a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once

#include <types.h>
#include "idt.h"
#include "vmm.h"

class Scheduler : public InterruptHandler {
public:
  struct task {
    cpu_state_t* cpu = nullptr;
    vmm* mm = nullptr;

    task() = default;
    task(uint8_t* stack, void (*entry)(), uint16_t cs);
  };

  Scheduler(uint16_t cs);

  [[nodiscard]] uint16_t add_task(task);
  [[nodiscard]] cpu_state_t* trigger(cpu_state_t*) override;

private:
};