-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphase1.h
More file actions
56 lines (41 loc) · 1.29 KB
/
phase1.h
File metadata and controls
56 lines (41 loc) · 1.29 KB
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
/*
* These are the definitions for Phase 1 of the project (the kernel).
* DO NOT MODIFY THIS FILE.
*
* Version: 1.1
*/
#ifndef _PHASE1_H
#define _PHASE1_H
#include "usloss.h"
#include "usyscall.h"
/*
* Maximum number of processes.
*/
#define P1_MAXPROC 50
/*
* Maximum number of semaphores.
*/
#define P1_MAXSEM 1000
typedef void *P1_Semaphore;
/*
* Function prototypes for this phase.
*/
extern int P1_Fork(char *name, int(*func)(void *), void *arg,
int stackSize, int priority, int tag);
extern void P1_Quit(int status);
extern int P1_Join(int tag, int *status);
extern int P1_GetPID(void);
extern int P1_GetState(int pid);
extern void P1_DumpProcesses(void);
extern int P1_SemCreate(char *name, unsigned int value, P1_Semaphore *sem);
extern int P1_SemFree(P1_Semaphore sem);
extern int P1_P(P1_Semaphore sem);
extern int P1_V(P1_Semaphore sem);
extern char *P1_GetName(P1_Semaphore sem);
extern int P1_WaitDevice(int type, int unit, int *status);
extern int P1_WakeupDevice(int type, int unit, int abort);
extern int P1_ReadTime(void);
extern int P2_Startup(void *arg);
extern USLOSS_PTE *P3_AllocatePageTable(int pid);
extern void P3_FreePageTable(int pid);
#endif /* _PHASE1_H */