-
Notifications
You must be signed in to change notification settings - Fork 0
/
phase1.h
58 lines (43 loc) · 1.08 KB
/
phase1.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
53
54
55
56
57
58
/*
* These are the definitions for phase1 of the project (the kernel).
*/
#ifndef _PHASE1_H
#define _PHASE1_H
#include <usloss.h>
/*
* Maximum number of processes.
*/
#define MAXPROC 50
/*
* Maximum length of a process name
*/
#define MAXNAME 50
/*
* Maximum length of string argument passed to a newly created process
*/
#define MAXARG 100
/*
* Maximum number of syscalls.
*/
#define MAXSYSCALLS 50
/*
* Function prototypes for this phase.
*/
extern int fork1(char *name, int(*func)(char *), char *arg,
int stacksize, int priority);
extern int join(int *status);
extern void quit(int status);
extern int zap(int pid);
extern int isZapped(void);
extern int getpid(void);
extern void dumpProcesses(void);
extern int blockMe(int block_status);
extern int unblockProc(int pid);
extern int readCurStartTime(void);
extern void timeSlice(void);
extern void dispatcher(void);
extern int readtime(void);
extern void p1_fork(int pid);
extern void p1_quit(int pid);
extern void p1_switch(int old, int new);
#endif /* _PHASE1_H */