summaryrefslogtreecommitdiffstats
path: root/pintos-progos/userprog/process.h
diff options
context:
space:
mode:
Diffstat (limited to 'pintos-progos/userprog/process.h')
-rw-r--r--pintos-progos/userprog/process.h47
1 files changed, 0 insertions, 47 deletions
diff --git a/pintos-progos/userprog/process.h b/pintos-progos/userprog/process.h
deleted file mode 100644
index 1609801..0000000
--- a/pintos-progos/userprog/process.h
+++ /dev/null
@@ -1,47 +0,0 @@
1#ifndef USERPROG_PROCESS_H
2#define USERPROG_PROCESS_H
3
4#include "threads/thread.h"
5
6/* In the current implementation, the capacity is fixed to 1024 (PGSIZE/4) */
7struct fd_table {
8 struct file** fds;
9 int fd_free; /* lowest-index free FD table entry */
10 int fd_max; /* highest-index used FD table entry */
11 int fd_cap; /* FD table capacity */
12};
13
14struct process {
15 /* process tree */
16 tid_t thread_id;
17 tid_t parent_tid;
18 struct list_elem parentelem; /* Owned by parent */
19
20 /* communication with parent process */
21 struct semaphore exit_sem;
22 struct lock exit_lock;
23 int exit_status;
24
25 /* files */
26 struct file *executable; /* Loaded executable, if any. */
27 struct fd_table fd_table; /* File descriptor table */
28
29 /* Owned by syscall.c */
30 void* syscall_buffer;
31 size_t syscall_buffer_page_cnt;
32};
33
34void process_init (void);
35struct process* process_current (void);
36tid_t process_execute (const char *file_name);
37int process_wait (tid_t);
38void process_exit (void);
39void process_activate (void);
40
41int process_open_file(const char* fname);
42struct file* process_get_file(int fd);
43void process_lock_filesys (void);
44void process_unlock_filesys (void);
45bool process_close_file(int fd);
46
47#endif /* userprog/process.h */