2018-11-07 21:15:02 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AK/Assertions.h>
|
2018-11-07 23:24:59 +00:00
|
|
|
|
2018-11-07 21:15:02 +00:00
|
|
|
class Process;
|
2018-11-07 23:24:59 +00:00
|
|
|
struct RegisterDump;
|
2018-11-07 21:15:02 +00:00
|
|
|
|
|
|
|
extern Process* current;
|
2019-01-25 06:52:44 +00:00
|
|
|
extern Process* g_last_fpu_process;
|
2019-02-06 17:45:21 +00:00
|
|
|
extern Process* g_finalizer;
|
2018-11-07 21:15:02 +00:00
|
|
|
|
|
|
|
class Scheduler {
|
|
|
|
public:
|
|
|
|
static void initialize();
|
2018-11-07 23:24:59 +00:00
|
|
|
static void timer_tick(RegisterDump&);
|
2018-11-07 21:15:02 +00:00
|
|
|
static bool pick_next();
|
|
|
|
static void pick_next_and_switch_now();
|
|
|
|
static void switch_now();
|
|
|
|
static bool yield();
|
2019-02-07 10:12:23 +00:00
|
|
|
static bool donate_to(Process*, const char* reason);
|
2018-11-07 21:15:02 +00:00
|
|
|
static bool context_switch(Process&);
|
2018-11-07 22:59:49 +00:00
|
|
|
static void prepare_to_modify_tss(Process&);
|
2019-02-04 09:28:12 +00:00
|
|
|
static Process* colonel();
|
2019-02-06 14:05:47 +00:00
|
|
|
static bool is_active();
|
2018-11-07 23:24:59 +00:00
|
|
|
private:
|
|
|
|
static void prepare_for_iret_to_new_process();
|
2018-11-07 21:15:02 +00:00
|
|
|
};
|