|
@@ -88,6 +88,12 @@ struct proc
|
|
|
/* This is the process structure for the kernel and for kernel-only threads. */
|
|
|
extern struct proc * kproc;
|
|
|
|
|
|
+// The process array
|
|
|
+extern struct procs * procs;
|
|
|
+
|
|
|
+// The lock for the above array
|
|
|
+extern struct lock * proclock;
|
|
|
+
|
|
|
/* Semaphore used to signal when there are no more processes */
|
|
|
#ifdef UW
|
|
|
extern struct semaphore * no_proc_sem;
|
|
@@ -97,7 +103,14 @@ extern struct semaphore * no_proc_sem;
|
|
|
void proc_bootstrap(void);
|
|
|
|
|
|
/* Create a fresh process for use by runprogram(). */
|
|
|
-struct proc *proc_create_runprogram(const char * name);
|
|
|
+struct proc *proc_create_runprogram(const char * name);// get and return a pid for the process
|
|
|
+int assignpid(struct proc * proc);
|
|
|
+
|
|
|
+// returns the child process if it is a child, otherwise null
|
|
|
+struct proc * getChild(int pid);
|
|
|
+
|
|
|
+// de-allocates procs' contents (i.e. lock)
|
|
|
+void delete_procs(struct procs * procs);
|
|
|
|
|
|
/* Destroy a process. */
|
|
|
void proc_destroy(struct proc * proc);
|
|
@@ -114,5 +127,14 @@ struct addrspace *curproc_getas(void);
|
|
|
/* Change the address space of the current process, and return the old one. */
|
|
|
struct addrspace *curproc_setas(struct addrspace *);
|
|
|
|
|
|
+// get and return a pid for the process
|
|
|
+int assignpid(struct proc * proc);
|
|
|
+
|
|
|
+// returns the child process if it is a child, otherwise null
|
|
|
+struct proc * getChild(struct proc * p, int pid);
|
|
|
+
|
|
|
+// de-allocates procs' contents (i.e. lock)
|
|
|
+void delete_procs(struct procs * procs);
|
|
|
+
|
|
|
|
|
|
#endif /* _PROC_H_ */
|