Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. #ifndef USERPROG_PROCESS_H
  2. #define USERPROG_PROCESS_H
  3.  
  4. #include "threads/thread.h"
  5. #include "threads/synch.h"
  6.  
  7. tid_t process_execute (const char *command);
  8. int process_wait (tid_t);
  9. void process_exit (void);
  10. void process_activate (void);
  11.  
  12. void kill_current(void);
  13.  
  14. /* Process identifier - same as in lib/user/syscall.h */
  15. typedef int pid_t;
  16. #define PID_ERROR ((pid_t) -1)
  17.  
  18. struct arg_elem
  19. {
  20. char argument[128];
  21. int length;
  22. uint32_t* location;
  23. struct list_elem elem;
  24. };
  25.  
  26. struct process
  27. {
  28. pid_t pid;
  29. struct thread* thread;
  30. struct semaphore running;
  31.  
  32. struct list children;
  33. struct list_elem elem;
  34.  
  35. struct list open_files;
  36.  
  37. int next_fd;
  38. };
  39.  
  40. struct open_file
  41. {
  42. struct file* file;
  43.  
  44. int fd;
  45. };
  46.  
  47.  
  48. #endif /* userprog/process.h */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement