blob: fbcf6bd63590cdd32a73e9e4ccd17f1ac8cf9f5d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#ifndef SCHEDULER_H
#define SCHEDULER_H
#include "mem.h"
#define MAX_PROC 10
// If you change the following struct
// please consider updating the code in scheduler_asm.S
typedef struct REGISTERS {
u32 eax, ebx, ecx, edx;
u32 cs, eip;
u32 ss, esp, ebp;
u32 esi, edi;
u32 ds, es, fs, gs;
u32 eflags;
} __attribute__((packed)) REGISTERS;
// If you change the following struct
// please consider updating the code in scheduler_asm.S
typedef struct PROC {
u16 id;
u16 pid;
u32* page_dir;
REGISTERS regs;
} __attribute__((packed)) PROC;
extern char show_tics;
extern char scheduler_on;
extern PROC procs[MAX_PROC];
extern u16 current_id;
extern u16 nproc;
void clock();
void schedule();
void task_create(int *page_dir, void *task, int task_size);
void scheduler_start();
#endif
|