-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisastrOS_globals.h
32 lines (23 loc) · 953 Bytes
/
disastrOS_globals.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
#pragma once
#include "disastrOS_pcb.h"
/*
Global variables used by disastrOS
*/
//semaphores list
extern ListHead semaphores_list;
extern PCB* init_pcb; // pcb of the init process
extern PCB* running; // pcb of the currently running process
extern int last_pid; // last pid to be generates
extern ListHead ready_list; // list of the ready processes
extern ListHead waiting_list; // list of the waiting processes
extern ListHead zombie_list; // zombies
extern ListHead resources_list; // resources
extern ListHead semaphores_list; //semaphores
extern ListHead timer_list; //timers (concrete)
extern volatile int disastrOS_time; //global time of disastrOS
// a resource can be a device, a file or an ipc thing
typedef void(*SyscallFunctionType)();
// these are used for "trapping" in protected mode
extern ucontext_t main_context;
// this is used for shutting down (set it to 1, and return the control to main)
extern int shutdown_now;