-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
datastructs.h
52 lines (43 loc) · 910 Bytes
/
datastructs.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
44
45
46
47
48
49
50
51
52
#ifndef __DATASTRUCTS_H__
#define __DATASTRUCTS_H__
#define NO_CORE_WAITING -1
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
typedef enum {
PROC_NEW,
PROC_READY,
PROC_RUNNING,
PROC_BLOCKED,
PROC_EXIT
} exec_status;
typedef enum {
INSTR_CALC,
INSTR_IO
} instr_type;
typedef struct instruction {
instr_type type;
u_char length;
u_char io_max;
struct instruction *next_instruction;
} instruction;
typedef struct process {
u_short id;
u_int arrival_time;
exec_status status;
char waiting_core_id;
u_int instr_count;
u_int total_cycles;
instruction *instruction_ptr;
struct process *next_process;
} process;
typedef struct queue {
char core_n;
process *first;
process *last;
u_int *earliest;
} queue;
const u_short size_of_proc;
const u_short size_of_inst;
#endif /*__DATASTRUCTS_H__*/