-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprocesses.h
43 lines (39 loc) · 974 Bytes
/
processes.h
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
40
41
42
43
#include "inttypes.h"
// la taille de la pile d'éxécution des processus
#define STACK_LENGTH 512
// nombre de processus qui seront exécutés dans le programme.
#define p_number 2
// defini l'état des processus.
typedef enum proccess_state process_state;
enum proccess_state {
ELU,
ACTIVABLE,
ENDORMI,
MOURANT
};
struct process {
uint32_t pid;
char name[32];
process_state state;
int wake_time;
struct process *next;
uint32_t save_zone[5];
uint32_t reg[STACK_LENGTH+1];
};
//void *context_idle, *context_proc1;
void idle();
void proc1();
uint16_t mon_pid();
char *mon_nom();
void ordonnance();
uint32_t create_process(char *name, void *proc_address);
void fin_processus();
void kill_dead_processes();
void init_processes();
void ctx_sw(void*, void*);
void add_process(struct process *p);
void add_in_sleep (struct process *p);
void wake_up_processes();
struct process *get_next();
void dors(uint32_t nbr_secs);
int nbr_secondes();